LLVMFuzzerTestOneInput:
   43|  4.70k|{
   44|  4.70k|  FuzzedDataProvider fdp(data, size);
   45|  4.70k|  double hdpi = fdp.ConsumeFloatingPoint<double>();
   46|  4.70k|  double vdpi = fdp.ConsumeFloatingPoint<double>();
   47|  4.70k|  int rotate = fdp.ConsumeIntegral<int>();
   48|  4.70k|  bool useMediaBox = fdp.ConsumeBool();
   49|  4.70k|  bool crop = fdp.ConsumeBool();
   50|  4.70k|  bool printing = fdp.ConsumeBool();
   51|  4.70k|  std::vector<char> payload = fdp.ConsumeRemainingBytes<char>();
   52|       |
   53|  4.70k|  Object xpdf_obj;
   54|  4.70k|  xpdf_obj.initNull();
   55|  4.70k|  BaseStream *stream = new MemStream(payload.data(), 0, payload.size(), &xpdf_obj);
   56|       |
   57|  4.70k|  Object info, xfa;
   58|  4.70k|  Object *acroForm;
   59|  4.70k|  globalParams = new GlobalParams(NULL);
   60|  4.70k|  globalParams->setErrQuiet(1);
   61|  4.70k|  globalParams->setupBaseFonts(NULL);
   62|  4.70k|  char yes[] = "yes";
   63|  4.70k|  globalParams->setEnableFreeType(yes); // Yes, it's a string and not a bool.
   64|  4.70k|  globalParams->setErrQuiet(1);
   65|       |
   66|  4.70k|  PDFDoc *doc = NULL;
   67|  4.70k|  try
   68|  4.70k|  {
   69|  4.70k|    PDFDoc doc(stream);
   70|  4.70k|    if (doc.isOk() == gTrue)
  ------------------
  |  |   17|  4.70k|#define gTrue 1
  ------------------
  |  Branch (70:9): [True: 2.33k, False: 2.36k]
  ------------------
   71|  2.33k|    {
   72|  2.33k|      XRef *xref = doc.getXRef();
   73|  2.33k|      int objNums = xref->getNumObjects();
   74|  2.33k|      Object currentObj;
   75|  54.5M|      for (int i = 0; i < objNums; ++i)
  ------------------
  |  Branch (75:23): [True: 54.5M, False: 2.33k]
  ------------------
   76|  54.5M|      {
   77|  54.5M|        if (xref->fetch(i, 0, &currentObj)->isStream())
  ------------------
  |  Branch (77:13): [True: 14.2k, False: 54.5M]
  ------------------
   78|  14.2k|        {
   79|  14.2k|          currentObj.getStream()->reset();
   80|  14.2k|        }
   81|  54.5M|      }
   82|  2.33k|      currentObj.free();
   83|  2.33k|    }
   84|  4.70k|  }
   85|  4.70k|  catch (...)
   86|  4.70k|  {
   87|     26|  }
   88|       |
   89|  4.70k|  delete globalParams;
   90|       |
   91|  4.70k|  return 0;
   92|  4.70k|}

_ZN5GHashC2Ei:
   34|  1.12M|GHash::GHash(GBool deleteKeysA) {
   35|  1.12M|  int h;
   36|       |
   37|  1.12M|  deleteKeys = deleteKeysA;
   38|  1.12M|  size = 7;
   39|  1.12M|  tab = (GHashBucket **)gmallocn(size, sizeof(GHashBucket *));
   40|  9.00M|  for (h = 0; h < size; ++h) {
  ------------------
  |  Branch (40:15): [True: 7.87M, False: 1.12M]
  ------------------
   41|       |    tab[h] = NULL;
   42|  7.87M|  }
   43|  1.12M|  len = 0;
   44|  1.12M|}
_ZN5GHashD2Ev:
   46|  1.12M|GHash::~GHash() {
   47|  1.12M|  GHashBucket *p;
   48|  1.12M|  int h;
   49|       |
   50|  9.01M|  for (h = 0; h < size; ++h) {
  ------------------
  |  Branch (50:15): [True: 7.88M, False: 1.12M]
  ------------------
   51|  8.06M|    while (tab[h]) {
  ------------------
  |  Branch (51:12): [True: 178k, False: 7.88M]
  ------------------
   52|   178k|      p = tab[h];
   53|   178k|      tab[h] = p->next;
   54|   178k|      if (deleteKeys) {
  ------------------
  |  Branch (54:11): [True: 5.02k, False: 173k]
  ------------------
   55|  5.02k|	delete p->key;
   56|  5.02k|      }
   57|   178k|      delete p;
   58|   178k|    }
   59|  7.88M|  }
   60|  1.12M|  gfree(tab);
   61|  1.12M|}
_ZN5GHash3addEP7GStringPv:
   63|   150k|void GHash::add(GString *key, void *val) {
   64|   150k|  GHashBucket *p;
   65|   150k|  int h;
   66|       |
   67|       |  // expand the table if necessary
   68|   150k|  if (len >= size) {
  ------------------
  |  Branch (68:7): [True: 723, False: 149k]
  ------------------
   69|    723|    expand();
   70|    723|  }
   71|       |
   72|       |  // add the new symbol
   73|   150k|  p = new GHashBucket;
   74|   150k|  p->key = key;
   75|   150k|  p->val.p = val;
   76|   150k|  h = hash(key);
   77|   150k|  p->next = tab[h];
   78|   150k|  tab[h] = p;
   79|   150k|  ++len;
   80|   150k|}
_ZN5GHash3addEP7GStringi:
   82|  28.2k|void GHash::add(GString *key, int val) {
   83|  28.2k|  GHashBucket *p;
   84|  28.2k|  int h;
   85|       |
   86|       |  // expand the table if necessary
   87|  28.2k|  if (len >= size) {
  ------------------
  |  Branch (87:7): [True: 386, False: 27.8k]
  ------------------
   88|    386|    expand();
   89|    386|  }
   90|       |
   91|       |  // add the new symbol
   92|  28.2k|  p = new GHashBucket;
   93|  28.2k|  p->key = key;
   94|  28.2k|  p->val.i = val;
   95|  28.2k|  h = hash(key);
   96|  28.2k|  p->next = tab[h];
   97|  28.2k|  tab[h] = p;
   98|  28.2k|  ++len;
   99|  28.2k|}
_ZN5GHash7replaceEP7GStringi:
  115|  39.2k|void GHash::replace(GString *key, int val) {
  116|  39.2k|  GHashBucket *p;
  117|  39.2k|  int h;
  118|       |
  119|  39.2k|  if ((p = find(key, &h))) {
  ------------------
  |  Branch (119:7): [True: 11.0k, False: 28.2k]
  ------------------
  120|  11.0k|    p->val.i = val;
  121|  11.0k|    if (deleteKeys) {
  ------------------
  |  Branch (121:9): [True: 0, False: 11.0k]
  ------------------
  122|      0|      delete key;
  123|      0|    }
  124|  28.2k|  } else {
  125|  28.2k|    add(key, val);
  126|  28.2k|  }
  127|  39.2k|}
_ZN5GHash6lookupEP7GString:
  129|  3.30k|void *GHash::lookup(GString *key) {
  130|  3.30k|  GHashBucket *p;
  131|  3.30k|  int h;
  132|       |
  133|  3.30k|  if (!(p = find(key, &h))) {
  ------------------
  |  Branch (133:7): [True: 3.29k, False: 8]
  ------------------
  134|  3.29k|    return NULL;
  135|  3.29k|  }
  136|      8|  return p->val.p;
  137|  3.30k|}
_ZN5GHash9lookupIntEP7GString:
  139|  39.2k|int GHash::lookupInt(GString *key) {
  140|  39.2k|  GHashBucket *p;
  141|  39.2k|  int h;
  142|       |
  143|  39.2k|  if (!(p = find(key, &h))) {
  ------------------
  |  Branch (143:7): [True: 28.2k, False: 11.0k]
  ------------------
  144|  28.2k|    return 0;
  145|  28.2k|  }
  146|  11.0k|  return p->val.i;
  147|  39.2k|}
_ZN5GHash6lookupEPKc:
  149|   518k|void *GHash::lookup(const char *key) {
  150|   518k|  GHashBucket *p;
  151|   518k|  int h;
  152|       |
  153|   518k|  if (!(p = find(key, &h))) {
  ------------------
  |  Branch (153:7): [True: 478k, False: 40.1k]
  ------------------
  154|   478k|    return NULL;
  155|   478k|  }
  156|  40.1k|  return p->val.p;
  157|   518k|}
_ZN5GHash9startIterEPP9GHashIter:
  261|  1.07M|void GHash::startIter(GHashIter **iter) {
  262|  1.07M|  *iter = new GHashIter;
  263|  1.07M|  (*iter)->h = -1;
  264|       |  (*iter)->p = NULL;
  265|  1.07M|}
_ZN5GHash7getNextEPP9GHashIterPP7GStringPPv:
  267|  1.22M|GBool GHash::getNext(GHashIter **iter, GString **key, void **val) {
  268|  1.22M|  if (!*iter) {
  ------------------
  |  Branch (268:7): [True: 0, False: 1.22M]
  ------------------
  269|      0|    return gFalse;
  ------------------
  |  |   18|      0|#define gFalse 0
  ------------------
  270|      0|  }
  271|  1.22M|  if ((*iter)->p) {
  ------------------
  |  Branch (271:7): [True: 150k, False: 1.07M]
  ------------------
  272|   150k|    (*iter)->p = (*iter)->p->next;
  273|   150k|  }
  274|  8.79M|  while (!(*iter)->p) {
  ------------------
  |  Branch (274:10): [True: 8.64M, False: 150k]
  ------------------
  275|  8.64M|    if (++(*iter)->h == size) {
  ------------------
  |  Branch (275:9): [True: 1.07M, False: 7.56M]
  ------------------
  276|  1.07M|      delete *iter;
  277|  1.07M|      *iter = NULL;
  278|  1.07M|      return gFalse;
  ------------------
  |  |   18|  1.07M|#define gFalse 0
  ------------------
  279|  1.07M|    }
  280|  7.56M|    (*iter)->p = tab[(*iter)->h];
  281|  7.56M|  }
  282|   150k|  *key = (*iter)->p->key;
  283|   150k|  *val = (*iter)->p->val.p;
  284|   150k|  return gTrue;
  ------------------
  |  |   17|   150k|#define gTrue 1
  ------------------
  285|  1.22M|}
_ZN5GHash6expandEv:
  312|  1.10k|void GHash::expand() {
  313|  1.10k|  GHashBucket **oldTab;
  314|  1.10k|  GHashBucket *p;
  315|  1.10k|  int oldSize, h, i;
  316|       |
  317|  1.10k|  oldSize = size;
  318|  1.10k|  oldTab = tab;
  319|  1.10k|  size = 2*size + 1;
  320|  1.10k|  tab = (GHashBucket **)gmallocn(size, sizeof(GHashBucket *));
  321|  26.3k|  for (h = 0; h < size; ++h) {
  ------------------
  |  Branch (321:15): [True: 25.2k, False: 1.10k]
  ------------------
  322|  25.2k|    tab[h] = NULL;
  323|  25.2k|  }
  324|  13.1k|  for (i = 0; i < oldSize; ++i) {
  ------------------
  |  Branch (324:15): [True: 12.0k, False: 1.10k]
  ------------------
  325|  24.1k|    while (oldTab[i]) {
  ------------------
  |  Branch (325:12): [True: 12.0k, False: 12.0k]
  ------------------
  326|  12.0k|      p = oldTab[i];
  327|  12.0k|      oldTab[i] = oldTab[i]->next;
  328|  12.0k|      h = hash(p->key);
  329|  12.0k|      p->next = tab[h];
  330|  12.0k|      tab[h] = p;
  331|  12.0k|    }
  332|  12.0k|  }
  333|  1.10k|  gfree(oldTab);
  334|  1.10k|}
_ZN5GHash4findEP7GStringPi:
  336|  81.8k|GHashBucket *GHash::find(GString *key, int *h) {
  337|  81.8k|  GHashBucket *p;
  338|       |
  339|  81.8k|  *h = hash(key);
  340|  95.7k|  for (p = tab[*h]; p; p = p->next) {
  ------------------
  |  Branch (340:21): [True: 35.9k, False: 59.7k]
  ------------------
  341|  35.9k|    if (!p->key->cmp(key)) {
  ------------------
  |  Branch (341:9): [True: 22.1k, False: 13.8k]
  ------------------
  342|  22.1k|      return p;
  343|  22.1k|    }
  344|  35.9k|  }
  345|  59.7k|  return NULL;
  346|  81.8k|}
_ZN5GHash4findEPKcPi:
  348|   518k|GHashBucket *GHash::find(const char *key, int *h) {
  349|   518k|  GHashBucket *p;
  350|       |
  351|   518k|  *h = hash(key);
  352|   524k|  for (p = tab[*h]; p; p = p->next) {
  ------------------
  |  Branch (352:21): [True: 46.3k, False: 478k]
  ------------------
  353|  46.3k|    if (!p->key->cmp(key)) {
  ------------------
  |  Branch (353:9): [True: 40.1k, False: 6.19k]
  ------------------
  354|  40.1k|      return p;
  355|  40.1k|    }
  356|  46.3k|  }
  357|   478k|  return NULL;
  358|   518k|}
_ZN5GHash4hashEP7GString:
  360|   272k|int GHash::hash(GString *key) {
  361|   272k|  const char *p;
  362|   272k|  unsigned int h;
  363|   272k|  int i;
  364|       |
  365|   272k|  h = 0;
  366|  18.6M|  for (p = key->getCString(), i = 0; i < key->getLength(); ++p, ++i) {
  ------------------
  |  Branch (366:38): [True: 18.3M, False: 272k]
  ------------------
  367|  18.3M|    h = 17 * h + (int)(*p & 0xff);
  368|  18.3M|  }
  369|   272k|  return (int)(h % size);
  370|   272k|}
_ZN5GHash4hashEPKc:
  372|   518k|int GHash::hash(const char *key) {
  373|   518k|  const char *p;
  374|   518k|  unsigned int h;
  375|       |
  376|   518k|  h = 0;
  377|  4.50M|  for (p = key; *p; ++p) {
  ------------------
  |  Branch (377:17): [True: 3.98M, False: 518k]
  ------------------
  378|  3.98M|    h = 17 * h + (int)(*p & 0xff);
  379|  3.98M|  }
  380|   518k|  return (int)(h % size);
  381|   518k|}

_ZN5GListC2Ev:
   21|   502k|GList::GList() {
   22|   502k|  size = 8;
   23|   502k|  data = (void **)gmallocn(size, sizeof(void*));
   24|   502k|  length = 0;
   25|   502k|  inc = 0;
   26|   502k|}
_ZN5GListD2Ev:
   35|   501k|GList::~GList() {
   36|   501k|  gfree(data);
   37|   501k|}
_ZN5GList6appendEPv:
   49|  1.84M|void GList::append(void *p) {
   50|  1.84M|  if (length >= size) {
  ------------------
  |  Branch (50:7): [True: 21.2k, False: 1.82M]
  ------------------
   51|  21.2k|    expand();
   52|  21.2k|  }
   53|  1.84M|  data[length++] = p;
   54|  1.84M|}
_ZN5GList6expandEv:
  116|  21.2k|void GList::expand() {
  117|  21.2k|  size += (inc > 0) ? inc : size;
  ------------------
  |  Branch (117:11): [True: 0, False: 21.2k]
  ------------------
  118|  21.2k|  data = (void **)greallocn(data, size, sizeof(void*));
  119|  21.2k|}

_ZN5GList9getLengthEv:
   35|  11.1M|  int getLength() { return length; }
_ZN5GList3getEi:
   44|  3.06M|  void *get(int i) { return data[i]; }

Object.cc:_ZL16gAtomicIncrementPl:
   67|  2.16M|static inline GAtomicCounter gAtomicIncrement(GAtomicCounter *counter) {
   68|  2.16M|  GAtomicCounter newVal;
   69|       |
   70|       |#if defined(_WIN32)
   71|       |  newVal = _InterlockedIncrement(counter);
   72|       |#elif defined(__GNUC__) || defined(__xlC__)
   73|       |  // __GNUC__ also covers LLVM/clang
   74|  2.16M|  newVal = __sync_add_and_fetch(counter, 1);
   75|       |#elif defined(__SUNPRO_CC)
   76|       |  newVal = atomic_inc_ulong_nv((ulong_t *)counter);
   77|       |#else
   78|       |#  error "gAtomicIncrement is not defined for this compiler/platform"
   79|       |#endif
   80|  2.16M|  return newVal;
   81|  2.16M|}
Object.cc:_ZL16gAtomicDecrementPl:
   85|  3.26M|static inline GAtomicCounter gAtomicDecrement(GAtomicCounter *counter) {
   86|  3.26M|  GAtomicCounter newVal;
   87|       |
   88|       |#if defined(_WIN32)
   89|       |  newVal = _InterlockedDecrement(counter);
   90|       |#elif defined(__GNUC__) || defined(__xlC__)
   91|       |  // __GNUC__ also covers LLVM/clang
   92|  3.26M|  newVal = __sync_sub_and_fetch(counter, 1);
   93|       |#elif defined(__SUNPRO_CC)
   94|       |  newVal = atomic_dec_ulong_nv((ulong_t *)counter);
   95|       |#else
   96|       |#  error "gAtomicDecrement is not defined for this compiler/platform"
   97|       |#endif
   98|  3.26M|  return newVal;
   99|  3.26M|}

_ZN7GStringC2Ev:
  129|  3.05M|GString::GString() {
  130|       |  s = NULL;
  131|  3.05M|  resize(length = 0);
  132|  3.05M|  s[0] = '\0';
  133|  3.05M|}
_ZN7GStringC2EPKc:
  135|  1.14M|GString::GString(const char *sA) {
  136|  1.14M|  int n = (int)strlen(sA);
  137|       |
  138|       |  s = NULL;
  139|  1.14M|  resize(length = n);
  140|  1.14M|  memcpy(s, sA, n + 1);
  141|  1.14M|}
_ZN7GStringC2EPKci:
  143|   964k|GString::GString(const char *sA, int lengthA) {
  144|       |  s = NULL;
  145|   964k|  resize(length = lengthA);
  146|   964k|  memcpy(s, sA, length * sizeof(char));
  147|   964k|  s[length] = '\0';
  148|   964k|}
_ZN7GStringC2EPS_:
  157|   635k|GString::GString(GString *str) {
  158|       |  s = NULL;
  159|   635k|  resize(length = str->getLength());
  160|   635k|  memcpy(s, str->getCString(), length + 1);
  161|   635k|}
_ZN7GString6formatEPKcz:
  185|  35.4k|GString *GString::format(const char *fmt, ...) {
  186|  35.4k|  va_list argList;
  187|  35.4k|  GString *s;
  188|       |
  189|  35.4k|  s = new GString();
  190|  35.4k|  va_start(argList, fmt);
  191|  35.4k|  s->appendfv(fmt, argList);
  192|       |  va_end(argList);
  193|  35.4k|  return s;
  194|  35.4k|}
_ZN7GStringD2Ev:
  204|  5.74M|GString::~GString() {
  205|  5.74M|  delete[] s;
  206|  5.74M|}
_ZN7GString6appendEc:
  214|  7.01M|GString *GString::append(char c) {
  215|  7.01M|  if (length > INT_MAX - 1) {
  ------------------
  |  Branch (215:7): [True: 0, False: 7.01M]
  ------------------
  216|      0|    gMemError("Integer overflow in GString::append()");
  217|      0|  }
  218|  7.01M|  resize(length + 1);
  219|  7.01M|  s[length++] = c;
  220|  7.01M|  s[length] = '\0';
  221|  7.01M|  return this;
  222|  7.01M|}
_ZN7GString6appendEPS_:
  224|   300k|GString *GString::append(GString *str) {
  225|   300k|  int n = str->getLength();
  226|       |
  227|   300k|  if (length > INT_MAX - n) {
  ------------------
  |  Branch (227:7): [True: 0, False: 300k]
  ------------------
  228|      0|    gMemError("Integer overflow in GString::append()");
  229|      0|  }
  230|   300k|  resize(length + n);
  231|   300k|  memcpy(s + length, str->getCString(), n + 1);
  232|   300k|  length += n;
  233|   300k|  return this;
  234|   300k|}
_ZN7GString6appendEPKc:
  236|   371k|GString *GString::append(const char *str) {
  237|   371k|  int n = (int)strlen(str);
  238|       |
  239|   371k|  if (length > INT_MAX - n) {
  ------------------
  |  Branch (239:7): [True: 0, False: 371k]
  ------------------
  240|      0|    gMemError("Integer overflow in GString::append()");
  241|      0|  }
  242|   371k|  resize(length + n);
  243|   371k|  memcpy(s + length, str, n + 1);
  244|   371k|  length += n;
  245|   371k|  return this;
  246|   371k|}
_ZN7GString6appendEPKci:
  248|  3.55M|GString *GString::append(const char *str, int lengthA) {
  249|  3.55M|  if (lengthA < 0 || length > INT_MAX - lengthA) {
  ------------------
  |  Branch (249:7): [True: 0, False: 3.55M]
  |  Branch (249:22): [True: 0, False: 3.55M]
  ------------------
  250|      0|    gMemError("Integer overflow in GString::append()");
  251|      0|  }
  252|  3.55M|  resize(length + lengthA);
  253|  3.55M|  memcpy(s + length, str, lengthA);
  254|  3.55M|  length += lengthA;
  255|  3.55M|  s[length] = '\0';
  256|  3.55M|  return this;
  257|  3.55M|}
_ZN7GString7appendfEPKcz:
  259|  39.2k|GString *GString::appendf(const char *fmt, ...) {
  260|  39.2k|  va_list argList;
  261|       |
  262|  39.2k|  va_start(argList, fmt);
  263|  39.2k|  appendfv(fmt, argList);
  264|       |  va_end(argList);
  265|  39.2k|  return this;
  266|  39.2k|}
_ZN7GString8appendfvEPKcP13__va_list_tag:
  268|  74.6k|GString *GString::appendfv(const char *fmt, va_list argList) {
  269|  74.6k|  GStringFormatArg *args;
  270|  74.6k|  int argsLen, argsSize;
  271|  74.6k|  GStringFormatArg arg;
  272|  74.6k|  int idx, width, prec;
  273|  74.6k|  GBool reverseAlign, zeroFill;
  274|  74.6k|  GStringFormatType ft;
  275|  74.6k|  char buf[65];
  276|  74.6k|  int len, i;
  277|  74.6k|  const char *p0, *p1;
  278|  74.6k|  const char *str;
  279|       |
  280|  74.6k|  argsLen = 0;
  281|  74.6k|  argsSize = 8;
  282|  74.6k|  args = (GStringFormatArg *)gmallocn(argsSize, sizeof(GStringFormatArg));
  283|       |
  284|  74.6k|  p0 = fmt;
  285|   298k|  while (*p0) {
  ------------------
  |  Branch (285:10): [True: 224k, False: 74.6k]
  ------------------
  286|   224k|    if (*p0 == '{') {
  ------------------
  |  Branch (286:9): [True: 110k, False: 113k]
  ------------------
  287|   110k|      ++p0;
  288|   110k|      if (*p0 == '{') {
  ------------------
  |  Branch (288:11): [True: 0, False: 110k]
  ------------------
  289|      0|	++p0;
  290|      0|	append('{');
  291|   110k|      } else {
  292|       |
  293|       |	// parse the format string
  294|   110k|	if (!(*p0 >= '0' && *p0 <= '9')) {
  ------------------
  |  Branch (294:8): [True: 110k, False: 0]
  |  Branch (294:22): [True: 110k, False: 0]
  ------------------
  295|      0|	  break;
  296|      0|	}
  297|   110k|	idx = *p0 - '0';
  298|   110k|	for (++p0; *p0 >= '0' && *p0 <= '9'; ++p0) {
  ------------------
  |  Branch (298:13): [True: 110k, False: 0]
  |  Branch (298:27): [True: 0, False: 110k]
  ------------------
  299|      0|	  idx = 10 * idx + (*p0 - '0');
  300|      0|	}
  301|   110k|	if (*p0 != ':') {
  ------------------
  |  Branch (301:6): [True: 0, False: 110k]
  ------------------
  302|      0|	  break;
  303|      0|	}
  304|   110k|	++p0;
  305|   110k|	if (*p0 == '-') {
  ------------------
  |  Branch (305:6): [True: 0, False: 110k]
  ------------------
  306|      0|	  reverseAlign = gTrue;
  ------------------
  |  |   17|      0|#define gTrue 1
  ------------------
  307|      0|	  ++p0;
  308|   110k|	} else {
  309|   110k|	  reverseAlign = gFalse;
  ------------------
  |  |   18|   110k|#define gFalse 0
  ------------------
  310|   110k|	}
  311|   110k|	width = 0;
  312|   110k|	zeroFill = *p0 == '0';
  313|   110k|	for (; *p0 >= '0' && *p0 <= '9'; ++p0) {
  ------------------
  |  Branch (313:9): [True: 110k, False: 0]
  |  Branch (313:23): [True: 0, False: 110k]
  ------------------
  314|      0|	  width = 10 * width + (*p0 - '0');
  315|      0|	}
  316|   110k|	if (width < 0) {
  ------------------
  |  Branch (316:6): [True: 0, False: 110k]
  ------------------
  317|      0|	  width = 0;
  318|      0|	}
  319|   110k|	if (*p0 == '.') {
  ------------------
  |  Branch (319:6): [True: 0, False: 110k]
  ------------------
  320|      0|	  ++p0;
  321|      0|	  prec = 0;
  322|      0|	  for (; *p0 >= '0' && *p0 <= '9'; ++p0) {
  ------------------
  |  Branch (322:11): [True: 0, False: 0]
  |  Branch (322:25): [True: 0, False: 0]
  ------------------
  323|      0|	    prec = 10 * prec + (*p0 - '0');
  324|      0|	  }
  325|   110k|	} else {
  326|   110k|	  prec = 0;
  327|   110k|	}
  328|   110k|	for (ft = (GStringFormatType)0;
  329|  2.09M|	     formatStrings[ft];
  ------------------
  |  Branch (329:7): [True: 2.09M, False: 0]
  ------------------
  330|  2.09M|	     ft = (GStringFormatType)(ft + 1)) {
  331|  2.09M|	  if (!strncmp(p0, formatStrings[ft], strlen(formatStrings[ft]))) {
  ------------------
  |  Branch (331:8): [True: 110k, False: 1.98M]
  ------------------
  332|   110k|	    break;
  333|   110k|	  }
  334|  2.09M|	}
  335|   110k|	if (!formatStrings[ft]) {
  ------------------
  |  Branch (335:6): [True: 0, False: 110k]
  ------------------
  336|      0|	  break;
  337|      0|	}
  338|   110k|	p0 += strlen(formatStrings[ft]);
  339|   110k|	if (*p0 != '}') {
  ------------------
  |  Branch (339:6): [True: 0, False: 110k]
  ------------------
  340|      0|	  break;
  341|      0|	}
  342|   110k|	++p0;
  343|       |
  344|       |	// fetch the argument
  345|   110k|	if (idx > argsLen) {
  ------------------
  |  Branch (345:6): [True: 0, False: 110k]
  ------------------
  346|      0|	  break;
  347|      0|	}
  348|   110k|	if (idx == argsLen) {
  ------------------
  |  Branch (348:6): [True: 110k, False: 0]
  ------------------
  349|   110k|	  if (argsLen == argsSize) {
  ------------------
  |  Branch (349:8): [True: 0, False: 110k]
  ------------------
  350|      0|	    argsSize *= 2;
  351|      0|	    args = (GStringFormatArg *)greallocn(args, argsSize,
  352|      0|						 sizeof(GStringFormatArg));
  353|      0|	  }
  354|   110k|	  switch (ft) {
  ------------------
  |  Branch (354:12): [True: 110k, False: 0]
  ------------------
  355|  39.2k|	  case fmtIntDecimal:
  ------------------
  |  Branch (355:4): [True: 39.2k, False: 70.8k]
  ------------------
  356|  39.2k|	  case fmtIntHex:
  ------------------
  |  Branch (356:4): [True: 0, False: 110k]
  ------------------
  357|  39.2k|	  case fmtIntOctal:
  ------------------
  |  Branch (357:4): [True: 0, False: 110k]
  ------------------
  358|  39.2k|	  case fmtIntBinary:
  ------------------
  |  Branch (358:4): [True: 0, False: 110k]
  ------------------
  359|  39.2k|	  case fmtSpace:
  ------------------
  |  Branch (359:4): [True: 0, False: 110k]
  ------------------
  360|  39.2k|	    args[argsLen].i = va_arg(argList, int);
  361|  39.2k|	    break;
  362|      0|	  case fmtUIntDecimal:
  ------------------
  |  Branch (362:4): [True: 0, False: 110k]
  ------------------
  363|      0|	  case fmtUIntHex:
  ------------------
  |  Branch (363:4): [True: 0, False: 110k]
  ------------------
  364|      0|	  case fmtUIntOctal:
  ------------------
  |  Branch (364:4): [True: 0, False: 110k]
  ------------------
  365|      0|	  case fmtUIntBinary:
  ------------------
  |  Branch (365:4): [True: 0, False: 110k]
  ------------------
  366|      0|	    args[argsLen].ui = va_arg(argList, Guint);
  367|      0|	    break;
  368|      0|	  case fmtLongDecimal:
  ------------------
  |  Branch (368:4): [True: 0, False: 110k]
  ------------------
  369|      0|	  case fmtLongHex:
  ------------------
  |  Branch (369:4): [True: 0, False: 110k]
  ------------------
  370|      0|	  case fmtLongOctal:
  ------------------
  |  Branch (370:4): [True: 0, False: 110k]
  ------------------
  371|      0|	  case fmtLongBinary:
  ------------------
  |  Branch (371:4): [True: 0, False: 110k]
  ------------------
  372|      0|	    args[argsLen].l = va_arg(argList, long);
  373|      0|	    break;
  374|      0|	  case fmtULongDecimal:
  ------------------
  |  Branch (374:4): [True: 0, False: 110k]
  ------------------
  375|      0|	  case fmtULongHex:
  ------------------
  |  Branch (375:4): [True: 0, False: 110k]
  ------------------
  376|      0|	  case fmtULongOctal:
  ------------------
  |  Branch (376:4): [True: 0, False: 110k]
  ------------------
  377|      0|	  case fmtULongBinary:
  ------------------
  |  Branch (377:4): [True: 0, False: 110k]
  ------------------
  378|      0|	    args[argsLen].ul = va_arg(argList, Gulong);
  379|      0|	    break;
  380|      0|#ifdef LLONG_MAX
  381|      0|	  case fmtLongLongDecimal:
  ------------------
  |  Branch (381:4): [True: 0, False: 110k]
  ------------------
  382|      0|	  case fmtLongLongHex:
  ------------------
  |  Branch (382:4): [True: 0, False: 110k]
  ------------------
  383|      0|	  case fmtLongLongOctal:
  ------------------
  |  Branch (383:4): [True: 0, False: 110k]
  ------------------
  384|      0|	  case fmtLongLongBinary:
  ------------------
  |  Branch (384:4): [True: 0, False: 110k]
  ------------------
  385|      0|	    args[argsLen].ll = va_arg(argList, long long);
  386|      0|	    break;
  387|      0|#endif
  388|      0|#ifdef ULLONG_MAX
  389|      0|	  case fmtULongLongDecimal:
  ------------------
  |  Branch (389:4): [True: 0, False: 110k]
  ------------------
  390|      0|	  case fmtULongLongHex:
  ------------------
  |  Branch (390:4): [True: 0, False: 110k]
  ------------------
  391|      0|	  case fmtULongLongOctal:
  ------------------
  |  Branch (391:4): [True: 0, False: 110k]
  ------------------
  392|      0|	  case fmtULongLongBinary:
  ------------------
  |  Branch (392:4): [True: 0, False: 110k]
  ------------------
  393|      0|	    args[argsLen].ull = va_arg(argList, unsigned long long);
  394|      0|	    break;
  395|      0|#endif
  396|      0|	  case fmtDouble:
  ------------------
  |  Branch (396:4): [True: 0, False: 110k]
  ------------------
  397|      0|	  case fmtDoubleTrim:
  ------------------
  |  Branch (397:4): [True: 0, False: 110k]
  ------------------
  398|      0|	    args[argsLen].f = va_arg(argList, double);
  399|      0|	    break;
  400|      0|	  case fmtChar:
  ------------------
  |  Branch (400:4): [True: 0, False: 110k]
  ------------------
  401|      0|	    args[argsLen].c = (char)va_arg(argList, int);
  402|      0|	    break;
  403|      0|	  case fmtString:
  ------------------
  |  Branch (403:4): [True: 0, False: 110k]
  ------------------
  404|      0|	    args[argsLen].s = va_arg(argList, char *);
  405|      0|	    break;
  406|  70.8k|	  case fmtGString:
  ------------------
  |  Branch (406:4): [True: 70.8k, False: 39.2k]
  ------------------
  407|  70.8k|	    args[argsLen].gs = va_arg(argList, GString *);
  408|  70.8k|	    break;
  409|   110k|	  }
  410|   110k|	  ++argsLen;
  411|   110k|	}
  412|       |
  413|       |	// format the argument
  414|   110k|	arg = args[idx];
  415|   110k|	str = NULL;
  416|   110k|	len = 0;
  417|   110k|	switch (ft) {
  ------------------
  |  Branch (417:10): [True: 110k, False: 0]
  ------------------
  418|  39.2k|	case fmtIntDecimal:
  ------------------
  |  Branch (418:2): [True: 39.2k, False: 70.8k]
  ------------------
  419|  39.2k|	  formatInt(arg.i, buf, sizeof(buf), zeroFill, width, 10, &str, &len);
  420|  39.2k|	  break;
  421|      0|	case fmtIntHex:
  ------------------
  |  Branch (421:2): [True: 0, False: 110k]
  ------------------
  422|      0|	  formatInt(arg.i, buf, sizeof(buf), zeroFill, width, 16, &str, &len);
  423|      0|	  break;
  424|      0|	case fmtIntOctal:
  ------------------
  |  Branch (424:2): [True: 0, False: 110k]
  ------------------
  425|      0|	  formatInt(arg.i, buf, sizeof(buf), zeroFill, width, 8, &str, &len);
  426|      0|	  break;
  427|      0|	case fmtIntBinary:
  ------------------
  |  Branch (427:2): [True: 0, False: 110k]
  ------------------
  428|      0|	  formatInt(arg.i, buf, sizeof(buf), zeroFill, width, 2, &str, &len);
  429|      0|	  break;
  430|      0|	case fmtUIntDecimal:
  ------------------
  |  Branch (430:2): [True: 0, False: 110k]
  ------------------
  431|      0|	  formatUInt(arg.ui, buf, sizeof(buf), zeroFill, width, 10,
  432|      0|		     &str, &len);
  433|      0|	  break;
  434|      0|	case fmtUIntHex:
  ------------------
  |  Branch (434:2): [True: 0, False: 110k]
  ------------------
  435|      0|	  formatUInt(arg.ui, buf, sizeof(buf), zeroFill, width, 16,
  436|      0|		     &str, &len);
  437|      0|	  break;
  438|      0|	case fmtUIntOctal:
  ------------------
  |  Branch (438:2): [True: 0, False: 110k]
  ------------------
  439|      0|	  formatUInt(arg.ui, buf, sizeof(buf), zeroFill, width, 8, &str, &len);
  440|      0|	  break;
  441|      0|	case fmtUIntBinary:
  ------------------
  |  Branch (441:2): [True: 0, False: 110k]
  ------------------
  442|      0|	  formatUInt(arg.ui, buf, sizeof(buf), zeroFill, width, 2, &str, &len);
  443|      0|	  break;
  444|      0|	case fmtLongDecimal:
  ------------------
  |  Branch (444:2): [True: 0, False: 110k]
  ------------------
  445|      0|	  formatInt(arg.l, buf, sizeof(buf), zeroFill, width, 10, &str, &len);
  446|      0|	  break;
  447|      0|	case fmtLongHex:
  ------------------
  |  Branch (447:2): [True: 0, False: 110k]
  ------------------
  448|      0|	  formatInt(arg.l, buf, sizeof(buf), zeroFill, width, 16, &str, &len);
  449|      0|	  break;
  450|      0|	case fmtLongOctal:
  ------------------
  |  Branch (450:2): [True: 0, False: 110k]
  ------------------
  451|      0|	  formatInt(arg.l, buf, sizeof(buf), zeroFill, width, 8, &str, &len);
  452|      0|	  break;
  453|      0|	case fmtLongBinary:
  ------------------
  |  Branch (453:2): [True: 0, False: 110k]
  ------------------
  454|      0|	  formatInt(arg.l, buf, sizeof(buf), zeroFill, width, 2, &str, &len);
  455|      0|	  break;
  456|      0|	case fmtULongDecimal:
  ------------------
  |  Branch (456:2): [True: 0, False: 110k]
  ------------------
  457|      0|	  formatUInt(arg.ul, buf, sizeof(buf), zeroFill, width, 10,
  458|      0|		     &str, &len);
  459|      0|	  break;
  460|      0|	case fmtULongHex:
  ------------------
  |  Branch (460:2): [True: 0, False: 110k]
  ------------------
  461|      0|	  formatUInt(arg.ul, buf, sizeof(buf), zeroFill, width, 16,
  462|      0|		     &str, &len);
  463|      0|	  break;
  464|      0|	case fmtULongOctal:
  ------------------
  |  Branch (464:2): [True: 0, False: 110k]
  ------------------
  465|      0|	  formatUInt(arg.ul, buf, sizeof(buf), zeroFill, width, 8, &str, &len);
  466|      0|	  break;
  467|      0|	case fmtULongBinary:
  ------------------
  |  Branch (467:2): [True: 0, False: 110k]
  ------------------
  468|      0|	  formatUInt(arg.ul, buf, sizeof(buf), zeroFill, width, 2, &str, &len);
  469|      0|	  break;
  470|      0|#ifdef LLONG_MAX
  471|      0|	case fmtLongLongDecimal:
  ------------------
  |  Branch (471:2): [True: 0, False: 110k]
  ------------------
  472|      0|	  formatInt(arg.ll, buf, sizeof(buf), zeroFill, width, 10, &str, &len);
  473|      0|	  break;
  474|      0|	case fmtLongLongHex:
  ------------------
  |  Branch (474:2): [True: 0, False: 110k]
  ------------------
  475|      0|	  formatInt(arg.ll, buf, sizeof(buf), zeroFill, width, 16, &str, &len);
  476|      0|	  break;
  477|      0|	case fmtLongLongOctal:
  ------------------
  |  Branch (477:2): [True: 0, False: 110k]
  ------------------
  478|      0|	  formatInt(arg.ll, buf, sizeof(buf), zeroFill, width, 8, &str, &len);
  479|      0|	  break;
  480|      0|	case fmtLongLongBinary:
  ------------------
  |  Branch (480:2): [True: 0, False: 110k]
  ------------------
  481|      0|	  formatInt(arg.ll, buf, sizeof(buf), zeroFill, width, 2, &str, &len);
  482|      0|	  break;
  483|      0|#endif
  484|      0|#ifdef ULLONG_MAX
  485|      0|	case fmtULongLongDecimal:
  ------------------
  |  Branch (485:2): [True: 0, False: 110k]
  ------------------
  486|      0|	  formatUInt(arg.ull, buf, sizeof(buf), zeroFill, width, 10,
  487|      0|		     &str, &len);
  488|      0|	  break;
  489|      0|	case fmtULongLongHex:
  ------------------
  |  Branch (489:2): [True: 0, False: 110k]
  ------------------
  490|      0|	  formatUInt(arg.ull, buf, sizeof(buf), zeroFill, width, 16,
  491|      0|		     &str, &len);
  492|      0|	  break;
  493|      0|	case fmtULongLongOctal:
  ------------------
  |  Branch (493:2): [True: 0, False: 110k]
  ------------------
  494|      0|	  formatUInt(arg.ull, buf, sizeof(buf), zeroFill, width, 8,
  495|      0|		     &str, &len);
  496|      0|	  break;
  497|      0|	case fmtULongLongBinary:
  ------------------
  |  Branch (497:2): [True: 0, False: 110k]
  ------------------
  498|      0|	  formatUInt(arg.ull, buf, sizeof(buf), zeroFill, width, 2,
  499|      0|		     &str, &len);
  500|      0|	  break;
  501|      0|#endif
  502|      0|	case fmtDouble:
  ------------------
  |  Branch (502:2): [True: 0, False: 110k]
  ------------------
  503|      0|	  formatDouble(arg.f, buf, sizeof(buf), prec, gFalse, &str, &len);
  ------------------
  |  |   18|      0|#define gFalse 0
  ------------------
  504|      0|	  break;
  505|      0|	case fmtDoubleTrim:
  ------------------
  |  Branch (505:2): [True: 0, False: 110k]
  ------------------
  506|      0|	  formatDouble(arg.f, buf, sizeof(buf), prec, gTrue, &str, &len);
  ------------------
  |  |   17|      0|#define gTrue 1
  ------------------
  507|      0|	  break;
  508|      0|	case fmtChar:
  ------------------
  |  Branch (508:2): [True: 0, False: 110k]
  ------------------
  509|      0|	  buf[0] = arg.c;
  510|      0|	  str = buf;
  511|      0|	  len = 1;
  512|      0|	  reverseAlign = !reverseAlign;
  513|      0|	  break;
  514|      0|	case fmtString:
  ------------------
  |  Branch (514:2): [True: 0, False: 110k]
  ------------------
  515|      0|	  if (arg.s) {
  ------------------
  |  Branch (515:8): [True: 0, False: 0]
  ------------------
  516|      0|	    str = arg.s;
  517|      0|	    len = (int)strlen(str);
  518|      0|	  } else {
  519|      0|	    str = "(null)";
  520|      0|	    len = 6;
  521|      0|	  }
  522|      0|	  reverseAlign = !reverseAlign;
  523|      0|	  break;
  524|  70.8k|	case fmtGString:
  ------------------
  |  Branch (524:2): [True: 70.8k, False: 39.2k]
  ------------------
  525|  70.8k|	  if (arg.gs) {
  ------------------
  |  Branch (525:8): [True: 70.8k, False: 0]
  ------------------
  526|  70.8k|	    str = arg.gs->getCString();
  527|  70.8k|	    len = arg.gs->getLength();
  528|  70.8k|	  } else {
  529|      0|	    str = "(null)";
  530|      0|	    len = 6;
  531|      0|	  }
  532|  70.8k|	  reverseAlign = !reverseAlign;
  533|  70.8k|	  break;
  534|      0|	case fmtSpace:
  ------------------
  |  Branch (534:2): [True: 0, False: 110k]
  ------------------
  535|      0|	  str = buf;
  536|      0|	  len = 0;
  537|      0|	  width = arg.i;
  538|      0|	  break;
  539|   110k|	}
  540|       |
  541|       |	// append the formatted arg, handling width and alignment
  542|   110k|	if (!reverseAlign && len < width) {
  ------------------
  |  Branch (542:6): [True: 39.2k, False: 70.8k]
  |  Branch (542:23): [True: 0, False: 39.2k]
  ------------------
  543|      0|	  for (i = len; i < width; ++i) {
  ------------------
  |  Branch (543:18): [True: 0, False: 0]
  ------------------
  544|      0|	    append(' ');
  545|      0|	  }
  546|      0|	}
  547|   110k|	append(str, len);
  548|   110k|	if (reverseAlign && len < width) {
  ------------------
  |  Branch (548:6): [True: 70.8k, False: 39.2k]
  |  Branch (548:22): [True: 0, False: 70.8k]
  ------------------
  549|      0|	  for (i = len; i < width; ++i) {
  ------------------
  |  Branch (549:18): [True: 0, False: 0]
  ------------------
  550|      0|	    append(' ');
  551|      0|	  }
  552|      0|	}
  553|   110k|      }
  554|       |
  555|   113k|    } else if (*p0 == '}') {
  ------------------
  |  Branch (555:16): [True: 0, False: 113k]
  ------------------
  556|      0|      ++p0;
  557|      0|      if (*p0 == '}') {
  ------------------
  |  Branch (557:11): [True: 0, False: 0]
  ------------------
  558|      0|	++p0;
  559|      0|      }
  560|      0|      append('}');
  561|       |      
  562|   113k|    } else {
  563|   113k|      for (p1 = p0 + 1; *p1 && *p1 != '{' && *p1 != '}'; ++p1) ;
  ------------------
  |  Branch (563:25): [True: 74.6k, False: 39.2k]
  |  Branch (563:32): [True: 0, False: 74.6k]
  |  Branch (563:46): [True: 0, False: 0]
  ------------------
  564|   113k|      append(p0, (int)(p1 - p0));
  565|   113k|      p0 = p1;
  566|   113k|    }
  567|   224k|  }
  568|       |
  569|  74.6k|  gfree(args);
  570|  74.6k|  return this;
  571|  74.6k|}
_ZN7GString9formatIntExPciiiiPPKcPi:
  576|  39.2k|			const char **p, int *len) {
  577|       |#else
  578|       |void GString::formatInt(long x, char *buf, int bufSize,
  579|       |			GBool zeroFill, int width, int base,
  580|       |			const char **p, int *len) {
  581|       |#endif
  582|  39.2k|  static char vals[17] = "0123456789abcdef";
  583|  39.2k|  GBool neg;
  584|  39.2k|  int start, i, j;
  585|       |
  586|  39.2k|  i = bufSize;
  587|  39.2k|  if ((neg = x < 0)) {
  ------------------
  |  Branch (587:7): [True: 0, False: 39.2k]
  ------------------
  588|      0|    x = -x;
  589|      0|  }
  590|  39.2k|  start = neg ? 1 : 0;
  ------------------
  |  Branch (590:11): [True: 0, False: 39.2k]
  ------------------
  591|  39.2k|  if (x == 0) {
  ------------------
  |  Branch (591:7): [True: 28.2k, False: 11.0k]
  ------------------
  592|  28.2k|    buf[--i] = '0';
  593|  28.2k|  } else {
  594|  25.3k|    while (i > start && x) {
  ------------------
  |  Branch (594:12): [True: 25.3k, False: 0]
  |  Branch (594:25): [True: 14.2k, False: 11.0k]
  ------------------
  595|  14.2k|      buf[--i] = vals[x % base];
  596|  14.2k|      x /= base;
  597|  14.2k|    }
  598|  11.0k|  }
  599|  39.2k|  if (zeroFill) {
  ------------------
  |  Branch (599:7): [True: 0, False: 39.2k]
  ------------------
  600|      0|    for (j = bufSize - i; i > start && j < width - start; ++j) {
  ------------------
  |  Branch (600:27): [True: 0, False: 0]
  |  Branch (600:40): [True: 0, False: 0]
  ------------------
  601|      0|      buf[--i] = '0';
  602|      0|    }
  603|      0|  }
  604|  39.2k|  if (neg) {
  ------------------
  |  Branch (604:7): [True: 0, False: 39.2k]
  ------------------
  605|      0|    buf[--i] = '-';
  606|      0|  }
  607|  39.2k|  *p = buf + i;
  608|  39.2k|  *len = bufSize - i;
  609|  39.2k|}
_ZN7GString3delEii:
  738|    405|GString *GString::del(int i, int n) {
  739|    405|  int j;
  740|       |
  741|    405|  if (i >= 0 && n > 0 && i <= INT_MAX - n) {
  ------------------
  |  Branch (741:7): [True: 405, False: 0]
  |  Branch (741:17): [True: 405, False: 0]
  |  Branch (741:26): [True: 405, False: 0]
  ------------------
  742|    405|    if (i + n > length) {
  ------------------
  |  Branch (742:9): [True: 0, False: 405]
  ------------------
  743|      0|      n = length - i;
  744|      0|    }
  745|   627k|    for (j = i; j <= length - n; ++j) {
  ------------------
  |  Branch (745:17): [True: 627k, False: 405]
  ------------------
  746|   627k|      s[j] = s[j + n];
  747|   627k|    }
  748|    405|    resize(length -= n);
  749|    405|  }
  750|    405|  return this;
  751|    405|}
_ZN7GString3cmpEPS_:
  775|  36.3k|int GString::cmp(GString *str) {
  776|  36.3k|  int n1, n2, i, x;
  777|  36.3k|  char *p1, *p2;
  778|       |
  779|  36.3k|  n1 = length;
  780|  36.3k|  n2 = str->length;
  781|   801k|  for (i = 0, p1 = s, p2 = str->s; i < n1 && i < n2; ++i, ++p1, ++p2) {
  ------------------
  |  Branch (781:36): [True: 778k, False: 22.9k]
  |  Branch (781:46): [True: 778k, False: 342]
  ------------------
  782|   778k|    x = (*p1 & 0xff) - (*p2 & 0xff);
  783|   778k|    if (x != 0) {
  ------------------
  |  Branch (783:9): [True: 13.0k, False: 765k]
  ------------------
  784|  13.0k|      return x;
  785|  13.0k|    }
  786|   778k|  }
  787|  23.2k|  return n1 - n2;
  788|  36.3k|}
_ZN7GString3cmpEPKc:
  810|  1.48M|int GString::cmp(const char *sA) {
  811|  1.48M|  int n1, i, x;
  812|  1.48M|  const char *p1, *p2;
  813|       |
  814|  1.48M|  n1 = length;
  815|  1.86M|  for (i = 0, p1 = s, p2 = sA; i < n1 && *p2; ++i, ++p1, ++p2) {
  ------------------
  |  Branch (815:32): [True: 1.28M, False: 570k]
  |  Branch (815:42): [True: 1.28M, False: 697]
  ------------------
  816|  1.28M|    x = (*p1 & 0xff) - (*p2 & 0xff);
  817|  1.28M|    if (x != 0) {
  ------------------
  |  Branch (817:9): [True: 909k, False: 378k]
  ------------------
  818|   909k|      return x;
  819|   909k|    }
  820|  1.28M|  }
  821|   571k|  if (i < n1) {
  ------------------
  |  Branch (821:7): [True: 697, False: 570k]
  ------------------
  822|    697|    return 1;
  823|    697|  }
  824|   570k|  if (*p2) {
  ------------------
  |  Branch (824:7): [True: 500k, False: 70.0k]
  ------------------
  825|   500k|    return -1;
  826|   500k|  }
  827|  70.0k|  return 0;
  828|   570k|}
_ZN7GString4cmpNEPKci:
  830|     34|int GString::cmpN(const char *sA, int n) {
  831|     34|  int n1, i, x;
  832|     34|  const char *p1, *p2;
  833|       |
  834|     34|  n1 = length;
  835|     75|  for (i = 0, p1 = s, p2 = sA; i < n1 && *p2 && i < n; ++i, ++p1, ++p2) {
  ------------------
  |  Branch (835:32): [True: 62, False: 13]
  |  Branch (835:42): [True: 62, False: 0]
  |  Branch (835:49): [True: 62, False: 0]
  ------------------
  836|     62|    x = (*p1 & 0xff) - (*p2 & 0xff);
  837|     62|    if (x != 0) {
  ------------------
  |  Branch (837:9): [True: 21, False: 41]
  ------------------
  838|     21|      return x;
  839|     21|    }
  840|     62|  }
  841|     13|  if (i == n) {
  ------------------
  |  Branch (841:7): [True: 0, False: 13]
  ------------------
  842|      0|    return 0;
  843|      0|  }
  844|     13|  if (i < n1) {
  ------------------
  |  Branch (844:7): [True: 0, False: 13]
  ------------------
  845|      0|    return 1;
  846|      0|  }
  847|     13|  if (*p2) {
  ------------------
  |  Branch (847:7): [True: 13, False: 0]
  ------------------
  848|     13|    return -1;
  849|     13|  }
  850|      0|  return 0;
  851|     13|}
_ZN7GString6resizeEi:
  108|  17.0M|inline void GString::resize(int length1) {
  109|  17.0M|  char *s1;
  110|       |
  111|  17.0M|  if (length1 < 0) {
  ------------------
  |  Branch (111:7): [True: 0, False: 17.0M]
  ------------------
  112|      0|    gMemError("GString::resize() with negative length");
  113|      0|  }
  114|  17.0M|  if (!s) {
  ------------------
  |  Branch (114:7): [True: 5.80M, False: 11.2M]
  ------------------
  115|  5.80M|    s = new char[size(length1)];
  116|  11.2M|  } else if (size(length1) != size(length)) {
  ------------------
  |  Branch (116:14): [True: 1.16M, False: 10.0M]
  ------------------
  117|  1.16M|    s1 = new char[size(length1)];
  118|  1.16M|    if (length1 < length) {
  ------------------
  |  Branch (118:9): [True: 0, False: 1.16M]
  ------------------
  119|      0|      memcpy(s1, s, length1);
  120|      0|      s1[length1] = '\0';
  121|  1.16M|    } else {
  122|  1.16M|      memcpy(s1, s, length + 1);
  123|  1.16M|    }
  124|  1.16M|    delete[] s;
  125|  1.16M|    s = s1;
  126|  1.16M|  }
  127|  17.0M|}
GString.cc:_ZL4sizei:
   98|  29.4M|static inline int size(int len) {
   99|  29.4M|  int delta;
  100|   147M|  for (delta = 8; delta < len && delta < 0x100000; delta <<= 1) ;
  ------------------
  |  Branch (100:19): [True: 119M, False: 28.5M]
  |  Branch (100:34): [True: 118M, False: 879k]
  ------------------
  101|  29.4M|  if (len > INT_MAX - delta) {
  ------------------
  |  Branch (101:7): [True: 0, False: 29.4M]
  ------------------
  102|      0|    gMemError("Integer overflow in GString::size()");
  103|      0|  }
  104|       |  // this is ((len + 1) + (delta - 1)) & ~(delta - 1)
  105|  29.4M|  return (len + delta) & ~(delta - 1);
  106|  29.4M|}

_ZN7GString4copyEv:
   38|   635k|  GString *copy() { return new GString(this); }
_ZN7GString9getLengthEv:
   76|  41.5M|  int getLength() { return length; }
_ZN7GString10getCStringEv:
   79|  3.45M|  char *getCString() { return s; }
_ZN7GString7getCharEi:
   82|  62.9M|  char getChar(int i) { return s[i]; }

_Z10getHomeDirv:
   49|  18.8k|GString *getHomeDir() {
   50|       |#ifdef VMS
   51|       |  //---------- VMS ----------
   52|       |  return new GString("SYS$LOGIN:");
   53|       |
   54|       |#elif defined(_WIN32)
   55|       |  //---------- Win32 ----------
   56|       |  char *s;
   57|       |  GString *ret;
   58|       |
   59|       |  if ((s = getenv("USERPROFILE")))
   60|       |    ret = new GString(s);
   61|       |  else
   62|       |    ret = new GString(".");
   63|       |  return ret;
   64|       |
   65|       |#elif defined(__EMX__)
   66|       |  //---------- OS/2+EMX ----------
   67|       |  char *s;
   68|       |  GString *ret;
   69|       |
   70|       |  if ((s = getenv("HOME")))
   71|       |    ret = new GString(s);
   72|       |  else
   73|       |    ret = new GString(".");
   74|       |  return ret;
   75|       |
   76|       |#elif defined(ACORN)
   77|       |  //---------- RISCOS ----------
   78|       |  return new GString("@");
   79|       |
   80|       |#else
   81|       |  //---------- Unix ----------
   82|  18.8k|  char *s;
   83|  18.8k|  struct passwd *pw;
   84|  18.8k|  GString *ret;
   85|       |
   86|  18.8k|  if ((s = getenv("HOME"))) {
  ------------------
  |  Branch (86:7): [True: 18.8k, False: 0]
  ------------------
   87|  18.8k|    ret = new GString(s);
   88|  18.8k|  } else {
   89|      0|    if ((s = getenv("USER")))
  ------------------
  |  Branch (89:9): [True: 0, False: 0]
  ------------------
   90|      0|      pw = getpwnam(s);
   91|      0|    else
   92|      0|      pw = getpwuid(getuid());
   93|      0|    if (pw)
  ------------------
  |  Branch (93:9): [True: 0, False: 0]
  ------------------
   94|      0|      ret = new GString(pw->pw_dir);
   95|      0|    else
   96|      0|      ret = new GString(".");
   97|      0|  }
   98|  18.8k|  return ret;
   99|  18.8k|#endif
  100|  18.8k|}
_Z12appendToPathP7GStringPKc:
  118|   371k|GString *appendToPath(GString *path, const char *fileName) {
  119|       |#if defined(VMS)
  120|       |  //---------- VMS ----------
  121|       |  //~ this should handle everything necessary for file
  122|       |  //~ requesters, but it's certainly not complete
  123|       |  char *p0, *p1, *p2;
  124|       |  char *q1;
  125|       |
  126|       |  p0 = path->getCString();
  127|       |  p1 = p0 + path->getLength() - 1;
  128|       |  if (!strcmp(fileName, "-")) {
  129|       |    if (*p1 == ']') {
  130|       |      for (p2 = p1; p2 > p0 && *p2 != '.' && *p2 != '['; --p2) ;
  131|       |      if (*p2 == '[')
  132|       |	++p2;
  133|       |      path->del(p2 - p0, p1 - p2);
  134|       |    } else if (*p1 == ':') {
  135|       |      path->append("[-]");
  136|       |    } else {
  137|       |      path->clear();
  138|       |      path->append("[-]");
  139|       |    }
  140|       |  } else if ((q1 = strrchr(fileName, '.')) && !strncmp(q1, ".DIR;", 5)) {
  141|       |    if (*p1 == ']') {
  142|       |      path->insert(p1 - p0, '.');
  143|       |      path->insert(p1 - p0 + 1, fileName, q1 - fileName);
  144|       |    } else if (*p1 == ':') {
  145|       |      path->append('[');
  146|       |      path->append(']');
  147|       |      path->append(fileName, q1 - fileName);
  148|       |    } else {
  149|       |      path->clear();
  150|       |      path->append(fileName, q1 - fileName);
  151|       |    }
  152|       |  } else {
  153|       |    if (*p1 != ']' && *p1 != ':')
  154|       |      path->clear();
  155|       |    path->append(fileName);
  156|       |  }
  157|       |  return path;
  158|       |
  159|       |#elif defined(_WIN32)
  160|       |  //---------- Win32 ----------
  161|       |  GString *tmp;
  162|       |  char buf[256];
  163|       |  char *fp;
  164|       |
  165|       |  tmp = new GString(path);
  166|       |  tmp->append('/');
  167|       |  tmp->append(fileName);
  168|       |  GetFullPathNameA(tmp->getCString(), sizeof(buf), buf, &fp);
  169|       |  delete tmp;
  170|       |  path->clear();
  171|       |  path->append(buf);
  172|       |  return path;
  173|       |
  174|       |#elif defined(ACORN)
  175|       |  //---------- RISCOS ----------
  176|       |  char *p;
  177|       |  int i;
  178|       |
  179|       |  path->append(".");
  180|       |  i = path->getLength();
  181|       |  path->append(fileName);
  182|       |  for (p = path->getCString() + i; *p; ++p) {
  183|       |    if (*p == '/') {
  184|       |      *p = '.';
  185|       |    } else if (*p == '.') {
  186|       |      *p = '/';
  187|       |    }
  188|       |  }
  189|       |  return path;
  190|       |
  191|       |#elif defined(__EMX__)
  192|       |  //---------- OS/2+EMX ----------
  193|       |  int i;
  194|       |
  195|       |  // appending "." does nothing
  196|       |  if (!strcmp(fileName, "."))
  197|       |    return path;
  198|       |
  199|       |  // appending ".." goes up one directory
  200|       |  if (!strcmp(fileName, "..")) {
  201|       |    for (i = path->getLength() - 2; i >= 0; --i) {
  202|       |      if (path->getChar(i) == '/' || path->getChar(i) == '\\' ||
  203|       |	  path->getChar(i) == ':')
  204|       |	break;
  205|       |    }
  206|       |    if (i <= 0) {
  207|       |      if (path->getChar(0) == '/' || path->getChar(0) == '\\') {
  208|       |	path->del(1, path->getLength() - 1);
  209|       |      } else if (path->getLength() >= 2 && path->getChar(1) == ':') {
  210|       |	path->del(2, path->getLength() - 2);
  211|       |      } else {
  212|       |	path->clear();
  213|       |	path->append("..");
  214|       |      }
  215|       |    } else {
  216|       |      if (path->getChar(i-1) == ':')
  217|       |	++i;
  218|       |      path->del(i, path->getLength() - i);
  219|       |    }
  220|       |    return path;
  221|       |  }
  222|       |
  223|       |  // otherwise, append "/" and new path component
  224|       |  if (path->getLength() > 0 &&
  225|       |      path->getChar(path->getLength() - 1) != '/' &&
  226|       |      path->getChar(path->getLength() - 1) != '\\')
  227|       |    path->append('/');
  228|       |  path->append(fileName);
  229|       |  return path;
  230|       |
  231|       |#else
  232|       |  //---------- Unix ----------
  233|   371k|  int i;
  234|       |
  235|       |  // appending "." does nothing
  236|   371k|  if (!strcmp(fileName, "."))
  ------------------
  |  Branch (236:7): [True: 0, False: 371k]
  ------------------
  237|      0|    return path;
  238|       |
  239|       |  // appending ".." goes up one directory
  240|   371k|  if (!strcmp(fileName, "..")) {
  ------------------
  |  Branch (240:7): [True: 0, False: 371k]
  ------------------
  241|      0|    for (i = path->getLength() - 2; i >= 0; --i) {
  ------------------
  |  Branch (241:37): [True: 0, False: 0]
  ------------------
  242|      0|      if (path->getChar(i) == '/')
  ------------------
  |  Branch (242:11): [True: 0, False: 0]
  ------------------
  243|      0|	break;
  244|      0|    }
  245|      0|    if (i <= 0) {
  ------------------
  |  Branch (245:9): [True: 0, False: 0]
  ------------------
  246|      0|      if (path->getChar(0) == '/') {
  ------------------
  |  Branch (246:11): [True: 0, False: 0]
  ------------------
  247|      0|	path->del(1, path->getLength() - 1);
  248|      0|      } else {
  249|      0|	path->clear();
  250|      0|	path->append("..");
  251|      0|      }
  252|      0|    } else {
  253|      0|      path->del(i, path->getLength() - i);
  254|      0|    }
  255|      0|    return path;
  256|      0|  }
  257|       |
  258|       |  // otherwise, append "/" and new path component
  259|   371k|  if (path->getLength() > 0 &&
  ------------------
  |  Branch (259:7): [True: 371k, False: 0]
  ------------------
  260|   371k|      path->getChar(path->getLength() - 1) != '/')
  ------------------
  |  Branch (260:7): [True: 371k, False: 0]
  ------------------
  261|   371k|    path->append('/');
  262|   371k|  path->append(fileName);
  263|   371k|  return path;
  264|   371k|#endif
  265|   371k|}
_Z9createDirPci:
  559|  9.40k|GBool createDir(char *path, int mode) {
  560|       |#ifdef _WIN32
  561|       |  return !_mkdir(path);
  562|       |#else
  563|  9.40k|  return !mkdir(path, mode);
  564|  9.40k|#endif
  565|  9.40k|}

_Z7gmalloci:
  139|   108M|void *gmalloc(int size) GMEM_EXCEP {
  140|   108M|  void *p;
  141|       |
  142|   108M|  if (size < 0) {
  ------------------
  |  Branch (142:7): [True: 8, False: 108M]
  ------------------
  143|      8|    gMemError("Invalid memory allocation size");
  144|      8|  }
  145|   108M|  if (size == 0) {
  ------------------
  |  Branch (145:7): [True: 0, False: 108M]
  ------------------
  146|      0|    return NULL;
  147|      0|  }
  148|   108M|  if (!(p = malloc(size))) {
  ------------------
  |  Branch (148:7): [True: 0, False: 108M]
  ------------------
  149|      0|    gMemError("Out of memory");
  150|      0|  }
  151|   108M|  return p;
  152|   108M|}
_Z8greallocPvi:
  155|  7.28M|void *grealloc(void *p, int size) GMEM_EXCEP {
  156|       |#ifdef DEBUG_MEM
  157|       |  GMemHdr *hdr;
  158|       |  void *q;
  159|       |  int oldSize;
  160|       |
  161|       |  if (size < 0) {
  162|       |    gMemError("Invalid memory allocation size");
  163|       |  }
  164|       |  if (size == 0) {
  165|       |    if (p) {
  166|       |      gfree(p);
  167|       |    }
  168|       |    return NULL;
  169|       |  }
  170|       |  if (p) {
  171|       |    hdr = (GMemHdr *)((char *)p - gMemHdrSize);
  172|       |    oldSize = (int)hdr->size;
  173|       |    q = gmalloc(size);
  174|       |    memcpy(q, p, size < oldSize ? size : oldSize);
  175|       |    gfree(p);
  176|       |  } else {
  177|       |    q = gmalloc(size);
  178|       |  }
  179|       |  return q;
  180|       |#else
  181|  7.28M|  void *q;
  182|       |
  183|  7.28M|  if (size < 0) {
  ------------------
  |  Branch (183:7): [True: 0, False: 7.28M]
  ------------------
  184|      0|    gMemError("Invalid memory allocation size");
  185|      0|  }
  186|  7.28M|  if (size == 0) {
  ------------------
  |  Branch (186:7): [True: 0, False: 7.28M]
  ------------------
  187|      0|    if (p) {
  ------------------
  |  Branch (187:9): [True: 0, False: 0]
  ------------------
  188|      0|      free(p);
  189|      0|    }
  190|      0|    return NULL;
  191|      0|  }
  192|  7.28M|  if (p) {
  ------------------
  |  Branch (192:7): [True: 3.57M, False: 3.71M]
  ------------------
  193|  3.57M|    q = realloc(p, size);
  194|  3.71M|  } else {
  195|  3.71M|    q = malloc(size);
  196|  3.71M|  }
  197|  7.28M|  if (!q) {
  ------------------
  |  Branch (197:7): [True: 0, False: 7.28M]
  ------------------
  198|      0|    gMemError("Out of memory");
  199|      0|  }
  200|  7.28M|  return q;
  201|  7.28M|#endif
  202|  7.28M|}
_Z8gmallocnii:
  204|  17.7M|void *gmallocn(int nObjs, int objSize) GMEM_EXCEP {
  205|  17.7M|  int n;
  206|       |
  207|  17.7M|  if (nObjs == 0) {
  ------------------
  |  Branch (207:7): [True: 1.15M, False: 16.6M]
  ------------------
  208|  1.15M|    return NULL;
  209|  1.15M|  }
  210|  16.6M|  if (objSize <= 0 || nObjs < 0 || nObjs >= INT_MAX / objSize) {
  ------------------
  |  Branch (210:7): [True: 0, False: 16.6M]
  |  Branch (210:23): [True: 0, False: 16.6M]
  |  Branch (210:36): [True: 18, False: 16.6M]
  ------------------
  211|     18|    gMemError("Bogus memory allocation size");
  212|     18|  }
  213|  16.6M|  n = nObjs * objSize;
  214|  16.6M|  return gmalloc(n);
  215|  17.7M|}
_Z9greallocnPvii:
  291|  7.28M|void *greallocn(void *p, int nObjs, int objSize) GMEM_EXCEP {
  292|  7.28M|  int n;
  293|       |
  294|  7.28M|  if (nObjs == 0) {
  ------------------
  |  Branch (294:7): [True: 14, False: 7.28M]
  ------------------
  295|     14|    if (p) {
  ------------------
  |  Branch (295:9): [True: 0, False: 14]
  ------------------
  296|      0|      gfree(p);
  297|      0|    }
  298|     14|    return NULL;
  299|     14|  }
  300|  7.28M|  if (objSize <= 0 || nObjs < 0 || nObjs >= INT_MAX / objSize) {
  ------------------
  |  Branch (300:7): [True: 0, False: 7.28M]
  |  Branch (300:23): [True: 0, False: 7.28M]
  |  Branch (300:36): [True: 0, False: 7.28M]
  ------------------
  301|      0|    gMemError("Bogus memory allocation size");
  302|      0|  }
  303|  7.28M|  n = nObjs * objSize;
  304|  7.28M|  return grealloc(p, n);
  305|  7.28M|}
_Z5gfreePv:
  307|   116M|void gfree(void *p) {
  308|       |#ifdef DEBUG_MEM
  309|       |  size_t size;
  310|       |  GMemHdr *hdr;
  311|       |  unsigned long *trl, *clr;
  312|       |
  313|       |  if (p) {
  314|       |    hdr = (GMemHdr *)((char *)p - gMemHdrSize);
  315|       |    gMemLock;
  316|       |    if (hdr->magic == gMemMagic &&
  317|       |	((hdr->prev == NULL) == (hdr == gMemHead)) &&
  318|       |	((hdr->next == NULL) == (hdr == gMemTail))) {
  319|       |      if (hdr->prev) {
  320|       |	hdr->prev->next = hdr->next;
  321|       |      } else {
  322|       |	gMemHead = hdr->next;
  323|       |      }
  324|       |      if (hdr->next) {
  325|       |	hdr->next->prev = hdr->prev;
  326|       |      } else {
  327|       |	gMemTail = hdr->prev;
  328|       |      }
  329|       |      --gMemAlloc;
  330|       |      gMemInUse -= hdr->size;
  331|       |      gMemUnlock;
  332|       |      size = gMemDataSize64(hdr->size);
  333|       |      trl = (unsigned long *)((char *)hdr + gMemHdrSize + size);
  334|       |      if (*trl != gMemDeadVal) {
  335|       |	fprintf(stderr, "Overwrite past end of block %d at address %p\n",
  336|       |		hdr->index, p);
  337|       |      }
  338|       |      for (clr = (unsigned long *)hdr; clr <= trl; ++clr) {
  339|       |	*clr = gMemDeadVal;
  340|       |      }
  341|       |      free(hdr);
  342|       |    } else {
  343|       |      gMemUnlock;
  344|       |      fprintf(stderr, "Attempted to free bad address %p\n", p);
  345|       |    }
  346|       |  }
  347|       |#else
  348|   116M|  if (p) {
  ------------------
  |  Branch (348:7): [True: 109M, False: 7.58M]
  ------------------
  349|   109M|    free(p);
  350|   109M|  }
  351|   116M|#endif
  352|   116M|}
_Z9gMemErrorPKc:
  354|     26|void gMemError(const char *msg) GMEM_EXCEP {
  355|     26|#if USE_EXCEPTIONS
  356|     26|  throw GMemException();
  357|       |#else
  358|       |  fprintf(stderr, "%s\n", msg);
  359|       |  exit(1);
  360|       |#endif
  361|     26|}
_Z10copyStringPKc:
  390|  80.8M|char *copyString(const char *s) {
  391|  80.8M|  char *s1;
  392|       |
  393|  80.8M|  s1 = (char *)gmalloc((int)strlen(s) + 1);
  394|  80.8M|  strcpy(s1, s);
  395|  80.8M|  return s1;
  396|  80.8M|}

_ZN13GMemExceptionC2Ev:
   19|     26|  GMemException() {}
_ZN13GMemExceptionD2Ev:
   20|     26|  ~GMemException() {}

_ZN8AcroForm4loadEP6PDFDocP7CatalogP6Object:
  337|  2.34k|AcroForm *AcroForm::load(PDFDoc *docA, Catalog *catalog, Object *acroFormObjA) {
  338|  2.34k|  Object acroFormObj2;
  339|  2.34k|  AcroForm *acroForm;
  340|  2.34k|  AcroFormField *field;
  341|  2.34k|  Object xfaObj, fieldsObj, annotsObj, annotRef, annotObj, obj1, obj2;
  342|  2.34k|  char *touchedObjs;
  343|  2.34k|  int pageNum, i, j;
  344|       |
  345|  2.34k|  touchedObjs = (char *)gmalloc(docA->getXRef()->getNumObjects());
  346|  2.34k|  memset(touchedObjs, 0, docA->getXRef()->getNumObjects());
  347|       |
  348|       |  // this is the normal case: acroFormObj is a dictionary, as expected
  349|  2.34k|  if (acroFormObjA->isDict()) {
  ------------------
  |  Branch (349:7): [True: 1.47k, False: 861]
  ------------------
  350|  1.47k|    acroForm = new AcroForm(docA, acroFormObjA);
  351|       |
  352|  1.47k|    if (globalParams->getEnableXFA()) {
  ------------------
  |  Branch (352:9): [True: 1.47k, False: 0]
  ------------------
  353|  1.47k|      if (!acroFormObjA->dictLookup("XFA", &xfaObj)->isNull()) {
  ------------------
  |  Branch (353:11): [True: 1.22k, False: 259]
  ------------------
  354|  1.22k|	acroForm->xfaScanner = XFAScanner::load(&xfaObj);
  355|  1.22k|	if (!catalog->getNeedsRendering()) {
  ------------------
  |  Branch (355:6): [True: 1.20k, False: 11]
  ------------------
  356|  1.20k|	  acroForm->isStaticXFA = gTrue;
  ------------------
  |  |   17|  1.20k|#define gTrue 1
  ------------------
  357|  1.20k|	}
  358|  1.22k|      }
  359|  1.47k|      xfaObj.free();
  360|  1.47k|    }
  361|       |
  362|  1.47k|    if (acroFormObjA->dictLookup("NeedAppearances", &obj1)->isBool()) {
  ------------------
  |  Branch (362:9): [True: 36, False: 1.44k]
  ------------------
  363|     36|      acroForm->needAppearances = obj1.getBool();
  364|     36|    }
  365|  1.47k|    obj1.free();
  366|       |
  367|  1.47k|    acroForm->buildAnnotPageList(catalog);
  368|       |
  369|  1.47k|    if (!acroFormObjA->dictLookup("Fields", &obj1)->isArray()) {
  ------------------
  |  Branch (369:9): [True: 4, False: 1.47k]
  ------------------
  370|      4|      if (!obj1.isNull()) {
  ------------------
  |  Branch (370:11): [True: 0, False: 4]
  ------------------
  371|      0|	error(errSyntaxError, -1, "AcroForm Fields entry is wrong type");
  372|      0|      }
  373|      4|      obj1.free();
  374|      4|      delete acroForm;
  375|      4|      gfree(touchedObjs);
  376|      4|      return NULL;
  377|      4|    }
  378|  39.8k|    for (i = 0; i < obj1.arrayGetLength(); ++i) {
  ------------------
  |  Branch (378:17): [True: 38.3k, False: 1.47k]
  ------------------
  379|  38.3k|      obj1.arrayGetNF(i, &obj2);
  380|  38.3k|      acroForm->scanField(&obj2, touchedObjs);
  381|  38.3k|      obj2.free();
  382|  38.3k|    }
  383|  1.47k|    obj1.free();
  384|       |
  385|       |    // scan the annotations, looking for Widget-type annots that are
  386|       |    // not attached to the AcroForm object
  387|   128k|    for (pageNum = 1; pageNum <= catalog->getNumPages(); ++pageNum) {
  ------------------
  |  Branch (387:23): [True: 127k, False: 1.47k]
  ------------------
  388|   127k|      if (catalog->getPage(pageNum)->getAnnots(&annotsObj)->isArray()) {
  ------------------
  |  Branch (388:11): [True: 112k, False: 15.0k]
  ------------------
  389|  4.41M|	for (i = 0; i < annotsObj.arrayGetLength(); ++i) {
  ------------------
  |  Branch (389:14): [True: 4.29M, False: 112k]
  ------------------
  390|  4.29M|	  if (annotsObj.arrayGetNF(i, &annotRef)->isRef()) {
  ------------------
  |  Branch (390:8): [True: 1.02M, False: 3.27M]
  ------------------
  391|  1.41M|	    for (j = 0; j < acroForm->fields->getLength(); ++j) {
  ------------------
  |  Branch (391:18): [True: 489k, False: 920k]
  ------------------
  392|   489k|	      field = (AcroFormField *)acroForm->fields->get(j);
  393|   489k|	      if (field->fieldRef.isRef()) {
  ------------------
  |  Branch (393:12): [True: 423k, False: 66.3k]
  ------------------
  394|   423k|		if (field->fieldRef.getRefNum() == annotRef.getRefNum() &&
  ------------------
  |  Branch (394:7): [True: 144k, False: 278k]
  ------------------
  395|   144k|		    field->fieldRef.getRefGen() == annotRef.getRefGen()) {
  ------------------
  |  Branch (395:7): [True: 100k, False: 44.4k]
  ------------------
  396|   100k|		  break;
  397|   100k|		}
  398|   423k|	      }
  399|   489k|	    }
  400|  1.02M|	    if (j == acroForm->fields->getLength()) {
  ------------------
  |  Branch (400:10): [True: 920k, False: 100k]
  ------------------
  401|   920k|	      annotRef.fetch(acroForm->doc->getXRef(), &annotObj);
  402|   920k|	      if (annotObj.isDict()) {
  ------------------
  |  Branch (402:12): [True: 168k, False: 752k]
  ------------------
  403|   168k|		if (annotObj.dictLookup("Subtype", &obj1)->isName("Widget")) {
  ------------------
  |  Branch (403:7): [True: 12.2k, False: 156k]
  ------------------
  404|  12.2k|		  acroForm->scanField(&annotRef, touchedObjs);
  405|  12.2k|		}
  406|   168k|		obj1.free();
  407|   168k|	      }
  408|   920k|	      annotObj.free();
  409|   920k|	    }
  410|  1.02M|	  }
  411|  4.29M|	  annotRef.free();
  412|  4.29M|	}
  413|   112k|      }
  414|   127k|      annotsObj.free();
  415|   127k|    }
  416|       |
  417|       |  // if acroFormObjA is a null object, but there are Widget-type
  418|       |  // annots, we still create an AcroForm
  419|  1.47k|  } else {
  420|       |    // create an empty dict for acroFormObj
  421|    861|    acroFormObj2.initDict(docA->getXRef());
  422|    861|    acroForm = new AcroForm(docA, &acroFormObj2);
  423|    861|    acroFormObj2.free();
  424|       |
  425|    861|    acroForm->buildAnnotPageList(catalog);
  426|       |
  427|       |    // scan the annotations, looking for any Widget-type annots
  428|  32.9k|    for (pageNum = 1; pageNum <= catalog->getNumPages(); ++pageNum) {
  ------------------
  |  Branch (428:23): [True: 32.0k, False: 861]
  ------------------
  429|  32.0k|      if (catalog->getPage(pageNum)->getAnnots(&annotsObj)->isArray()) {
  ------------------
  |  Branch (429:11): [True: 23.4k, False: 8.64k]
  ------------------
  430|   634k|	for (i = 0; i < annotsObj.arrayGetLength(); ++i) {
  ------------------
  |  Branch (430:14): [True: 610k, False: 23.4k]
  ------------------
  431|   610k|	  if (annotsObj.arrayGetNF(i, &annotRef)->isRef()) {
  ------------------
  |  Branch (431:8): [True: 125k, False: 485k]
  ------------------
  432|   125k|	    annotRef.fetch(acroForm->doc->getXRef(), &annotObj);
  433|   125k|	    if (annotObj.isDict()) {
  ------------------
  |  Branch (433:10): [True: 67.6k, False: 57.6k]
  ------------------
  434|  67.6k|	      if (annotObj.dictLookup("Subtype", &obj1)->isName("Widget")) {
  ------------------
  |  Branch (434:12): [True: 44.4k, False: 23.1k]
  ------------------
  435|  44.4k|		acroForm->scanField(&annotRef, touchedObjs);
  436|  44.4k|	      }
  437|  67.6k|	      obj1.free();
  438|  67.6k|	    }
  439|   125k|	    annotObj.free();
  440|   125k|	  }
  441|   610k|	  annotRef.free();
  442|   610k|	}
  443|  23.4k|      }
  444|  32.0k|      annotsObj.free();
  445|  32.0k|    }
  446|       |
  447|    861|    if (acroForm->fields->getLength() == 0) {
  ------------------
  |  Branch (447:9): [True: 840, False: 21]
  ------------------
  448|    840|      delete acroForm;
  449|    840|      acroForm = NULL;
  450|    840|    }
  451|    861|  }
  452|       |
  453|  2.33k|  gfree(touchedObjs);
  454|       |
  455|  2.33k|  return acroForm;
  456|  2.34k|}
_ZN8AcroFormC2EP6PDFDocP6Object:
  458|  2.34k|AcroForm::AcroForm(PDFDoc *docA, Object *acroFormObjA) {
  459|  2.34k|  doc = docA;
  460|  2.34k|  acroFormObjA->copy(&acroFormObj);
  461|  2.34k|  needAppearances = gFalse;
  ------------------
  |  |   18|  2.34k|#define gFalse 0
  ------------------
  462|  2.34k|  annotPages = new GList();
  463|  2.34k|  fields = new GList();
  464|  2.34k|  xfaScanner = NULL;
  465|  2.34k|  isStaticXFA = gFalse;
  ------------------
  |  |   18|  2.34k|#define gFalse 0
  ------------------
  466|  2.34k|}
_ZN8AcroFormD2Ev:
  468|  2.33k|AcroForm::~AcroForm() {
  469|  2.33k|  acroFormObj.free();
  470|  2.33k|  deleteGList(annotPages, AcroFormAnnotPage);
  ------------------
  |  |   94|  2.33k|  do {                                              \
  |  |   95|  2.33k|    GList *_list = (list);                          \
  |  |   96|  2.33k|    {                                               \
  |  |   97|  2.33k|      int _i;                                       \
  |  |   98|  1.14M|      for (_i = 0; _i < _list->getLength(); ++_i) { \
  |  |  ------------------
  |  |  |  Branch (98:20): [True: 1.14M, False: 2.33k]
  |  |  ------------------
  |  |   99|  1.14M|        delete (T*)_list->get(_i);                  \
  |  |  100|  1.14M|      }                                             \
  |  |  101|  2.33k|      delete _list;                                 \
  |  |  102|  2.33k|    }                                               \
  |  |  103|  2.33k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (103:12): [Folded, False: 2.33k]
  |  |  ------------------
  ------------------
  471|  2.33k|  deleteGList(fields, AcroFormField);
  ------------------
  |  |   94|  2.33k|  do {                                              \
  |  |   95|  2.33k|    GList *_list = (list);                          \
  |  |   96|  2.33k|    {                                               \
  |  |   97|  2.33k|      int _i;                                       \
  |  |   98|  6.10k|      for (_i = 0; _i < _list->getLength(); ++_i) { \
  |  |  ------------------
  |  |  |  Branch (98:20): [True: 3.76k, False: 2.33k]
  |  |  ------------------
  |  |   99|  3.76k|        delete (T*)_list->get(_i);                  \
  |  |  100|  3.76k|      }                                             \
  |  |  101|  2.33k|      delete _list;                                 \
  |  |  102|  2.33k|    }                                               \
  |  |  103|  2.33k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (103:12): [Folded, False: 2.33k]
  |  |  ------------------
  ------------------
  472|  2.33k|  delete xfaScanner;
  473|  2.33k|}
_ZN8AcroForm18buildAnnotPageListEP7Catalog:
  479|  2.33k|void AcroForm::buildAnnotPageList(Catalog *catalog) {
  480|  2.33k|  Object annotsObj, annotObj;
  481|  2.33k|  int pageNum, i;
  482|       |
  483|   161k|  for (pageNum = 1; pageNum <= catalog->getNumPages(); ++pageNum) {
  ------------------
  |  Branch (483:21): [True: 159k, False: 2.33k]
  ------------------
  484|   159k|    if (catalog->getPage(pageNum)->getAnnots(&annotsObj)->isArray()) {
  ------------------
  |  Branch (484:9): [True: 135k, False: 23.7k]
  ------------------
  485|  5.04M|      for (i = 0; i < annotsObj.arrayGetLength(); ++i) {
  ------------------
  |  Branch (485:19): [True: 4.90M, False: 135k]
  ------------------
  486|  4.90M|	if (annotsObj.arrayGetNF(i, &annotObj)->isRef()) {
  ------------------
  |  Branch (486:6): [True: 1.14M, False: 3.76M]
  ------------------
  487|  1.14M|	  annotPages->append(new AcroFormAnnotPage(annotObj.getRefNum(),
  488|  1.14M|						   annotObj.getRefGen(),
  489|  1.14M|						   pageNum));
  490|  1.14M|	}
  491|  4.90M|	annotObj.free();
  492|  4.90M|      }
  493|   135k|    }
  494|   159k|    annotsObj.free();
  495|   159k|  }
  496|       |  //~ sort the list
  497|  2.33k|}
_ZN8AcroForm9scanFieldEP6ObjectPc:
  518|  98.7k|void AcroForm::scanField(Object *fieldRef, char *touchedObjs) {
  519|  98.7k|  AcroFormField *field;
  520|  98.7k|  Object fieldObj, kidsRef, kidsObj, kidRef, kidObj, subtypeObj;
  521|  98.7k|  GBool isTerminal;
  522|  98.7k|  int i;
  523|       |
  524|       |  // check for an object loop
  525|  98.7k|  if (fieldRef->isRef()) {
  ------------------
  |  Branch (525:7): [True: 62.7k, False: 36.0k]
  ------------------
  526|  62.7k|    if (fieldRef->getRefNum() < 0 ||
  ------------------
  |  Branch (526:9): [True: 0, False: 62.7k]
  ------------------
  527|  62.7k|	fieldRef->getRefNum() >= doc->getXRef()->getNumObjects() ||
  ------------------
  |  Branch (527:2): [True: 462, False: 62.3k]
  ------------------
  528|  62.3k|	touchedObjs[fieldRef->getRefNum()]) {
  ------------------
  |  Branch (528:2): [True: 56.1k, False: 6.19k]
  ------------------
  529|  56.5k|      return;
  530|  56.5k|    }
  531|  6.19k|    touchedObjs[fieldRef->getRefNum()] = 1;
  532|  6.19k|  }
  533|       |
  534|  42.2k|  fieldRef->fetch(doc->getXRef(), &fieldObj);
  535|  42.2k|  if (!fieldObj.isDict()) {
  ------------------
  |  Branch (535:7): [True: 36.4k, False: 5.73k]
  ------------------
  536|  36.4k|    error(errSyntaxError, -1, "AcroForm field object is wrong type");
  537|  36.4k|    fieldObj.free();
  538|  36.4k|    return;
  539|  36.4k|  }
  540|       |
  541|       |  // look for a Kids entry, and check for an object loop there
  542|  5.73k|  if (fieldObj.dictLookupNF("Kids", &kidsRef)->isRef()) {
  ------------------
  |  Branch (542:7): [True: 86, False: 5.64k]
  ------------------
  543|     86|    if (kidsRef.getRefNum() < 0 ||
  ------------------
  |  Branch (543:9): [True: 0, False: 86]
  ------------------
  544|     86|	kidsRef.getRefNum() >= doc->getXRef()->getNumObjects() ||
  ------------------
  |  Branch (544:2): [True: 40, False: 46]
  ------------------
  545|     74|	touchedObjs[kidsRef.getRefNum()]) {
  ------------------
  |  Branch (545:2): [True: 34, False: 12]
  ------------------
  546|     74|      kidsRef.free();
  547|     74|      fieldObj.free();
  548|     74|      return;
  549|     74|    }
  550|     12|    touchedObjs[kidsRef.getRefNum()] = 1;
  551|     12|    kidsRef.fetch(doc->getXRef(), &kidsObj);
  552|  5.64k|  } else {
  553|  5.64k|    kidsRef.copy(&kidsObj);
  554|  5.64k|  }
  555|  5.65k|  kidsRef.free();
  556|       |
  557|       |  // if this field has a Kids array, and all of the kids have a Parent
  558|       |  // reference (i.e., they're all form fields, not widget
  559|       |  // annotations), then this is a non-terminal field, and we need to
  560|       |  // scan the kids
  561|  5.65k|  isTerminal = gTrue;
  ------------------
  |  |   17|  5.65k|#define gTrue 1
  ------------------
  562|  5.65k|  if (kidsObj.isArray()) {
  ------------------
  |  Branch (562:7): [True: 346, False: 5.31k]
  ------------------
  563|    346|    isTerminal = gFalse;
  ------------------
  |  |   18|    346|#define gFalse 0
  ------------------
  564|  7.31k|    for (i = 0; !isTerminal && i < kidsObj.arrayGetLength(); ++i) {
  ------------------
  |  Branch (564:17): [True: 7.19k, False: 112]
  |  Branch (564:32): [True: 6.96k, False: 234]
  ------------------
  565|  6.96k|      kidsObj.arrayGet(i, &kidObj);
  566|  6.96k|      if (kidObj.isDict()) {
  ------------------
  |  Branch (566:11): [True: 760, False: 6.20k]
  ------------------
  567|    760|	if (kidObj.dictLookup("Parent", &subtypeObj)->isNull()) {
  ------------------
  |  Branch (567:6): [True: 112, False: 648]
  ------------------
  568|    112|	  isTerminal = gTrue;
  ------------------
  |  |   17|    112|#define gTrue 1
  ------------------
  569|    112|	}
  570|    760|	subtypeObj.free();
  571|    760|      }
  572|  6.96k|      kidObj.free();
  573|  6.96k|    }
  574|    346|    if (!isTerminal) {
  ------------------
  |  Branch (574:9): [True: 234, False: 112]
  ------------------
  575|  4.00k|      for (i = 0; !isTerminal && i < kidsObj.arrayGetLength(); ++i) {
  ------------------
  |  Branch (575:19): [True: 4.00k, False: 0]
  |  Branch (575:34): [True: 3.76k, False: 234]
  ------------------
  576|  3.76k|	kidsObj.arrayGetNF(i, &kidRef);
  577|  3.76k|	scanField(&kidRef, touchedObjs);
  578|  3.76k|	kidRef.free();
  579|  3.76k|      }
  580|    234|    }
  581|    346|  }
  582|  5.65k|  kidsObj.free();
  583|       |
  584|  5.65k|  if (isTerminal) {
  ------------------
  |  Branch (584:7): [True: 5.42k, False: 234]
  ------------------
  585|  5.42k|    if ((field = AcroFormField::load(this, fieldRef))) {
  ------------------
  |  Branch (585:9): [True: 3.76k, False: 1.66k]
  ------------------
  586|  3.76k|      fields->append(field);
  587|  3.76k|    }
  588|  5.42k|  }
  589|       |
  590|  5.65k|  fieldObj.free();
  591|  5.65k|}
_ZN13AcroFormField4loadEP8AcroFormP6Object:
  647|  5.42k|AcroFormField *AcroFormField::load(AcroForm *acroFormA, Object *fieldRefA) {
  648|  5.42k|  GString *typeStr;
  649|  5.42k|  TextString *nameA;
  650|  5.42k|  GString *xfaName;
  651|  5.42k|  Guint flagsA;
  652|  5.42k|  GBool haveFlags, typeFromParentA;
  653|  5.42k|  Object fieldObjA, parentObj, parentObj2, obj1, obj2;
  654|  5.42k|  AcroFormFieldType typeA;
  655|  5.42k|  XFAField *xfaFieldA;
  656|  5.42k|  AcroFormField *field;
  657|  5.42k|  int depth, i0, i1;
  658|       |
  659|  5.42k|  fieldRefA->fetch(acroFormA->doc->getXRef(), &fieldObjA);
  660|       |
  661|       |  //----- get field info
  662|       |
  663|  5.42k|  if (fieldObjA.dictLookup("T", &obj1)->isString()) {
  ------------------
  |  Branch (663:7): [True: 3.69k, False: 1.72k]
  ------------------
  664|  3.69k|    nameA = new TextString(obj1.getString());
  665|  3.69k|  } else {
  666|  1.72k|    nameA = new TextString();
  667|  1.72k|  }
  668|  5.42k|  obj1.free();
  669|       |
  670|  5.42k|  if (fieldObjA.dictLookup("FT", &obj1)->isName()) {
  ------------------
  |  Branch (670:7): [True: 3.55k, False: 1.86k]
  ------------------
  671|  3.55k|    typeStr = new GString(obj1.getName());
  672|  3.55k|    typeFromParentA = gFalse;
  ------------------
  |  |   18|  3.55k|#define gFalse 0
  ------------------
  673|  3.55k|  } else {
  674|  1.86k|    typeStr = NULL;
  675|  1.86k|    typeFromParentA = gTrue;
  ------------------
  |  |   17|  1.86k|#define gTrue 1
  ------------------
  676|  1.86k|  }
  677|  5.42k|  obj1.free();
  678|       |
  679|  5.42k|  if (fieldObjA.dictLookup("Ff", &obj1)->isInt()) {
  ------------------
  |  Branch (679:7): [True: 2.63k, False: 2.79k]
  ------------------
  680|  2.63k|    flagsA = (Guint)obj1.getInt();
  681|  2.63k|    haveFlags = gTrue;
  ------------------
  |  |   17|  2.63k|#define gTrue 1
  ------------------
  682|  2.79k|  } else {
  683|  2.79k|    flagsA = 0;
  684|  2.79k|    haveFlags = gFalse;
  ------------------
  |  |   18|  2.79k|#define gFalse 0
  ------------------
  685|  2.79k|  }
  686|  5.42k|  obj1.free();
  687|       |
  688|       |  //----- get info from parent non-terminal fields
  689|       |
  690|  5.42k|  fieldObjA.dictLookup("Parent", &parentObj);
  691|  5.42k|  depth = 0;
  692|  36.7k|  while (parentObj.isDict() && depth < maxFieldObjectDepth) {
  ------------------
  |  |   72|  31.9k|#define maxFieldObjectDepth 50
  ------------------
  |  Branch (692:10): [True: 31.9k, False: 4.85k]
  |  Branch (692:32): [True: 31.3k, False: 575]
  ------------------
  693|       |
  694|  31.3k|    if (parentObj.dictLookup("T", &obj1)->isString()) {
  ------------------
  |  Branch (694:9): [True: 30.5k, False: 833]
  ------------------
  695|  30.5k|      if (nameA->getLength()) {
  ------------------
  |  Branch (695:11): [True: 29.8k, False: 627]
  ------------------
  696|  29.8k|	nameA->insert(0, (Unicode)'.');
  697|  29.8k|      }
  698|  30.5k|      nameA->insert(0, obj1.getString());
  699|  30.5k|    }
  700|  31.3k|    obj1.free();
  701|       |
  702|  31.3k|    if (!typeStr) {
  ------------------
  |  Branch (702:9): [True: 2.92k, False: 28.4k]
  ------------------
  703|  2.92k|      if (parentObj.dictLookup("FT", &obj1)->isName()) {
  ------------------
  |  Branch (703:11): [True: 363, False: 2.56k]
  ------------------
  704|    363|	typeStr = new GString(obj1.getName());
  705|    363|      }
  706|  2.92k|      obj1.free();
  707|  2.92k|    }
  708|       |
  709|  31.3k|    if (!haveFlags) {
  ------------------
  |  Branch (709:9): [True: 5.04k, False: 26.3k]
  ------------------
  710|  5.04k|      if (parentObj.dictLookup("Ff", &obj1)->isInt()) {
  ------------------
  |  Branch (710:11): [True: 472, False: 4.57k]
  ------------------
  711|    472|	flagsA = (Guint)obj1.getInt();
  712|    472|	haveFlags = gTrue;
  ------------------
  |  |   17|    472|#define gTrue 1
  ------------------
  713|    472|      }
  714|  5.04k|      obj1.free();
  715|  5.04k|    }
  716|       |
  717|  31.3k|    parentObj.dictLookup("Parent", &parentObj2);
  718|  31.3k|    parentObj.free();
  719|  31.3k|    parentObj = parentObj2;
  720|       |
  721|  31.3k|    ++depth;
  722|  31.3k|  }
  723|  5.42k|  parentObj.free();
  724|       |
  725|  5.42k|  if (!typeStr) {
  ------------------
  |  Branch (725:7): [True: 1.50k, False: 3.92k]
  ------------------
  726|  1.50k|    error(errSyntaxError, -1, "Missing type in AcroForm field");
  727|  1.50k|    goto err1;
  728|  1.50k|  }
  729|       |
  730|       |  //----- get static XFA info
  731|       |
  732|  3.92k|  xfaFieldA = NULL;
  733|  3.92k|  if (acroFormA->xfaScanner) {
  ------------------
  |  Branch (733:7): [True: 152, False: 3.76k]
  ------------------
  734|       |    // convert field name to UTF-8, and remove segments that start
  735|       |    // with '#' -- to match the XFA field name
  736|    152|    xfaName = nameA->toUTF8();
  737|    152|    i0 = 0;
  738|  1.37k|    while (i0 < xfaName->getLength()) {
  ------------------
  |  Branch (738:12): [True: 1.21k, False: 152]
  ------------------
  739|  1.21k|      i1 = i0;
  740|  70.6k|      while (i1 < xfaName->getLength()) {
  ------------------
  |  Branch (740:14): [True: 70.5k, False: 104]
  ------------------
  741|  70.5k|	if (xfaName->getChar(i1) == '.') {
  ------------------
  |  Branch (741:6): [True: 1.11k, False: 69.4k]
  ------------------
  742|  1.11k|	  ++i1;
  743|  1.11k|	  break;
  744|  1.11k|	}
  745|  69.4k|	++i1;
  746|  69.4k|      }
  747|  1.21k|      if (xfaName->getChar(i0) == '#') {
  ------------------
  |  Branch (747:11): [True: 405, False: 813]
  ------------------
  748|    405|	xfaName->del(i0, i1 - i0);
  749|    813|      } else {
  750|    813|	i0 = i1;
  751|    813|      }
  752|  1.21k|    }
  753|    152|    xfaFieldA = acroFormA->xfaScanner->findField(xfaName);
  754|    152|    delete xfaName;
  755|    152|  }
  756|       |
  757|       |  //----- check for a radio button
  758|       |
  759|       |  // this is a kludge: if we see a Btn-type field with kids, and the
  760|       |  // Ff entry is missing, assume the kids are radio buttons
  761|  3.92k|  if (typeFromParentA && !typeStr->cmp("Btn") && !haveFlags) {
  ------------------
  |  Branch (761:7): [True: 363, False: 3.55k]
  |  Branch (761:26): [True: 108, False: 255]
  |  Branch (761:50): [True: 35, False: 73]
  ------------------
  762|     35|    flagsA = acroFormFlagRadio;
  ------------------
  |  |   40|     35|#define acroFormFlagRadio              (1 << 15)  // button
  ------------------
  763|     35|  }
  764|       |
  765|       |  //----- determine field type
  766|       |
  767|  3.92k|  if (!typeStr->cmp("Btn")) {
  ------------------
  |  Branch (767:7): [True: 811, False: 3.11k]
  ------------------
  768|    811|    if (flagsA & acroFormFlagPushbutton) {
  ------------------
  |  |   41|    811|#define acroFormFlagPushbutton         (1 << 16)  // button
  ------------------
  |  Branch (768:9): [True: 64, False: 747]
  ------------------
  769|     64|      typeA = acroFormFieldPushbutton;
  770|    747|    } else if (flagsA & acroFormFlagRadio) {
  ------------------
  |  |   40|    747|#define acroFormFlagRadio              (1 << 15)  // button
  ------------------
  |  Branch (770:16): [True: 141, False: 606]
  ------------------
  771|    141|      typeA = acroFormFieldRadioButton;
  772|    606|    } else {
  773|    606|      typeA = acroFormFieldCheckbox;
  774|    606|    }
  775|  3.11k|  } else if (!typeStr->cmp("Tx")) {
  ------------------
  |  Branch (775:14): [True: 2.93k, False: 171]
  ------------------
  776|  2.93k|    if (xfaFieldA && xfaFieldA->getBarcodeInfo()) {
  ------------------
  |  Branch (776:9): [True: 0, False: 2.93k]
  |  Branch (776:22): [True: 0, False: 0]
  ------------------
  777|      0|      typeA = acroFormFieldBarcode;
  778|  2.93k|    } else if (flagsA & acroFormFlagFileSelect) {
  ------------------
  |  |   45|  2.93k|#define acroFormFlagFileSelect         (1 << 20)  // text
  ------------------
  |  Branch (778:16): [True: 66, False: 2.87k]
  ------------------
  779|     66|      typeA = acroFormFieldFileSelect;
  780|  2.87k|    } else if (flagsA & acroFormFlagMultiline) {
  ------------------
  |  |   37|  2.87k|#define acroFormFlagMultiline          (1 << 12)  // text
  ------------------
  |  Branch (780:16): [True: 206, False: 2.66k]
  ------------------
  781|    206|      typeA = acroFormFieldMultilineText;
  782|  2.66k|    } else {
  783|  2.66k|      typeA = acroFormFieldText;
  784|  2.66k|    }
  785|  2.93k|  } else if (!typeStr->cmp("Ch")) {
  ------------------
  |  Branch (785:14): [True: 12, False: 159]
  ------------------
  786|     12|    if (flagsA & acroFormFlagCombo) {
  ------------------
  |  |   42|     12|#define acroFormFlagCombo              (1 << 17)  // choice
  ------------------
  |  Branch (786:9): [True: 0, False: 12]
  ------------------
  787|      0|      typeA = acroFormFieldComboBox;
  788|     12|    } else {
  789|     12|      typeA = acroFormFieldListBox;
  790|     12|    }
  791|    159|  } else if (!typeStr->cmp("Sig")) {
  ------------------
  |  Branch (791:14): [True: 0, False: 159]
  ------------------
  792|      0|    typeA = acroFormFieldSignature;
  793|    159|  } else {
  794|    159|    error(errSyntaxError, -1, "Invalid type in AcroForm field");
  795|    159|    goto err1;
  796|    159|  }
  797|  3.76k|  delete typeStr;
  798|       |
  799|  3.76k|  field = new AcroFormField(acroFormA, fieldRefA, &fieldObjA,
  800|  3.76k|			    typeA, nameA, flagsA, typeFromParentA, xfaFieldA);
  801|  3.76k|  fieldObjA.free();
  802|  3.76k|  return field;
  803|       |
  804|  1.66k| err1:
  805|  1.66k|  delete typeStr;
  806|  1.66k|  delete nameA;
  807|  1.66k|  fieldObjA.free();
  808|       |  return NULL;
  809|  3.92k|}
_ZN13AcroFormFieldC2EP8AcroFormP6ObjectS3_17AcroFormFieldTypeP10TextStringjiP8XFAField:
  815|  3.76k|			     XFAField *xfaFieldA) {
  816|  3.76k|  acroForm = acroFormA;
  817|  3.76k|  fieldRefA->copy(&fieldRef);
  818|  3.76k|  fieldObjA->copy(&fieldObj);
  819|  3.76k|  type = typeA;
  820|  3.76k|  name = nameA;
  821|  3.76k|  flags = flagsA;
  822|  3.76k|  typeFromParent = typeFromParentA;
  823|  3.76k|  xfaField = xfaFieldA;
  824|  3.76k|}
_ZN13AcroFormFieldD2Ev:
  826|  3.76k|AcroFormField::~AcroFormField() {
  827|  3.76k|  fieldRef.free();
  828|  3.76k|  fieldObj.free();
  829|  3.76k|  delete name;
  830|  3.76k|}
_ZN17AcroFormAnnotPageC2Eiii:
  327|  1.14M|    { annotNum = annotNumA; annotGen = annotGenA; pageNum = pageNumA; }

_ZN6AnnotsC2EP6PDFDoc:
 1360|  2.33k|Annots::Annots(PDFDoc *docA) {
 1361|  2.33k|  doc = docA;
 1362|  2.33k|  pageAnnots = (PageAnnots **)gmallocn(doc->getNumPages(), sizeof(PageAnnots*));
 1363|   161k|  for (int page = 1; page <= doc->getNumPages(); ++page) {
  ------------------
  |  Branch (1363:22): [True: 159k, False: 2.33k]
  ------------------
 1364|   159k|    pageAnnots[page - 1] = NULL;
 1365|   159k|  }
 1366|  2.33k|  formFieldRefsSize = 0;
 1367|  2.33k|  formFieldRefs = NULL;
 1368|  2.33k|#if MULTITHREADED
 1369|       |  gInitMutex(&mutex);
  ------------------
  |  |   51|  2.33k|#define gInitMutex(m) pthread_mutex_init(m, NULL)
  ------------------
 1370|  2.33k|#endif
 1371|  2.33k|}
_ZN6AnnotsD2Ev:
 1373|  2.33k|Annots::~Annots() {
 1374|   161k|  for (int page = 1; page <= doc->getNumPages(); ++page) {
  ------------------
  |  Branch (1374:22): [True: 159k, False: 2.33k]
  ------------------
 1375|   159k|    delete pageAnnots[page - 1];
 1376|   159k|  }
 1377|  2.33k|  gfree(pageAnnots);
 1378|  2.33k|  gfree(formFieldRefs);
 1379|  2.33k|#if MULTITHREADED
 1380|  2.33k|  gDestroyMutex(&mutex);
  ------------------
  |  |   52|  2.33k|#define gDestroyMutex(m) pthread_mutex_destroy(m)
  ------------------
 1381|  2.33k|#endif
 1382|  2.33k|}

_ZN5ArrayC2EP4XRef:
   22|  1.04M|Array::Array(XRef *xrefA) {
   23|  1.04M|  xref = xrefA;
   24|       |  elems = NULL;
   25|  1.04M|  size = length = 0;
   26|  1.04M|  ref = 1;
   27|  1.04M|}
_ZN5ArrayD2Ev:
   29|   963k|Array::~Array() {
   30|   963k|  int i;
   31|       |
   32|  20.5M|  for (i = 0; i < length; ++i)
  ------------------
  |  Branch (32:15): [True: 19.6M, False: 963k]
  ------------------
   33|  19.6M|    elems[i].free();
   34|   963k|  gfree(elems);
   35|   963k|}
_ZN5Array3addEP6Object:
   37|  20.6M|void Array::add(Object *elem) {
   38|  20.6M|  if (length == size) {
  ------------------
  |  Branch (38:7): [True: 1.69M, False: 19.0M]
  ------------------
   39|  1.69M|    if (length == 0) {
  ------------------
  |  Branch (39:9): [True: 1.03M, False: 660k]
  ------------------
   40|  1.03M|      size = 8;
   41|  1.03M|    } else {
   42|   660k|      size *= 2;
   43|   660k|    }
   44|  1.69M|    elems = (Object *)greallocn(elems, size, sizeof(Object));
   45|  1.69M|  }
   46|  20.6M|  elems[length] = *elem;
   47|  20.6M|  ++length;
   48|  20.6M|}
_ZN5Array3getEiP6Objecti:
   50|  76.8k|Object *Array::get(int i, Object *obj, int recursion) {
   51|  76.8k|  if (i < 0 || i >= length) {
  ------------------
  |  Branch (51:7): [True: 0, False: 76.8k]
  |  Branch (51:16): [True: 0, False: 76.8k]
  ------------------
   52|       |#ifdef DEBUG_OBJECT_MEM
   53|       |    abort();
   54|       |#else
   55|      0|    return obj->initNull();
   56|      0|#endif
   57|      0|  }
   58|  76.8k|  return elems[i].fetch(xref, obj, recursion);
   59|  76.8k|}
_ZN5Array5getNFEiP6Object:
   61|  11.1M|Object *Array::getNF(int i, Object *obj) {
   62|  11.1M|  if (i < 0 || i >= length) {
  ------------------
  |  Branch (62:7): [True: 0, False: 11.1M]
  |  Branch (62:16): [True: 0, False: 11.1M]
  ------------------
   63|       |#ifdef DEBUG_OBJECT_MEM
   64|       |    abort();
   65|       |#else
   66|      0|    return obj->initNull();
   67|      0|#endif
   68|      0|  }
   69|  11.1M|  return elems[i].copy(obj);
   70|  11.1M|}

_ZN5Array6incRefEv:
   36|   533k|  long incRef() { return gAtomicIncrement(&ref); }
_ZN5Array6decRefEv:
   37|  1.13M|  long decRef() { return gAtomicDecrement(&ref); }
_ZN5Array9getLengthEv:
   44|  11.7M|  int getLength() { return length; }

_ZN17BuiltinFontWidthsC2EP16BuiltinFontWidthi:
   20|  65.8k|BuiltinFontWidths::BuiltinFontWidths(BuiltinFontWidth *widths, int sizeA) {
   21|  65.8k|  int i, h;
   22|       |
   23|  65.8k|  size = sizeA;
   24|  65.8k|  tab = (BuiltinFontWidth **)gmallocn(size, sizeof(BuiltinFontWidth *));
   25|  19.6M|  for (i = 0; i < size; ++i) {
  ------------------
  |  Branch (25:15): [True: 19.6M, False: 65.8k]
  ------------------
   26|  19.6M|    tab[i] = NULL;
   27|  19.6M|  }
   28|  19.6M|  for (i = 0; i < sizeA; ++i) {
  ------------------
  |  Branch (28:15): [True: 19.6M, False: 65.8k]
  ------------------
   29|  19.6M|    h = hash(widths[i].name);
   30|  19.6M|    widths[i].next = tab[h];
   31|  19.6M|    tab[h] = &widths[i];
   32|  19.6M|  }
   33|  65.8k|}
_ZN17BuiltinFontWidthsD2Ev:
   35|  65.8k|BuiltinFontWidths::~BuiltinFontWidths() {
   36|  65.8k|  gfree(tab);
   37|  65.8k|}
_ZN17BuiltinFontWidths4hashEPKc:
   54|  19.6M|int BuiltinFontWidths::hash(const char *name) {
   55|  19.6M|  const char *p;
   56|  19.6M|  unsigned int h;
   57|       |
   58|  19.6M|  h = 0;
   59|   146M|  for (p = name; *p; ++p) {
  ------------------
  |  Branch (59:18): [True: 126M, False: 19.6M]
  ------------------
   60|   126M|    h = 17 * h + (int)(*p & 0xff);
   61|   126M|  }
   62|  19.6M|  return (int)(h % size);
   63|  19.6M|}

_Z21initBuiltinFontTablesv:
 4262|  4.70k|void initBuiltinFontTables() {
 4263|  4.70k|  builtinFonts[0].widths = new BuiltinFontWidths(courierWidthsTab, 315);
 4264|  4.70k|  builtinFonts[1].widths = new BuiltinFontWidths(courierBoldWidthsTab, 315);
 4265|  4.70k|  builtinFonts[2].widths = new BuiltinFontWidths(courierBoldObliqueWidthsTab, 315);
 4266|  4.70k|  builtinFonts[3].widths = new BuiltinFontWidths(courierObliqueWidthsTab, 315);
 4267|  4.70k|  builtinFonts[4].widths = new BuiltinFontWidths(helveticaWidthsTab, 315);
 4268|  4.70k|  builtinFonts[5].widths = new BuiltinFontWidths(helveticaBoldWidthsTab, 316);
 4269|  4.70k|  builtinFonts[6].widths = new BuiltinFontWidths(helveticaBoldObliqueWidthsTab, 315);
 4270|  4.70k|  builtinFonts[7].widths = new BuiltinFontWidths(helveticaObliqueWidthsTab, 315);
 4271|  4.70k|  builtinFonts[8].widths = new BuiltinFontWidths(symbolWidthsTab, 190);
 4272|  4.70k|  builtinFonts[9].widths = new BuiltinFontWidths(timesBoldWidthsTab, 315);
 4273|  4.70k|  builtinFonts[10].widths = new BuiltinFontWidths(timesBoldItalicWidthsTab, 315);
 4274|  4.70k|  builtinFonts[11].widths = new BuiltinFontWidths(timesItalicWidthsTab, 315);
 4275|  4.70k|  builtinFonts[12].widths = new BuiltinFontWidths(timesRomanWidthsTab, 315);
 4276|  4.70k|  builtinFonts[13].widths = new BuiltinFontWidths(zapfDingbatsWidthsTab, 202);
 4277|  4.70k|}
_Z21freeBuiltinFontTablesv:
 4279|  4.70k|void freeBuiltinFontTables() {
 4280|  4.70k|  int i;
 4281|       |
 4282|  70.5k|  for (i = 0; i < 14; ++i) {
  ------------------
  |  Branch (4282:15): [True: 65.8k, False: 4.70k]
  ------------------
 4283|  65.8k|    delete builtinFonts[i].widths;
 4284|  65.8k|  }
 4285|  4.70k|}

_ZN9CMapCacheC2Ev:
  433|  4.70k|CMapCache::CMapCache() {
  434|  4.70k|  int i;
  435|       |
  436|  23.5k|  for (i = 0; i < cMapCacheSize; ++i) {
  ------------------
  |  |   96|  23.5k|#define cMapCacheSize 4
  ------------------
  |  Branch (436:15): [True: 18.8k, False: 4.70k]
  ------------------
  437|       |    cache[i] = NULL;
  438|  18.8k|  }
  439|  4.70k|}
_ZN9CMapCacheD2Ev:
  441|  4.70k|CMapCache::~CMapCache() {
  442|  4.70k|  int i;
  443|       |
  444|  23.5k|  for (i = 0; i < cMapCacheSize; ++i) {
  ------------------
  |  |   96|  23.5k|#define cMapCacheSize 4
  ------------------
  |  Branch (444:15): [True: 18.8k, False: 4.70k]
  ------------------
  445|  18.8k|    if (cache[i]) {
  ------------------
  |  Branch (445:9): [True: 0, False: 18.8k]
  ------------------
  446|      0|      cache[i]->decRefCnt();
  447|      0|    }
  448|  18.8k|  }
  449|  4.70k|}

_ZN12PageTreeNodeC2E3RefiPS_:
   48|  34.1k|PageTreeNode::PageTreeNode(Ref refA, int countA, PageTreeNode *parentA) {
   49|  34.1k|  ref = refA;
   50|  34.1k|  count = countA;
   51|  34.1k|  parent = parentA;
   52|  34.1k|  kids = NULL;
   53|       |  attrs = NULL;
   54|  34.1k|}
_ZN12PageTreeNodeD2Ev:
   56|  34.0k|PageTreeNode::~PageTreeNode() {
   57|  34.0k|  delete attrs;
   58|  34.0k|  if (kids) {
  ------------------
  |  Branch (58:7): [True: 2.00k, False: 32.0k]
  ------------------
   59|  2.00k|    deleteGList(kids, PageTreeNode);
  ------------------
  |  |   94|  2.00k|  do {                                              \
  |  |   95|  2.00k|    GList *_list = (list);                          \
  |  |   96|  2.00k|    {                                               \
  |  |   97|  2.00k|      int _i;                                       \
  |  |   98|  33.7k|      for (_i = 0; _i < _list->getLength(); ++_i) { \
  |  |  ------------------
  |  |  |  Branch (98:20): [True: 31.7k, False: 2.00k]
  |  |  ------------------
  |  |   99|  31.7k|        delete (T*)_list->get(_i);                  \
  |  |  100|  31.7k|      }                                             \
  |  |  101|  2.00k|      delete _list;                                 \
  |  |  102|  2.00k|    }                                               \
  |  |  103|  2.00k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (103:12): [Folded, False: 2.00k]
  |  |  ------------------
  ------------------
   60|  2.00k|  }
   61|  34.0k|}
_ZN12EmbeddedFileC2EP10TextStringP6Object:
   77|    115|EmbeddedFile::EmbeddedFile(TextString *nameA, Object *streamRefA) {
   78|    115|  name = nameA;
   79|    115|  streamRefA->copy(&streamRef);
   80|    115|}
_ZN12EmbeddedFileD2Ev:
   82|    115|EmbeddedFile::~EmbeddedFile() {
   83|    115|  delete name;
   84|    115|  streamRef.free();
   85|    115|}
_ZN13PageLabelNodeC2EiP4Dict:
  105|    743|PageLabelNode::PageLabelNode(int firstPageA, Dict *dict) {
  106|    743|  Object prefixObj, styleObj, startObj;
  107|       |
  108|       |  // convert page index to page number
  109|    743|  firstPage = firstPageA + 1;
  110|       |
  111|       |  // lastPage will be filled in later
  112|    743|  lastPage = -1;
  113|       |
  114|    743|  if (dict->lookup("P", &prefixObj)->isString()) {
  ------------------
  |  Branch (114:7): [True: 338, False: 405]
  ------------------
  115|    338|    prefix = new TextString(prefixObj.getString());
  116|    405|  } else {
  117|    405|    prefix = new TextString();
  118|    405|  }
  119|    743|  prefixObj.free();
  120|       |
  121|    743|  style = '\0';
  122|    743|  if (dict->lookup("S", &styleObj)->isName()) {
  ------------------
  |  Branch (122:7): [True: 128, False: 615]
  ------------------
  123|    128|    if (strlen(styleObj.getName()) == 1) {
  ------------------
  |  Branch (123:9): [True: 72, False: 56]
  ------------------
  124|     72|      style = styleObj.getName()[0];
  125|     72|    }
  126|    128|  }
  127|    743|  styleObj.free();
  128|       |
  129|    743|  start = 1;
  130|    743|  if (dict->lookup("St", &startObj)->isInt()) {
  ------------------
  |  Branch (130:7): [True: 52, False: 691]
  ------------------
  131|     52|    start = startObj.getInt();
  132|     52|  }
  133|    743|  startObj.free();
  134|    743|}
_ZN13PageLabelNodeD2Ev:
  136|    743|PageLabelNode::~PageLabelNode() {
  137|    743|  delete prefix;
  138|    743|}
_ZN7CatalogC2EP6PDFDoc:
  144|  2.58k|Catalog::Catalog(PDFDoc *docA) {
  145|  2.58k|  Object catDict;
  146|  2.58k|  Object obj, obj2;
  147|       |
  148|  2.58k|  ok = gTrue;
  ------------------
  |  |   17|  2.58k|#define gTrue 1
  ------------------
  149|  2.58k|  doc = docA;
  150|  2.58k|  xref = doc->getXRef();
  151|  2.58k|  pageTree = NULL;
  152|  2.58k|  pages = NULL;
  153|  2.58k|  pageRefs = NULL;
  154|  2.58k|  numPages = 0;
  155|  2.58k|  baseURI = NULL;
  156|  2.58k|  form = NULL;
  157|  2.58k|  embeddedFiles = NULL;
  158|  2.58k|  pageLabels = NULL;
  159|  2.58k|#if MULTITHREADED
  160|  2.58k|  gInitMutex(&pageMutex);
  ------------------
  |  |   51|  2.58k|#define gInitMutex(m) pthread_mutex_init(m, NULL)
  ------------------
  161|  2.58k|#endif
  162|       |
  163|  2.58k|  xref->getCatalog(&catDict);
  164|  2.58k|  if (!catDict.isDict()) {
  ------------------
  |  Branch (164:7): [True: 124, False: 2.46k]
  ------------------
  165|    124|    error(errSyntaxError, -1, "Catalog object is wrong type ({0:s})",
  166|    124|	  catDict.getTypeName());
  167|    124|    goto err1;
  168|    124|  }
  169|       |
  170|       |  // read page tree
  171|  2.46k|  if (!readPageTree(&catDict)) {
  ------------------
  |  Branch (171:7): [True: 122, False: 2.34k]
  ------------------
  172|    122|    goto err1;
  173|    122|  }
  174|       |
  175|       |  // read named destination dictionary
  176|  2.34k|  catDict.dictLookup("Dests", &dests);
  177|       |
  178|       |  // read root of named destination tree
  179|  2.34k|  if (catDict.dictLookup("Names", &obj)->isDict())
  ------------------
  |  Branch (179:7): [True: 206, False: 2.13k]
  ------------------
  180|    206|    obj.dictLookup("Dests", &nameTree);
  181|  2.13k|  else
  182|  2.13k|    nameTree.initNull();
  183|  2.34k|  obj.free();
  184|       |
  185|       |  // read base URI
  186|  2.34k|  if (catDict.dictLookup("URI", &obj)->isDict()) {
  ------------------
  |  Branch (186:7): [True: 0, False: 2.34k]
  ------------------
  187|      0|    if (obj.dictLookup("Base", &obj2)->isString()) {
  ------------------
  |  Branch (187:9): [True: 0, False: 0]
  ------------------
  188|      0|      baseURI = obj2.getString()->copy();
  189|      0|    }
  190|      0|    obj2.free();
  191|      0|  }
  192|  2.34k|  obj.free();
  193|  2.34k|  if (!baseURI || baseURI->getLength() == 0) {
  ------------------
  |  Branch (193:7): [True: 2.34k, False: 0]
  |  Branch (193:19): [True: 0, False: 0]
  ------------------
  194|  2.34k|    if (baseURI) {
  ------------------
  |  Branch (194:9): [True: 0, False: 2.34k]
  ------------------
  195|      0|      delete baseURI;
  196|      0|    }
  197|  2.34k|    if (doc->getFileName()) {
  ------------------
  |  Branch (197:9): [True: 0, False: 2.34k]
  ------------------
  198|      0|      baseURI = makePathAbsolute(grabPath(doc->getFileName()->getCString()));
  199|      0|      if (baseURI->getChar(0) == '/') {
  ------------------
  |  Branch (199:11): [True: 0, False: 0]
  ------------------
  200|      0|	baseURI->insert(0, "file://localhost");
  201|      0|      } else {
  202|      0|	baseURI->insert(0, "file://localhost/");
  203|      0|      }
  204|  2.34k|    } else {
  205|  2.34k|      baseURI = new GString("file://localhost/");
  206|  2.34k|    }
  207|  2.34k|  }
  208|       |
  209|       |  // get the metadata stream
  210|  2.34k|  catDict.dictLookup("Metadata", &metadata);
  211|       |
  212|       |  // get the structure tree root
  213|  2.34k|  catDict.dictLookup("StructTreeRoot", &structTreeRoot);
  214|       |
  215|       |  // get the outline dictionary
  216|  2.34k|  catDict.dictLookup("Outlines", &outline);
  217|       |
  218|       |  // get the AcroForm dictionary
  219|  2.34k|  catDict.dictLookup("AcroForm", &acroForm);
  220|       |
  221|       |  // get the NeedsRendering flag
  222|       |  // NB: AcroForm::load() uses this value
  223|  2.34k|  needsRendering = catDict.dictLookup("NeedsRendering", &obj)->isBool() &&
  ------------------
  |  Branch (223:20): [True: 11, False: 2.32k]
  ------------------
  224|     11|                   obj.getBool();
  ------------------
  |  Branch (224:20): [True: 11, False: 0]
  ------------------
  225|  2.34k|  obj.free();
  226|       |
  227|       |  // create the Form
  228|       |  // (if acroForm is a null object, this will still create an AcroForm
  229|       |  // if there are unattached Widget-type annots)
  230|  2.34k|  form = AcroForm::load(doc, this, &acroForm);
  231|       |
  232|       |  // get the OCProperties dictionary
  233|  2.34k|  catDict.dictLookup("OCProperties", &ocProperties);
  234|       |
  235|       |  // get the list of embedded files
  236|  2.34k|  readEmbeddedFileList(catDict.getDict());
  237|       |
  238|       |  // get the ViewerPreferences object
  239|  2.34k|  catDict.dictLookupNF("ViewerPreferences", &viewerPrefs);
  240|       |
  241|  2.34k|  if (catDict.dictLookup("PageLabels", &obj)->isDict()) {
  ------------------
  |  Branch (241:7): [True: 136, False: 2.20k]
  ------------------
  242|    136|    readPageLabelTree(&obj);
  243|    136|  }
  244|  2.34k|  obj.free();
  245|       |
  246|  2.34k|  catDict.free();
  247|  2.34k|  return;
  248|       |
  249|    246| err1:
  250|    246|  catDict.free();
  251|    246|  dests.initNull();
  252|    246|  nameTree.initNull();
  253|    246|  ok = gFalse;
  ------------------
  |  |   18|    246|#define gFalse 0
  ------------------
  254|    246|}
_ZN7CatalogD2Ev:
  256|  2.58k|Catalog::~Catalog() {
  257|  2.58k|  int i;
  258|       |
  259|  2.58k|  if (pageTree) {
  ------------------
  |  Branch (259:7): [True: 2.33k, False: 246]
  ------------------
  260|  2.33k|    delete pageTree;
  261|  2.33k|  }
  262|  2.58k|  if (pages) {
  ------------------
  |  Branch (262:7): [True: 2.33k, False: 253]
  ------------------
  263|   161k|    for (i = 0; i < numPages; ++i) {
  ------------------
  |  Branch (263:17): [True: 159k, False: 2.33k]
  ------------------
  264|   159k|      if (pages[i]) {
  ------------------
  |  Branch (264:11): [True: 159k, False: 0]
  ------------------
  265|   159k|	delete pages[i];
  266|   159k|      }
  267|   159k|    }
  268|  2.33k|    gfree(pages);
  269|  2.33k|    gfree(pageRefs);
  270|  2.33k|  }
  271|  2.58k|#if MULTITHREADED
  272|  2.58k|  gDestroyMutex(&pageMutex);
  ------------------
  |  |   52|  2.58k|#define gDestroyMutex(m) pthread_mutex_destroy(m)
  ------------------
  273|  2.58k|#endif
  274|  2.58k|  dests.free();
  275|  2.58k|  nameTree.free();
  276|  2.58k|  if (baseURI) {
  ------------------
  |  Branch (276:7): [True: 2.33k, False: 246]
  ------------------
  277|  2.33k|    delete baseURI;
  278|  2.33k|  }
  279|  2.58k|  metadata.free();
  280|  2.58k|  structTreeRoot.free();
  281|  2.58k|  outline.free();
  282|  2.58k|  acroForm.free();
  283|  2.58k|  if (form) {
  ------------------
  |  Branch (283:7): [True: 1.49k, False: 1.08k]
  ------------------
  284|  1.49k|    delete form;
  285|  1.49k|  }
  286|  2.58k|  ocProperties.free();
  287|  2.58k|  if (embeddedFiles) {
  ------------------
  |  Branch (287:7): [True: 5, False: 2.57k]
  ------------------
  288|      5|    deleteGList(embeddedFiles, EmbeddedFile);
  ------------------
  |  |   94|      5|  do {                                              \
  |  |   95|      5|    GList *_list = (list);                          \
  |  |   96|      5|    {                                               \
  |  |   97|      5|      int _i;                                       \
  |  |   98|    120|      for (_i = 0; _i < _list->getLength(); ++_i) { \
  |  |  ------------------
  |  |  |  Branch (98:20): [True: 115, False: 5]
  |  |  ------------------
  |  |   99|    115|        delete (T*)_list->get(_i);                  \
  |  |  100|    115|      }                                             \
  |  |  101|      5|      delete _list;                                 \
  |  |  102|      5|    }                                               \
  |  |  103|      5|  } while (0)
  |  |  ------------------
  |  |  |  Branch (103:12): [Folded, False: 5]
  |  |  ------------------
  ------------------
  289|      5|  }
  290|  2.58k|  if (pageLabels) {
  ------------------
  |  Branch (290:7): [True: 46, False: 2.53k]
  ------------------
  291|     46|    deleteGList(pageLabels, PageLabelNode);
  ------------------
  |  |   94|     46|  do {                                              \
  |  |   95|     46|    GList *_list = (list);                          \
  |  |   96|     46|    {                                               \
  |  |   97|     46|      int _i;                                       \
  |  |   98|    789|      for (_i = 0; _i < _list->getLength(); ++_i) { \
  |  |  ------------------
  |  |  |  Branch (98:20): [True: 743, False: 46]
  |  |  ------------------
  |  |   99|    743|        delete (T*)_list->get(_i);                  \
  |  |  100|    743|      }                                             \
  |  |  101|     46|      delete _list;                                 \
  |  |  102|     46|    }                                               \
  |  |  103|     46|  } while (0)
  |  |  ------------------
  |  |  |  Branch (103:12): [Folded, False: 46]
  |  |  ------------------
  ------------------
  292|     46|  }
  293|  2.58k|  viewerPrefs.free();
  294|  2.58k|}
_ZN7Catalog7getPageEi:
  296|   319k|Page *Catalog::getPage(int i) {
  297|   319k|  Page *page;
  298|       |
  299|   319k|#if MULTITHREADED
  300|   319k|  gLockMutex(&pageMutex);
  ------------------
  |  |   53|   319k|#define gLockMutex(m) pthread_mutex_lock(m)
  ------------------
  301|   319k|#endif
  302|   319k|  if (!pages[i-1]) {
  ------------------
  |  Branch (302:7): [True: 159k, False: 159k]
  ------------------
  303|   159k|    loadPage(i);
  304|   159k|  }
  305|   319k|  page = pages[i-1];
  306|   319k|#if MULTITHREADED
  307|   319k|  gUnlockMutex(&pageMutex);
  ------------------
  |  |   54|   319k|#define gUnlockMutex(m) pthread_mutex_unlock(m)
  ------------------
  308|   319k|#endif
  309|   319k|  return page;
  310|   319k|}
_ZN7Catalog12readPageTreeEP6Object:
  525|  2.46k|GBool Catalog::readPageTree(Object *catDict) {
  526|  2.46k|  Object topPagesRef, topPagesObj, countObj;
  527|  2.46k|  int i;
  528|       |
  529|  2.46k|  if (!catDict->dictLookupNF("Pages", &topPagesRef)->isRef()) {
  ------------------
  |  Branch (529:7): [True: 37, False: 2.42k]
  ------------------
  530|     37|    error(errSyntaxError, -1, "Top-level pages reference is wrong type ({0:s})",
  531|     37|	  topPagesRef.getTypeName());
  532|     37|    topPagesRef.free();
  533|     37|    return gFalse;
  ------------------
  |  |   18|     37|#define gFalse 0
  ------------------
  534|     37|  }
  535|  2.42k|  if (!topPagesRef.fetch(xref, &topPagesObj)->isDict()) {
  ------------------
  |  Branch (535:7): [True: 85, False: 2.34k]
  ------------------
  536|     85|    error(errSyntaxError, -1, "Top-level pages object is wrong type ({0:s})",
  537|     85|	  topPagesObj.getTypeName());
  538|     85|    topPagesObj.free();
  539|     85|    topPagesRef.free();
  540|     85|    return gFalse;
  ------------------
  |  |   18|     85|#define gFalse 0
  ------------------
  541|     85|  }
  542|  2.34k|  if (topPagesObj.dictLookup("Count", &countObj)->isInt()) {
  ------------------
  |  Branch (542:7): [True: 821, False: 1.51k]
  ------------------
  543|    821|    numPages = countObj.getInt();
  544|    821|    if (numPages == 0 || numPages > 50000) {
  ------------------
  |  Branch (544:9): [True: 161, False: 660]
  |  Branch (544:26): [True: 2, False: 658]
  ------------------
  545|       |      // 1. Acrobat apparently scans the page tree if it sees a zero
  546|       |      //    count.
  547|       |      // 2. Absurdly large page counts result in very slow loading,
  548|       |      //    because other code tries to fetch pages 1 through n.
  549|       |      // In both cases: ignore the given page count and scan the tree
  550|       |      // instead.
  551|    163|      char *touchedObjs = (char *)gmalloc(xref->getNumObjects());
  552|    163|      memset(touchedObjs, 0, xref->getNumObjects());
  553|    163|      numPages = countPageTree(&topPagesRef, touchedObjs);
  554|    163|      gfree(touchedObjs);
  555|    163|    }
  556|  1.51k|  } else {
  557|       |    // assume we got a Page node instead of a Pages node
  558|  1.51k|    numPages = 1;
  559|  1.51k|  }
  560|  2.34k|  countObj.free();
  561|  2.34k|  if (numPages < 0) {
  ------------------
  |  Branch (561:7): [True: 0, False: 2.34k]
  ------------------
  562|      0|    error(errSyntaxError, -1, "Invalid page count");
  563|      0|    topPagesObj.free();
  564|      0|    topPagesRef.free();
  565|      0|    numPages = 0;
  566|      0|    return gFalse;
  ------------------
  |  |   18|      0|#define gFalse 0
  ------------------
  567|      0|  }
  568|  2.34k|  pageTree = new PageTreeNode(topPagesRef.getRef(), numPages, NULL);
  569|  2.34k|  topPagesObj.free();
  570|  2.34k|  topPagesRef.free();
  571|  2.34k|  pages = (Page **)greallocn(pages, numPages, sizeof(Page *));
  572|  2.34k|  pageRefs = (Ref *)greallocn(pageRefs, numPages, sizeof(Ref));
  573|   161k|  for (i = 0; i < numPages; ++i) {
  ------------------
  |  Branch (573:15): [True: 159k, False: 2.34k]
  ------------------
  574|   159k|    pages[i] = NULL;
  575|   159k|    pageRefs[i].num = -1;
  576|   159k|    pageRefs[i].gen = -1;
  577|   159k|  }
  578|  2.34k|  return gTrue;
  ------------------
  |  |   17|  2.34k|#define gTrue 1
  ------------------
  579|  2.34k|}
_ZN7Catalog13countPageTreeEP6ObjectPc:
  581|   105k|int Catalog::countPageTree(Object *pagesNodeRef, char *touchedObjs) {
  582|       |  // check for invalid reference
  583|   105k|  if (pagesNodeRef->isRef() &&
  ------------------
  |  Branch (583:7): [True: 17.8k, False: 87.5k]
  ------------------
  584|  17.8k|      (pagesNodeRef->getRefNum() < 0 ||
  ------------------
  |  Branch (584:8): [True: 0, False: 17.8k]
  ------------------
  585|  17.8k|       pagesNodeRef->getRefNum() >= xref->getNumObjects())) {
  ------------------
  |  Branch (585:8): [True: 972, False: 16.8k]
  ------------------
  586|    972|    return 0;
  587|    972|  }
  588|       |
  589|       |  // check for a page tree loop; fetch the node object
  590|   104k|  Object pagesNode;
  591|   104k|  if (pagesNodeRef->isRef()) {
  ------------------
  |  Branch (591:7): [True: 16.8k, False: 87.5k]
  ------------------
  592|  16.8k|    if (touchedObjs[pagesNodeRef->getRefNum()]) {
  ------------------
  |  Branch (592:9): [True: 10.8k, False: 6.04k]
  ------------------
  593|  10.8k|      error(errSyntaxError, -1, "Loop in Pages tree");
  594|  10.8k|      return 0;
  595|  10.8k|    }
  596|  6.04k|    touchedObjs[pagesNodeRef->getRefNum()] = 1;
  597|  6.04k|    xref->fetch(pagesNodeRef->getRefNum(), pagesNodeRef->getRefGen(),
  598|  6.04k|		&pagesNode);
  599|  87.5k|  } else {
  600|  87.5k|    pagesNodeRef->copy(&pagesNode);
  601|  87.5k|  }
  602|       |
  603|       |  // count the subtree
  604|  93.5k|  int n = 0;
  605|  93.5k|  if (pagesNode.isDict()) {
  ------------------
  |  Branch (605:7): [True: 7.11k, False: 86.4k]
  ------------------
  606|  7.11k|    Object kidsRef, kids;
  607|  7.11k|    pagesNode.dictLookupNF("Kids", &kidsRef);
  608|  7.11k|    if (kidsRef.isRef() &&
  ------------------
  |  Branch (608:9): [True: 72, False: 7.04k]
  ------------------
  609|     72|	kidsRef.getRefNum() >= 0 &&
  ------------------
  |  Branch (609:2): [True: 72, False: 0]
  ------------------
  610|     72|	kidsRef.getRefNum() < xref->getNumObjects()) {
  ------------------
  |  Branch (610:2): [True: 63, False: 9]
  ------------------
  611|     63|      if (touchedObjs[kidsRef.getRefNum()]) {
  ------------------
  |  Branch (611:11): [True: 50, False: 13]
  ------------------
  612|     50|	error(errSyntaxError, -1, "Loop in Pages tree");
  613|     50|	kidsRef.free();
  614|     50|	pagesNode.free();
  615|     50|	return 0;
  616|     50|      }
  617|     13|      touchedObjs[kidsRef.getRefNum()] = 1;
  618|     13|      xref->fetch(kidsRef.getRefNum(), kidsRef.getRefGen(), &kids);
  619|  7.05k|    } else {
  620|  7.05k|      kidsRef.copy(&kids);
  621|  7.05k|    }
  622|  7.06k|    kidsRef.free();
  623|  7.06k|    if (kids.isArray()) {
  ------------------
  |  Branch (623:9): [True: 1.16k, False: 5.90k]
  ------------------
  624|   106k|      for (int i = 0; i < kids.arrayGetLength(); ++i) {
  ------------------
  |  Branch (624:23): [True: 105k, False: 1.16k]
  ------------------
  625|   105k|	Object kid;
  626|   105k|	kids.arrayGetNF(i, &kid);
  627|   105k|	int n2 = countPageTree(&kid, touchedObjs);
  628|   105k|	if (n2 < INT_MAX - n) {
  ------------------
  |  Branch (628:6): [True: 105k, False: 0]
  ------------------
  629|   105k|	  n += n2;
  630|   105k|	} else {
  631|      0|	  error(errSyntaxError, -1, "Page tree contains too many pages");
  632|      0|	  n = INT_MAX;
  633|      0|	}
  634|   105k|	kid.free();
  635|   105k|      }
  636|  5.90k|    } else {
  637|  5.90k|      n = 1;
  638|  5.90k|    }
  639|  7.06k|    kids.free();
  640|  7.06k|  }
  641|       |
  642|  93.5k|  pagesNode.free();
  643|       |
  644|  93.5k|  return n;
  645|  93.5k|}
_ZN7Catalog8loadPageEi:
  647|   159k|void Catalog::loadPage(int pg) {
  648|   159k|  loadPage2(pg, pg - 1, pageTree);
  649|   159k|}
_ZN7Catalog9loadPage2EiiP12PageTreeNode:
  651|   165k|void Catalog::loadPage2(int pg, int relPg, PageTreeNode *node) {
  652|   165k|  Object pageRefObj, pageObj, kidsObj, kidRefObj, kidObj, countObj;
  653|   165k|  PageTreeNode *kidNode, *p;
  654|   165k|  PageAttrs *attrs;
  655|   165k|  int count, i;
  656|       |
  657|   165k|  if (relPg >= node->count) {
  ------------------
  |  Branch (657:7): [True: 0, False: 165k]
  ------------------
  658|      0|    error(errSyntaxError, -1, "Internal error in page tree");
  659|      0|    pages[pg-1] = new Page(doc, pg);
  660|      0|    return;
  661|      0|  }
  662|       |
  663|       |  // if this node has not been filled in yet, it's either a leaf node
  664|       |  // or an unread internal node
  665|   165k|  if (!node->kids) {
  ------------------
  |  Branch (665:7): [True: 154k, False: 11.5k]
  ------------------
  666|       |
  667|       |    // check for a loop in the page tree
  668|   157k|    for (p = node->parent; p; p = p->parent) {
  ------------------
  |  Branch (668:28): [True: 4.88k, False: 152k]
  ------------------
  669|  4.88k|      if (node->ref.num == p->ref.num && node->ref.gen == p->ref.gen) {
  ------------------
  |  Branch (669:11): [True: 1.95k, False: 2.92k]
  |  Branch (669:42): [True: 1.92k, False: 30]
  ------------------
  670|  1.92k|	error(errSyntaxError, -1, "Loop in Pages tree");
  671|  1.92k|	pages[pg-1] = new Page(doc, pg);
  672|  1.92k|	return;
  673|  1.92k|      }
  674|  4.88k|    }
  675|       |
  676|       |    // fetch the Page/Pages object
  677|   152k|    pageRefObj.initRef(node->ref.num, node->ref.gen);
  678|   152k|    if (!pageRefObj.fetch(xref, &pageObj)->isDict()) {
  ------------------
  |  Branch (678:9): [True: 0, False: 152k]
  ------------------
  679|      0|      error(errSyntaxError, -1, "Page tree object is wrong type ({0:s})",
  680|      0|	    pageObj.getTypeName());
  681|      0|      pageObj.free();
  682|      0|      pageRefObj.free();
  683|      0|      pages[pg-1] = new Page(doc, pg);
  684|      0|      return;
  685|      0|    }
  686|       |
  687|       |    // merge the PageAttrs
  688|   152k|    attrs = new PageAttrs(node->parent ? node->parent->attrs
  ------------------
  |  Branch (688:27): [True: 2.62k, False: 149k]
  ------------------
  689|   152k|			               : (PageAttrs *)NULL,
  690|   152k|			  pageObj.getDict(), xref);
  691|       |
  692|       |    // if "Kids" exists, it's an internal node
  693|   152k|    if (pageObj.dictLookup("Kids", &kidsObj)->isArray()) {
  ------------------
  |  Branch (693:9): [True: 2.00k, False: 150k]
  ------------------
  694|       |
  695|       |      // save the PageAttrs
  696|  2.00k|      node->attrs = attrs;
  697|       |
  698|       |      // read the kids
  699|  2.00k|      node->kids = new GList();
  700|   657k|      for (i = 0; i < kidsObj.arrayGetLength(); ++i) {
  ------------------
  |  Branch (700:19): [True: 655k, False: 2.00k]
  ------------------
  701|   655k|	if (kidsObj.arrayGetNF(i, &kidRefObj)->isRef()) {
  ------------------
  |  Branch (701:6): [True: 146k, False: 509k]
  ------------------
  702|   146k|	  if (kidRefObj.fetch(xref, &kidObj)->isDict()) {
  ------------------
  |  Branch (702:8): [True: 31.7k, False: 114k]
  ------------------
  703|  31.7k|	    if (kidObj.dictLookup("Count", &countObj)->isInt()) {
  ------------------
  |  Branch (703:10): [True: 383, False: 31.3k]
  ------------------
  704|    383|	      count = countObj.getInt();
  705|  31.3k|	    } else {
  706|  31.3k|	      count = 1;
  707|  31.3k|	    }
  708|  31.7k|	    countObj.free();
  709|  31.7k|	    node->kids->append(new PageTreeNode(kidRefObj.getRef(), count,
  710|  31.7k|						node));
  711|   114k|	  } else {
  712|   114k|	    error(errSyntaxError, -1, "Page tree object is wrong type ({0:s})",
  713|   114k|		  kidObj.getTypeName());
  714|   114k|	  }
  715|   146k|	  kidObj.free();
  716|   509k|	} else {
  717|   509k|	  error(errSyntaxError, -1,
  718|   509k|		"Page tree reference is wrong type ({0:s})",
  719|   509k|		kidRefObj.getTypeName());
  720|   509k|	}
  721|   655k|	kidRefObj.free();
  722|   655k|      }
  723|       |
  724|   150k|    } else {
  725|       |      
  726|       |      // create the Page object
  727|   150k|      pageRefs[pg-1] = node->ref;
  728|   150k|      pages[pg-1] = new Page(doc, pg, pageObj.getDict(), attrs);
  729|   150k|      if (!pages[pg-1]->isOk()) {
  ------------------
  |  Branch (729:11): [True: 215, False: 150k]
  ------------------
  730|    215|	delete pages[pg-1];
  731|    215|	pages[pg-1] = new Page(doc, pg);
  732|    215|      }
  733|       |
  734|   150k|    }
  735|       |
  736|   152k|    kidsObj.free();
  737|   152k|    pageObj.free();
  738|   152k|    pageRefObj.free();
  739|   152k|  }
  740|       |
  741|       |  // recursively descend the tree
  742|   163k|  if (node->kids) {
  ------------------
  |  Branch (742:7): [True: 13.5k, False: 150k]
  ------------------
  743|   651k|    for (i = 0; i < node->kids->getLength(); ++i) {
  ------------------
  |  Branch (743:17): [True: 644k, False: 7.28k]
  ------------------
  744|   644k|      kidNode = (PageTreeNode *)node->kids->get(i);
  745|   644k|      if (relPg < kidNode->count) {
  ------------------
  |  Branch (745:11): [True: 6.30k, False: 637k]
  ------------------
  746|  6.30k|	loadPage2(pg, relPg, kidNode);
  747|  6.30k|	break;
  748|  6.30k|      }
  749|   637k|      relPg -= kidNode->count;
  750|   637k|    }
  751|       |
  752|       |    // this will only happen if the page tree is invalid
  753|       |    // (i.e., parent count > sum of children counts)
  754|  13.5k|    if (i == node->kids->getLength()) {
  ------------------
  |  Branch (754:9): [True: 7.28k, False: 6.30k]
  ------------------
  755|  7.28k|      error(errSyntaxError, -1, "Invalid page count in page tree");
  756|  7.28k|      pages[pg-1] = new Page(doc, pg);
  757|  7.28k|    }
  758|  13.5k|  }
  759|   163k|}
_ZN7Catalog20readEmbeddedFileListEP4Dict:
  801|  2.33k|void Catalog::readEmbeddedFileList(Dict *catDict) {
  802|  2.33k|  Object obj1, obj2;
  803|  2.33k|  char *touchedObjs;
  804|       |
  805|  2.33k|  touchedObjs = (char *)gmalloc(xref->getNumObjects());
  806|  2.33k|  memset(touchedObjs, 0, xref->getNumObjects());
  807|       |
  808|       |  // read the embedded file name tree
  809|  2.33k|  if (catDict->lookup("Names", &obj1)->isDict()) {
  ------------------
  |  Branch (809:7): [True: 206, False: 2.13k]
  ------------------
  810|    206|    obj1.dictLookupNF("EmbeddedFiles", &obj2);
  811|    206|    readEmbeddedFileTree(&obj2, touchedObjs);
  812|    206|    obj2.free();
  813|    206|  }
  814|  2.33k|  obj1.free();
  815|       |
  816|       |  // look for file attachment annotations
  817|  2.33k|  readFileAttachmentAnnots(catDict->lookupNF("Pages", &obj1), touchedObjs);
  818|  2.33k|  obj1.free();
  819|       |
  820|  2.33k|  gfree(touchedObjs);
  821|  2.33k|}
_ZN7Catalog20readEmbeddedFileTreeEP6ObjectPc:
  823|  60.6k|void Catalog::readEmbeddedFileTree(Object *nodeRef, char *touchedObjs) {
  824|  60.6k|  Object node, kidsObj, kidObj;
  825|  60.6k|  Object namesObj, nameObj, fileSpecObj;
  826|  60.6k|  int i;
  827|       |
  828|       |  // check for an object loop
  829|  60.6k|  if (nodeRef->isRef()) {
  ------------------
  |  Branch (829:7): [True: 11.2k, False: 49.3k]
  ------------------
  830|  11.2k|    if (nodeRef->getRefNum() < 0 ||
  ------------------
  |  Branch (830:9): [True: 0, False: 11.2k]
  ------------------
  831|  11.2k|	nodeRef->getRefNum() >= xref->getNumObjects() ||
  ------------------
  |  Branch (831:2): [True: 5.69k, False: 5.60k]
  ------------------
  832|  10.2k|	touchedObjs[nodeRef->getRefNum()]) {
  ------------------
  |  Branch (832:2): [True: 4.50k, False: 1.09k]
  ------------------
  833|  10.2k|      return;
  834|  10.2k|    }
  835|  1.09k|    touchedObjs[nodeRef->getRefNum()] = 1;
  836|  1.09k|    xref->fetch(nodeRef->getRefNum(), nodeRef->getRefGen(), &node);
  837|  49.3k|  } else {
  838|  49.3k|    nodeRef->copy(&node);
  839|  49.3k|  }
  840|       |
  841|  50.4k|  if (!node.isDict()) {
  ------------------
  |  Branch (841:7): [True: 47.4k, False: 3.03k]
  ------------------
  842|  47.4k|    node.free();
  843|  47.4k|    return;
  844|  47.4k|  }
  845|       |
  846|  3.03k|  if (checkDictLookup(&node, "Kids", &kidsObj, touchedObjs)->isArray()) {
  ------------------
  |  Branch (846:7): [True: 1.31k, False: 1.71k]
  ------------------
  847|  61.7k|    for (i = 0; i < kidsObj.arrayGetLength(); ++i) {
  ------------------
  |  Branch (847:17): [True: 60.4k, False: 1.31k]
  ------------------
  848|  60.4k|      kidsObj.arrayGetNF(i, &kidObj);
  849|  60.4k|      readEmbeddedFileTree(&kidObj, touchedObjs);
  850|  60.4k|      kidObj.free();
  851|  60.4k|    }
  852|  1.71k|  } else {
  853|  1.71k|    if (checkDictLookup(&node, "Names", &namesObj, touchedObjs)->isArray()) {
  ------------------
  |  Branch (853:9): [True: 145, False: 1.57k]
  ------------------
  854|  9.27k|      for (i = 0; i+1 < namesObj.arrayGetLength(); ++i) {
  ------------------
  |  Branch (854:19): [True: 9.12k, False: 145]
  ------------------
  855|  9.12k|	namesObj.arrayGet(i, &nameObj);
  856|  9.12k|	namesObj.arrayGet(i+1, &fileSpecObj);
  857|  9.12k|	readEmbeddedFile(&fileSpecObj, &nameObj);
  858|  9.12k|	nameObj.free();
  859|  9.12k|	fileSpecObj.free();
  860|  9.12k|      }
  861|    145|    }
  862|  1.71k|    namesObj.free();
  863|  1.71k|  }
  864|  3.03k|  kidsObj.free();
  865|       |
  866|  3.03k|  node.free();
  867|  3.03k|}
_ZN7Catalog24readFileAttachmentAnnotsEP6ObjectPc:
  870|   177k|				       char *touchedObjs) {
  871|   177k|  Object pageNode, kids, kid, annots, annot, subtype, fileSpec, contents;
  872|   177k|  int i;
  873|       |
  874|       |  // check for an invalid object reference (e.g., in a damaged PDF file)
  875|   177k|  if (pageNodeRef->isRef() &&
  ------------------
  |  Branch (875:7): [True: 24.6k, False: 152k]
  ------------------
  876|  24.6k|      (pageNodeRef->getRefNum() < 0 ||
  ------------------
  |  Branch (876:8): [True: 0, False: 24.6k]
  ------------------
  877|  24.6k|       pageNodeRef->getRefNum() >= xref->getNumObjects())) {
  ------------------
  |  Branch (877:8): [True: 1.59k, False: 23.0k]
  ------------------
  878|  1.59k|    return;
  879|  1.59k|  }
  880|       |
  881|       |  // check for a page tree loop
  882|   175k|  if (pageNodeRef->isRef()) {
  ------------------
  |  Branch (882:7): [True: 23.0k, False: 152k]
  ------------------
  883|  23.0k|    if (touchedObjs[pageNodeRef->getRefNum()]) {
  ------------------
  |  Branch (883:9): [True: 13.6k, False: 9.38k]
  ------------------
  884|  13.6k|      return;
  885|  13.6k|    }
  886|  9.38k|    touchedObjs[pageNodeRef->getRefNum()] = 1;
  887|  9.38k|    xref->fetch(pageNodeRef->getRefNum(), pageNodeRef->getRefGen(), &pageNode);
  888|   152k|  } else {
  889|   152k|    pageNodeRef->copy(&pageNode);
  890|   152k|  }
  891|       |
  892|   162k|  if (pageNode.isDict()) {
  ------------------
  |  Branch (892:7): [True: 15.1k, False: 147k]
  ------------------
  893|  15.1k|    if (checkDictLookup(&pageNode, "Kids", &kids, touchedObjs)->isArray()) {
  ------------------
  |  Branch (893:9): [True: 3.00k, False: 12.1k]
  ------------------
  894|   178k|      for (i = 0; i < kids.arrayGetLength(); ++i) {
  ------------------
  |  Branch (894:19): [True: 175k, False: 3.00k]
  ------------------
  895|   175k|	readFileAttachmentAnnots(kids.arrayGetNF(i, &kid), touchedObjs);
  896|   175k|	kid.free();
  897|   175k|      }
  898|  12.1k|    } else {
  899|  12.1k|      if (checkDictLookup(&pageNode, "Annots",
  ------------------
  |  Branch (899:11): [True: 282, False: 11.8k]
  ------------------
  900|  12.1k|			  &annots, touchedObjs)->isArray()) {
  901|  20.7k|	for (i = 0; i < annots.arrayGetLength(); ++i) {
  ------------------
  |  Branch (901:14): [True: 20.4k, False: 282]
  ------------------
  902|  20.4k|	  if (checkArrayGet(&annots, i, &annot, touchedObjs)->isDict()) {
  ------------------
  |  Branch (902:8): [True: 1.93k, False: 18.5k]
  ------------------
  903|  1.93k|	    if (checkDictLookup(&annot, "Subtype", &subtype, touchedObjs)
  ------------------
  |  Branch (903:10): [True: 0, False: 1.93k]
  ------------------
  904|  1.93k|		  ->isName("FileAttachment")) {
  905|      0|	      if (checkDictLookup(&annot, "FS", &fileSpec, touchedObjs)) {
  ------------------
  |  Branch (905:12): [True: 0, False: 0]
  ------------------
  906|      0|		readEmbeddedFile(&fileSpec,
  907|      0|				 checkDictLookup(&annot, "Contents",
  908|      0|						 &contents, touchedObjs));
  909|      0|		contents.free();
  910|      0|	      }
  911|      0|	      fileSpec.free();
  912|      0|	    }
  913|  1.93k|	    subtype.free();
  914|  1.93k|	  }
  915|  20.4k|	  annot.free();
  916|  20.4k|	}
  917|    282|      }
  918|  12.1k|      annots.free();
  919|  12.1k|    }
  920|  15.1k|    kids.free();
  921|  15.1k|  }
  922|       |
  923|   162k|  pageNode.free();
  924|   162k|}
_ZN7Catalog16readEmbeddedFileEP6ObjectS1_:
  926|  9.12k|void Catalog::readEmbeddedFile(Object *fileSpec, Object *name1) {
  927|  9.12k|  Object name2, efObj, streamObj;
  928|  9.12k|  GString *s;
  929|  9.12k|  TextString *name;
  930|       |
  931|  9.12k|  if (fileSpec->isDict()) {
  ------------------
  |  Branch (931:7): [True: 403, False: 8.72k]
  ------------------
  932|    403|    if (fileSpec->dictLookup("UF", &name2)->isString()) {
  ------------------
  |  Branch (932:9): [True: 8, False: 395]
  ------------------
  933|      8|      name = new TextString(name2.getString());
  934|    395|    } else {
  935|    395|      name2.free();
  936|    395|      if (fileSpec->dictLookup("F", &name2)->isString()) {
  ------------------
  |  Branch (936:11): [True: 111, False: 284]
  ------------------
  937|    111|	name = new TextString(name2.getString());
  938|    284|      } else if (name1 && name1->isString()) {
  ------------------
  |  Branch (938:18): [True: 284, False: 0]
  |  Branch (938:27): [True: 3, False: 281]
  ------------------
  939|      3|	name = new TextString(name1->getString());
  940|    281|      } else {
  941|    281|	s = new GString("?");
  942|    281|	name = new TextString(s);
  943|    281|	delete s;
  944|    281|      }
  945|    395|    }
  946|    403|    name2.free();
  947|    403|    if (fileSpec->dictLookup("EF", &efObj)->isDict()) {
  ------------------
  |  Branch (947:9): [True: 192, False: 211]
  ------------------
  948|    192|      if (efObj.dictLookupNF("F", &streamObj)->isRef()) {
  ------------------
  |  Branch (948:11): [True: 115, False: 77]
  ------------------
  949|    115|	if (!embeddedFiles) {
  ------------------
  |  Branch (949:6): [True: 5, False: 110]
  ------------------
  950|      5|	  embeddedFiles = new GList();
  951|      5|	}
  952|    115|	embeddedFiles->append(new EmbeddedFile(name, &streamObj));
  953|    115|      } else {
  954|     77|	delete name;
  955|     77|      }
  956|    192|      streamObj.free();
  957|    211|    } else {
  958|    211|      delete name;
  959|    211|    }
  960|    403|    efObj.free();
  961|    403|  }
  962|  9.12k|}
_ZN7Catalog17readPageLabelTreeEP6Object:
  989|    136|void Catalog::readPageLabelTree(Object *root) {
  990|    136|  PageLabelNode *label0, *label1;
  991|    136|  char *touchedObjs;
  992|    136|  int i;
  993|       |
  994|    136|  touchedObjs = (char *)gmalloc(xref->getNumObjects());
  995|    136|  memset(touchedObjs, 0, xref->getNumObjects());
  996|    136|  pageLabels = new GList();
  997|    136|  readPageLabelTree2(root, touchedObjs);
  998|    136|  gfree(touchedObjs);
  999|       |
 1000|    136|  if (pageLabels->getLength() == 0) {
  ------------------
  |  Branch (1000:7): [True: 90, False: 46]
  ------------------
 1001|     90|    deleteGList(pageLabels, PageLabelNode);
  ------------------
  |  |   94|     90|  do {                                              \
  |  |   95|     90|    GList *_list = (list);                          \
  |  |   96|     90|    {                                               \
  |  |   97|     90|      int _i;                                       \
  |  |   98|     90|      for (_i = 0; _i < _list->getLength(); ++_i) { \
  |  |  ------------------
  |  |  |  Branch (98:20): [True: 0, False: 90]
  |  |  ------------------
  |  |   99|      0|        delete (T*)_list->get(_i);                  \
  |  |  100|      0|      }                                             \
  |  |  101|     90|      delete _list;                                 \
  |  |  102|     90|    }                                               \
  |  |  103|     90|  } while (0)
  |  |  ------------------
  |  |  |  Branch (103:12): [Folded, False: 90]
  |  |  ------------------
  ------------------
 1002|     90|    pageLabels = NULL;
 1003|     90|    return;
 1004|     90|  }
 1005|       |
 1006|       |  // set lastPage in each node
 1007|     46|  label0 = (PageLabelNode *)pageLabels->get(0);
 1008|    743|  for (i = 1; i < pageLabels->getLength(); ++i) {
  ------------------
  |  Branch (1008:15): [True: 697, False: 46]
  ------------------
 1009|    697|    label1 = (PageLabelNode *)pageLabels->get(i);
 1010|    697|    label0->lastPage = label1->firstPage - 1;
 1011|    697|    label0 = label1;
 1012|    697|  }
 1013|     46|  label0->lastPage = numPages;
 1014|     46|}
_ZN7Catalog18readPageLabelTree2EP6ObjectPc:
 1016|  51.4k|void Catalog::readPageLabelTree2(Object *nodeRef, char *touchedObjs) {
 1017|  51.4k|  Object node, nums, num, labelObj, kidsRef, kids, kid;
 1018|  51.4k|  int i;
 1019|       |
 1020|       |  // check for an object loop
 1021|  51.4k|  if (nodeRef->isRef()) {
  ------------------
  |  Branch (1021:7): [True: 2.79k, False: 48.6k]
  ------------------
 1022|  2.79k|    if (nodeRef->getRefNum() < 0 ||
  ------------------
  |  Branch (1022:9): [True: 0, False: 2.79k]
  ------------------
 1023|  2.79k|	nodeRef->getRefNum() >= xref->getNumObjects() ||
  ------------------
  |  Branch (1023:2): [True: 667, False: 2.12k]
  ------------------
 1024|  2.64k|	touchedObjs[nodeRef->getRefNum()]) {
  ------------------
  |  Branch (1024:2): [True: 1.97k, False: 154]
  ------------------
 1025|  2.64k|      return;
 1026|  2.64k|    }
 1027|    154|    touchedObjs[nodeRef->getRefNum()] = 1;
 1028|    154|    xref->fetch(nodeRef->getRefNum(), nodeRef->getRefGen(), &node);
 1029|  48.6k|  } else {
 1030|  48.6k|    nodeRef->copy(&node);
 1031|  48.6k|  }
 1032|       |
 1033|  48.8k|  if (!node.isDict()) {
  ------------------
  |  Branch (1033:7): [True: 45.8k, False: 2.99k]
  ------------------
 1034|  45.8k|    node.free();
 1035|  45.8k|    return;
 1036|  45.8k|  }
 1037|       |
 1038|  2.99k|  if (node.dictLookup("Nums", &nums)->isArray()) {
  ------------------
  |  Branch (1038:7): [True: 54, False: 2.94k]
  ------------------
 1039|  4.48k|    for (i = 0; i < nums.arrayGetLength() - 1; i += 2) {
  ------------------
  |  Branch (1039:17): [True: 4.43k, False: 54]
  ------------------
 1040|  4.43k|      if (nums.arrayGet(i, &num)->isInt()) {
  ------------------
  |  Branch (1040:11): [True: 1.90k, False: 2.53k]
  ------------------
 1041|  1.90k|	if (nums.arrayGet(i+1, &labelObj)->isDict()) {
  ------------------
  |  Branch (1041:6): [True: 743, False: 1.16k]
  ------------------
 1042|    743|	  pageLabels->append(new PageLabelNode(num.getInt(),
 1043|    743|					       labelObj.getDict()));
 1044|    743|	}
 1045|  1.90k|	labelObj.free();
 1046|  1.90k|      }
 1047|  4.43k|      num.free();
 1048|  4.43k|    }
 1049|     54|  }
 1050|  2.99k|  nums.free();
 1051|       |
 1052|       |  // check for an object loop in the Kids entry
 1053|  2.99k|  if (node.dictLookupNF("Kids", &kidsRef)->isRef()) {
  ------------------
  |  Branch (1053:7): [True: 138, False: 2.86k]
  ------------------
 1054|    138|    if (kidsRef.getRefNum() < 0 ||
  ------------------
  |  Branch (1054:9): [True: 0, False: 138]
  ------------------
 1055|    138|	kidsRef.getRefNum() >= doc->getXRef()->getNumObjects() ||
  ------------------
  |  Branch (1055:2): [True: 76, False: 62]
  ------------------
 1056|    133|	touchedObjs[kidsRef.getRefNum()]) {
  ------------------
  |  Branch (1056:2): [True: 57, False: 5]
  ------------------
 1057|    133|      kidsRef.free();
 1058|    133|      node.free();
 1059|    133|      return;
 1060|    133|    }
 1061|      5|    touchedObjs[kidsRef.getRefNum()] = 1;
 1062|      5|    kidsRef.fetch(doc->getXRef(), &kids);
 1063|  2.86k|  } else {
 1064|  2.86k|    kidsRef.copy(&kids);
 1065|  2.86k|  }
 1066|  2.86k|  kidsRef.free();
 1067|       |
 1068|  2.86k|  if (kids.isArray()) {
  ------------------
  |  Branch (1068:7): [True: 1.70k, False: 1.16k]
  ------------------
 1069|  53.0k|    for (i = 0; i < kids.arrayGetLength(); ++i) {
  ------------------
  |  Branch (1069:17): [True: 51.3k, False: 1.70k]
  ------------------
 1070|  51.3k|      kids.arrayGetNF(i, &kid);
 1071|  51.3k|      readPageLabelTree2(&kid, touchedObjs);
 1072|  51.3k|      kid.free();
 1073|  51.3k|    }
 1074|  1.70k|  }
 1075|  2.86k|  kids.free();
 1076|       |
 1077|  2.86k|  node.free();
 1078|  2.86k|}
_ZN7Catalog15checkDictLookupEP6ObjectPKcS1_Pc:
 1451|  33.9k|				 Object *element, char *touchedObjs) {
 1452|  33.9k|  Object refObj;
 1453|  33.9k|  dictObj->dictLookupNF(key, &refObj);
 1454|  33.9k|  if (refObj.isRef()) {
  ------------------
  |  Branch (1454:7): [True: 2.72k, False: 31.2k]
  ------------------
 1455|  2.72k|    int num = refObj.getRefNum();
 1456|  2.72k|    if (num >= 0 && num < xref->getNumObjects() && !touchedObjs[num]) {
  ------------------
  |  Branch (1456:9): [True: 2.72k, False: 0]
  |  Branch (1456:21): [True: 1.56k, False: 1.16k]
  |  Branch (1456:52): [True: 291, False: 1.27k]
  ------------------
 1457|    291|      touchedObjs[num] = 1;
 1458|    291|      xref->fetch(num, refObj.getRefGen(), element);
 1459|  2.43k|    } else {
 1460|  2.43k|      element->initNull();
 1461|  2.43k|    }
 1462|  2.72k|    refObj.free();
 1463|  31.2k|  } else {
 1464|  31.2k|    *element = refObj;
 1465|  31.2k|  }
 1466|  33.9k|  return element;
 1467|  33.9k|}
_ZN7Catalog13checkArrayGetEP6ObjectiS1_Pc:
 1470|  20.4k|			       Object *element, char *touchedObjs) {
 1471|  20.4k|  Object refObj;
 1472|  20.4k|  arrayObj->arrayGetNF(i, &refObj);
 1473|  20.4k|  if (refObj.isRef()) {
  ------------------
  |  Branch (1473:7): [True: 9.34k, False: 11.1k]
  ------------------
 1474|  9.34k|    int num = refObj.getRefNum();
 1475|  9.34k|    if (num >= 0 && num < xref->getNumObjects() && !touchedObjs[num]) {
  ------------------
  |  Branch (1475:9): [True: 9.34k, False: 0]
  |  Branch (1475:21): [True: 8.94k, False: 400]
  |  Branch (1475:52): [True: 7.71k, False: 1.23k]
  ------------------
 1476|  7.71k|      touchedObjs[num] = 1;
 1477|  7.71k|      xref->fetch(num, refObj.getRefGen(), element);
 1478|  7.71k|    } else {
 1479|  1.63k|      element->initNull();
 1480|  1.63k|    }
 1481|  9.34k|    refObj.free();
 1482|  11.1k|  } else {
 1483|  11.1k|    *element = refObj;
 1484|  11.1k|  }
 1485|  20.4k|  return element;
 1486|  20.4k|}

_ZN7Catalog4isOkEv:
   46|  2.58k|  GBool isOk() { return ok; }
_ZN7Catalog11getNumPagesEv:
   49|   649k|  int getNumPages() { return numPages; }
_ZN7Catalog10getOutlineEv:
   83|  2.33k|  Object *getOutline() { return &outline; }
_ZN7Catalog17getNeedsRenderingEv:
   89|  1.21k|  GBool getNeedsRendering() { return needsRendering; }
_ZN7Catalog15getOCPropertiesEv:
   91|  2.33k|  Object *getOCProperties() { return &ocProperties; }

_ZN22CharCodeToUnicodeCacheC2Ei:
  709|  9.40k|CharCodeToUnicodeCache::CharCodeToUnicodeCache(int sizeA) {
  710|  9.40k|  int i;
  711|       |
  712|  9.40k|  size = sizeA;
  713|  9.40k|  cache = (CharCodeToUnicode **)gmallocn(size, sizeof(CharCodeToUnicode *));
  714|  47.0k|  for (i = 0; i < size; ++i) {
  ------------------
  |  Branch (714:15): [True: 37.6k, False: 9.40k]
  ------------------
  715|       |    cache[i] = NULL;
  716|  37.6k|  }
  717|  9.40k|}
_ZN22CharCodeToUnicodeCacheD2Ev:
  719|  9.40k|CharCodeToUnicodeCache::~CharCodeToUnicodeCache() {
  720|  9.40k|  int i;
  721|       |
  722|  47.0k|  for (i = 0; i < size; ++i) {
  ------------------
  |  Branch (722:15): [True: 37.6k, False: 9.40k]
  ------------------
  723|  37.6k|    if (cache[i]) {
  ------------------
  |  Branch (723:9): [True: 0, False: 37.6k]
  ------------------
  724|      0|      cache[i]->decRefCnt();
  725|      0|    }
  726|  37.6k|  }
  727|  9.40k|  gfree(cache);
  728|  9.40k|}

_ZN7Decrypt11makeFileKeyEiiiP7GStringS1_S1_S1_iS1_S1_S1_PhiPi:
   40|    202|			   GBool *ownerPasswordOk) {
   41|    202|  DecryptAES256State state;
   42|    202|  Guchar test[127 + 56], test2[32];
   43|    202|  GString *userPassword2;
   44|    202|  const char *userPW;
   45|    202|  Guchar fState[256];
   46|    202|  Guchar tmpKey[16];
   47|    202|  Guchar fx, fy;
   48|    202|  int len, i, j;
   49|       |
   50|    202|  *ownerPasswordOk = gFalse;
  ------------------
  |  |   18|    202|#define gFalse 0
  ------------------
   51|       |
   52|    202|  if (encRevision == 5 || encRevision == 6) {
  ------------------
  |  Branch (52:7): [True: 0, False: 202]
  |  Branch (52:27): [True: 146, False: 56]
  ------------------
   53|       |
   54|       |    // check the owner password
   55|    146|    if (ownerPassword) {
  ------------------
  |  Branch (55:9): [True: 0, False: 146]
  ------------------
   56|       |      //~ this is supposed to convert the password to UTF-8 using "SASLprep"
   57|      0|      len = ownerPassword->getLength();
   58|      0|      if (len > 127) {
  ------------------
  |  Branch (58:11): [True: 0, False: 0]
  ------------------
   59|      0|	len = 127;
   60|      0|      }
   61|      0|      memcpy(test, ownerPassword->getCString(), len);
   62|      0|      memcpy(test + len, ownerKey->getCString() + 32, 8);
   63|      0|      memcpy(test + len + 8, userKey->getCString(), 48);
   64|      0|      sha256(test, len + 56, test);
   65|      0|      if (encRevision == 6) {
  ------------------
  |  Branch (65:11): [True: 0, False: 0]
  ------------------
   66|      0|	r6Hash(test, 32, ownerPassword->getCString(), len,
   67|      0|	       userKey->getCString());
   68|      0|      }
   69|      0|      if (!memcmp(test, ownerKey->getCString(), 32)) {
  ------------------
  |  Branch (69:11): [True: 0, False: 0]
  ------------------
   70|       |
   71|       |	// compute the file key from the owner password
   72|      0|	memcpy(test, ownerPassword->getCString(), len);
   73|      0|	memcpy(test + len, ownerKey->getCString() + 40, 8);
   74|      0|	memcpy(test + len + 8, userKey->getCString(), 48);
   75|      0|	sha256(test, len + 56, test);
   76|      0|	if (encRevision == 6) {
  ------------------
  |  Branch (76:6): [True: 0, False: 0]
  ------------------
   77|      0|	  r6Hash(test, 32, ownerPassword->getCString(), len,
   78|      0|		 userKey->getCString());
   79|      0|	}
   80|      0|	aes256KeyExpansion(&state, test, 32);
   81|      0|	for (i = 0; i < 16; ++i) {
  ------------------
  |  Branch (81:14): [True: 0, False: 0]
  ------------------
   82|      0|	  state.cbc[i] = 0;
   83|      0|	}
   84|      0|	aes256DecryptBlock(&state, (Guchar *)ownerEnc->getCString(), gFalse);
  ------------------
  |  |   18|      0|#define gFalse 0
  ------------------
   85|      0|	memcpy(fileKey, state.buf, 16);
   86|      0|	aes256DecryptBlock(&state, (Guchar *)ownerEnc->getCString() + 16,
   87|      0|			   gFalse);
  ------------------
  |  |   18|      0|#define gFalse 0
  ------------------
   88|      0|	memcpy(fileKey + 16, state.buf, 16);
   89|       |
   90|      0|	*ownerPasswordOk = gTrue;
  ------------------
  |  |   17|      0|#define gTrue 1
  ------------------
   91|      0|	return gTrue;
  ------------------
  |  |   17|      0|#define gTrue 1
  ------------------
   92|      0|      }
   93|      0|    }
   94|       |
   95|       |    // check the user password
   96|    146|    if (userPassword) {
  ------------------
  |  Branch (96:9): [True: 0, False: 146]
  ------------------
   97|       |      //~ this is supposed to convert the password to UTF-8 using "SASLprep"
   98|      0|      userPW = userPassword->getCString();
   99|      0|      len = userPassword->getLength();
  100|      0|      if (len > 127) {
  ------------------
  |  Branch (100:11): [True: 0, False: 0]
  ------------------
  101|      0|	len = 127;
  102|      0|      }
  103|    146|    } else {
  104|    146|      userPW = "";
  105|    146|      len = 0;
  106|    146|    }
  107|    146|    memcpy(test, userPW, len);
  108|    146|    memcpy(test + len, userKey->getCString() + 32, 8);
  109|    146|    sha256(test, len + 8, test);
  110|    146|    if (encRevision == 6) {
  ------------------
  |  Branch (110:9): [True: 146, False: 0]
  ------------------
  111|    146|      r6Hash(test, 32, userPW, len, NULL);
  112|    146|    }
  113|    146|    if (!memcmp(test, userKey->getCString(), 32)) {
  ------------------
  |  Branch (113:9): [True: 138, False: 8]
  ------------------
  114|       |
  115|       |      // compute the file key from the user password
  116|    138|      memcpy(test, userPW, len);
  117|    138|      memcpy(test + len, userKey->getCString() + 40, 8);
  118|    138|      sha256(test, len + 8, test);
  119|    138|      if (encRevision == 6) {
  ------------------
  |  Branch (119:11): [True: 138, False: 0]
  ------------------
  120|    138|	r6Hash(test, 32, userPW, len, NULL);
  121|    138|      }
  122|    138|      aes256KeyExpansion(&state, test, 32);
  123|  2.34k|      for (i = 0; i < 16; ++i) {
  ------------------
  |  Branch (123:19): [True: 2.20k, False: 138]
  ------------------
  124|  2.20k|	state.cbc[i] = 0;
  125|  2.20k|      }
  126|    138|      aes256DecryptBlock(&state, (Guchar *)userEnc->getCString(), gFalse);
  ------------------
  |  |   18|    138|#define gFalse 0
  ------------------
  127|    138|      memcpy(fileKey, state.buf, 16);
  128|    138|      aes256DecryptBlock(&state, (Guchar *)userEnc->getCString() + 16,
  129|    138|			 gFalse);
  ------------------
  |  |   18|    138|#define gFalse 0
  ------------------
  130|    138|      memcpy(fileKey + 16, state.buf, 16);
  131|       |
  132|    138|      return gTrue; 
  ------------------
  |  |   17|    138|#define gTrue 1
  ------------------
  133|    138|    }
  134|       |
  135|      8|    return gFalse;
  ------------------
  |  |   18|      8|#define gFalse 0
  ------------------
  136|       |
  137|    146|  } else {
  138|       |
  139|       |    // try using the supplied owner password to generate the user password
  140|     56|    if (ownerPassword) {
  ------------------
  |  Branch (140:9): [True: 0, False: 56]
  ------------------
  141|      0|      len = ownerPassword->getLength();
  142|      0|      if (len < 32) {
  ------------------
  |  Branch (142:11): [True: 0, False: 0]
  ------------------
  143|      0|	memcpy(test, ownerPassword->getCString(), len);
  144|      0|	memcpy(test + len, passwordPad, 32 - len);
  145|      0|      } else {
  146|      0|	memcpy(test, ownerPassword->getCString(), 32);
  147|      0|      }
  148|      0|      md5(test, 32, test);
  149|      0|      if (encRevision == 3) {
  ------------------
  |  Branch (149:11): [True: 0, False: 0]
  ------------------
  150|      0|	for (i = 0; i < 50; ++i) {
  ------------------
  |  Branch (150:14): [True: 0, False: 0]
  ------------------
  151|      0|	  md5(test, keyLength, test);
  152|      0|	}
  153|      0|      }
  154|      0|      if (encRevision == 2) {
  ------------------
  |  Branch (154:11): [True: 0, False: 0]
  ------------------
  155|      0|	rc4InitKey(test, keyLength, fState);
  156|      0|	fx = fy = 0;
  157|      0|	for (i = 0; i < 32; ++i) {
  ------------------
  |  Branch (157:14): [True: 0, False: 0]
  ------------------
  158|      0|	  test2[i] = rc4DecryptByte(fState, &fx, &fy, ownerKey->getChar(i));
  159|      0|	}
  160|      0|      } else {
  161|      0|	memcpy(test2, ownerKey->getCString(), 32);
  162|      0|	for (i = 19; i >= 0; --i) {
  ------------------
  |  Branch (162:15): [True: 0, False: 0]
  ------------------
  163|      0|	  for (j = 0; j < keyLength; ++j) {
  ------------------
  |  Branch (163:16): [True: 0, False: 0]
  ------------------
  164|      0|	    tmpKey[j] = (Guchar)(test[j] ^ i);
  165|      0|	  }
  166|      0|	  rc4InitKey(tmpKey, keyLength, fState);
  167|      0|	  fx = fy = 0;
  168|      0|	  for (j = 0; j < 32; ++j) {
  ------------------
  |  Branch (168:16): [True: 0, False: 0]
  ------------------
  169|      0|	    test2[j] = rc4DecryptByte(fState, &fx, &fy, test2[j]);
  170|      0|	  }
  171|      0|	}
  172|      0|      }
  173|      0|      userPassword2 = new GString((char *)test2, 32);
  174|      0|      if (makeFileKey2(encVersion, encRevision, keyLength, ownerKey, userKey,
  ------------------
  |  Branch (174:11): [True: 0, False: 0]
  ------------------
  175|      0|		       permissions, fileID, userPassword2, fileKey,
  176|      0|		       encryptMetadata)) {
  177|      0|	*ownerPasswordOk = gTrue;
  ------------------
  |  |   17|      0|#define gTrue 1
  ------------------
  178|      0|	delete userPassword2;
  179|      0|	return gTrue;
  ------------------
  |  |   17|      0|#define gTrue 1
  ------------------
  180|      0|      }
  181|      0|      delete userPassword2;
  182|      0|    }
  183|       |
  184|       |    // try using the supplied user password
  185|     56|    return makeFileKey2(encVersion, encRevision, keyLength, ownerKey, userKey,
  186|     56|			permissions, fileID, userPassword, fileKey,
  187|     56|			encryptMetadata);
  188|     56|  }
  189|    202|}
_ZN7Decrypt6r6HashEPhiPKciPc:
  192|    284|		     char *userKey) {
  193|    284|  Guchar key1[64*(127+64+48)];
  194|    284|  DecryptAESState state128;
  195|    284|  int n, i, j, k;
  196|       |
  197|    284|  i = 0;
  198|  19.8k|  while (1) {
  ------------------
  |  Branch (198:10): [True: 19.8k, Folded]
  ------------------
  199|  19.8k|    memcpy(key1, pwd, pwdLen);
  200|  19.8k|    memcpy(key1 + pwdLen, key, keyLen);
  201|  19.8k|    n = pwdLen + keyLen;
  202|  19.8k|    if (userKey) {
  ------------------
  |  Branch (202:9): [True: 0, False: 19.8k]
  ------------------
  203|      0|      memcpy(key1 + pwdLen + keyLen, userKey, 48);
  204|      0|      n += 48;
  205|      0|    }
  206|  1.26M|    for (j = 1; j < 64; ++j) {
  ------------------
  |  Branch (206:17): [True: 1.24M, False: 19.8k]
  ------------------
  207|  1.24M|      memcpy(key1 + j * n, key1, n);
  208|  1.24M|    }
  209|  19.8k|    n *= 64;
  210|  19.8k|    aesKeyExpansion(&state128, key, 16, gFalse);
  ------------------
  |  |   18|  19.8k|#define gFalse 0
  ------------------
  211|   336k|    for (j = 0; j < 16; ++j) {
  ------------------
  |  Branch (211:17): [True: 316k, False: 19.8k]
  ------------------
  212|   316k|      state128.cbc[j] = key[16+j];
  213|   316k|    }
  214|  3.80M|    for (j = 0; j < n; j += 16) {
  ------------------
  |  Branch (214:17): [True: 3.78M, False: 19.8k]
  ------------------
  215|  3.78M|      aesEncryptBlock(&state128, key1 + j);
  216|  3.78M|      memcpy(key1 + j, state128.buf, 16);
  217|  3.78M|    }
  218|  19.8k|    k = 0;
  219|   336k|    for (j = 0; j < 16; ++j) {
  ------------------
  |  Branch (219:17): [True: 316k, False: 19.8k]
  ------------------
  220|   316k|      k += key1[j] % 3;
  221|   316k|    }
  222|  19.8k|    k %= 3;
  223|  19.8k|    switch (k) {
  ------------------
  |  Branch (223:13): [True: 19.8k, False: 0]
  ------------------
  224|  6.39k|    case 0:
  ------------------
  |  Branch (224:5): [True: 6.39k, False: 13.4k]
  ------------------
  225|  6.39k|      sha256(key1, n, key);
  226|  6.39k|      keyLen = 32;
  227|  6.39k|      break;
  228|  6.94k|    case 1:
  ------------------
  |  Branch (228:5): [True: 6.94k, False: 12.8k]
  ------------------
  229|  6.94k|      sha384(key1, n, key);
  230|  6.94k|      keyLen = 48;
  231|  6.94k|      break;
  232|  6.47k|    case 2:
  ------------------
  |  Branch (232:5): [True: 6.47k, False: 13.3k]
  ------------------
  233|  6.47k|      sha512(key1, n, key);
  234|  6.47k|      keyLen = 64;
  235|  6.47k|      break;
  236|  19.8k|    }
  237|       |    // from the spec, it appears that i should be incremented after
  238|       |    // the test, but that doesn't match what Adobe does
  239|  19.8k|    ++i;
  240|  19.8k|    if (i >= 64 && key1[n - 1] <= i - 32) {
  ------------------
  |  Branch (240:9): [True: 1.91k, False: 17.8k]
  |  Branch (240:20): [True: 284, False: 1.63k]
  ------------------
  241|    284|      break;
  242|    284|    }
  243|  19.8k|  }
  244|    284|}
_ZN7Decrypt12makeFileKey2EiiiP7GStringS1_iS1_S1_Phi:
  250|     56|			    GBool encryptMetadata) {
  251|     56|  Guchar *buf;
  252|     56|  Guchar test[32];
  253|     56|  Guchar fState[256];
  254|     56|  Guchar tmpKey[16];
  255|     56|  Guchar fx, fy;
  256|     56|  int len, i, j;
  257|     56|  GBool ok;
  258|       |
  259|       |  // generate file key
  260|     56|  buf = (Guchar *)gmalloc(72 + fileID->getLength());
  261|     56|  if (userPassword) {
  ------------------
  |  Branch (261:7): [True: 0, False: 56]
  ------------------
  262|      0|    len = userPassword->getLength();
  263|      0|    if (len < 32) {
  ------------------
  |  Branch (263:9): [True: 0, False: 0]
  ------------------
  264|      0|      memcpy(buf, userPassword->getCString(), len);
  265|      0|      memcpy(buf + len, passwordPad, 32 - len);
  266|      0|    } else {
  267|      0|      memcpy(buf, userPassword->getCString(), 32);
  268|      0|    }
  269|     56|  } else {
  270|     56|    memcpy(buf, passwordPad, 32);
  271|     56|  }
  272|     56|  memcpy(buf + 32, ownerKey->getCString(), 32);
  273|     56|  buf[64] = (Guchar)(permissions & 0xff);
  274|     56|  buf[65] = (Guchar)((permissions >> 8) & 0xff);
  275|     56|  buf[66] = (Guchar)((permissions >> 16) & 0xff);
  276|     56|  buf[67] = (Guchar)((permissions >> 24) & 0xff);
  277|     56|  memcpy(buf + 68, fileID->getCString(), fileID->getLength());
  278|     56|  len = 68 + fileID->getLength();
  279|     56|  if (!encryptMetadata) {
  ------------------
  |  Branch (279:7): [True: 0, False: 56]
  ------------------
  280|      0|    buf[len++] = 0xff;
  281|      0|    buf[len++] = 0xff;
  282|      0|    buf[len++] = 0xff;
  283|      0|    buf[len++] = 0xff;
  284|      0|  }
  285|     56|  md5(buf, len, fileKey);
  286|     56|  if (encRevision == 3) {
  ------------------
  |  Branch (286:7): [True: 56, False: 0]
  ------------------
  287|  2.85k|    for (i = 0; i < 50; ++i) {
  ------------------
  |  Branch (287:17): [True: 2.80k, False: 56]
  ------------------
  288|  2.80k|      md5(fileKey, keyLength, fileKey);
  289|  2.80k|    }
  290|     56|  }
  291|       |
  292|       |  // test user password
  293|     56|  if (encRevision == 2) {
  ------------------
  |  Branch (293:7): [True: 0, False: 56]
  ------------------
  294|      0|    rc4InitKey(fileKey, keyLength, fState);
  295|      0|    fx = fy = 0;
  296|      0|    for (i = 0; i < 32; ++i) {
  ------------------
  |  Branch (296:17): [True: 0, False: 0]
  ------------------
  297|      0|      test[i] = rc4DecryptByte(fState, &fx, &fy, userKey->getChar(i));
  298|      0|    }
  299|      0|    ok = memcmp(test, passwordPad, 32) == 0;
  300|     56|  } else if (encRevision == 3) {
  ------------------
  |  Branch (300:14): [True: 56, False: 0]
  ------------------
  301|     56|    memcpy(test, userKey->getCString(), 32);
  302|  1.17k|    for (i = 19; i >= 0; --i) {
  ------------------
  |  Branch (302:18): [True: 1.12k, False: 56]
  ------------------
  303|  17.1k|      for (j = 0; j < keyLength; ++j) {
  ------------------
  |  Branch (303:19): [True: 16.0k, False: 1.12k]
  ------------------
  304|  16.0k|	tmpKey[j] = (Guchar)(fileKey[j] ^ i);
  305|  16.0k|      }
  306|  1.12k|      rc4InitKey(tmpKey, keyLength, fState);
  307|  1.12k|      fx = fy = 0;
  308|  36.9k|      for (j = 0; j < 32; ++j) {
  ------------------
  |  Branch (308:19): [True: 35.8k, False: 1.12k]
  ------------------
  309|  35.8k|	test[j] = rc4DecryptByte(fState, &fx, &fy, test[j]);
  310|  35.8k|      }
  311|  1.12k|    }
  312|     56|    memcpy(buf, passwordPad, 32);
  313|     56|    memcpy(buf + 32, fileID->getCString(), fileID->getLength());
  314|     56|    md5(buf, 32 + fileID->getLength(), buf);
  315|     56|    ok = memcmp(test, buf, 16) == 0;
  316|     56|  } else {
  317|      0|    ok = gFalse;
  ------------------
  |  |   18|      0|#define gFalse 0
  ------------------
  318|      0|  }
  319|       |
  320|     56|  gfree(buf);
  321|     56|  return ok;
  322|     56|}
_ZN13DecryptStreamC2EP6StreamPh14CryptAlgorithmiii:
  331|  39.1k|  FilterStream(strA)
  332|  39.1k|{
  333|  39.1k|  int i;
  334|       |
  335|  39.1k|  memcpy(fileKey, fileKeyA, keyLengthA);
  336|  39.1k|  algo = algoA;
  337|  39.1k|  keyLength = keyLengthA;
  338|  39.1k|  objNum = objNumA;
  339|  39.1k|  objGen = objGenA;
  340|       |
  341|       |  // construct object key
  342|   837k|  for (i = 0; i < keyLength; ++i) {
  ------------------
  |  Branch (342:15): [True: 798k, False: 39.1k]
  ------------------
  343|   798k|    objKey[i] = fileKey[i];
  344|   798k|  }
  345|  39.1k|  switch (algo) {
  ------------------
  |  Branch (345:11): [True: 39.1k, False: 0]
  ------------------
  346|  8.63k|  case cryptRC4:
  ------------------
  |  Branch (346:3): [True: 8.63k, False: 30.4k]
  ------------------
  347|  8.63k|    objKey[keyLength] = (Guchar)(objNum & 0xff);
  348|  8.63k|    objKey[keyLength + 1] = (Guchar)((objNum >> 8) & 0xff);
  349|  8.63k|    objKey[keyLength + 2] = (Guchar)((objNum >> 16) & 0xff);
  350|  8.63k|    objKey[keyLength + 3] = (Guchar)(objGen & 0xff);
  351|  8.63k|    objKey[keyLength + 4] = (Guchar)((objGen >> 8) & 0xff);
  352|  8.63k|    md5(objKey, keyLength + 5, objKey);
  353|  8.63k|    if ((objKeyLength = keyLength + 5) > 16) {
  ------------------
  |  Branch (353:9): [True: 1.04k, False: 7.58k]
  ------------------
  354|  1.04k|      objKeyLength = 16;
  355|  1.04k|    }
  356|  8.63k|    break;
  357|  14.5k|  case cryptAES:
  ------------------
  |  Branch (357:3): [True: 14.5k, False: 24.5k]
  ------------------
  358|  14.5k|    objKey[keyLength] = (Guchar)(objNum & 0xff);
  359|  14.5k|    objKey[keyLength + 1] = (Guchar)((objNum >> 8) & 0xff);
  360|  14.5k|    objKey[keyLength + 2] = (Guchar)((objNum >> 16) & 0xff);
  361|  14.5k|    objKey[keyLength + 3] = (Guchar)(objGen & 0xff);
  362|  14.5k|    objKey[keyLength + 4] = (Guchar)((objGen >> 8) & 0xff);
  363|  14.5k|    objKey[keyLength + 5] = 0x73; // 's'
  364|  14.5k|    objKey[keyLength + 6] = 0x41; // 'A'
  365|  14.5k|    objKey[keyLength + 7] = 0x6c; // 'l'
  366|  14.5k|    objKey[keyLength + 8] = 0x54; // 'T'
  367|  14.5k|    md5(objKey, keyLength + 9, objKey);
  368|  14.5k|    if ((objKeyLength = keyLength + 5) > 16) {
  ------------------
  |  Branch (368:9): [True: 14.5k, False: 0]
  ------------------
  369|  14.5k|      objKeyLength = 16;
  370|  14.5k|    }
  371|  14.5k|    break;
  372|  15.8k|  case cryptAES256:
  ------------------
  |  Branch (372:3): [True: 15.8k, False: 23.2k]
  ------------------
  373|  15.8k|    objKeyLength = keyLength;
  374|  15.8k|    break;
  375|  39.1k|  }
  376|  39.1k|}
_ZN13DecryptStreamD2Ev:
  378|  38.3k|DecryptStream::~DecryptStream() {
  379|  38.3k|  delete str;
  380|  38.3k|}
_ZN13DecryptStream4copyEv:
  382|    800|Stream *DecryptStream::copy() {
  383|    800|  return new DecryptStream(str->copy(), fileKey, algo, keyLength,
  384|    800|			   objNum, objGen);
  385|    800|}
_ZN13DecryptStream5resetEv:
  387|  28.1k|void DecryptStream::reset() {
  388|  28.1k|  str->reset();
  389|  28.1k|  switch (algo) {
  ------------------
  |  Branch (389:11): [True: 28.1k, False: 0]
  ------------------
  390|  6.58k|  case cryptRC4:
  ------------------
  |  Branch (390:3): [True: 6.58k, False: 21.6k]
  ------------------
  391|  6.58k|    state.rc4.x = state.rc4.y = 0;
  392|  6.58k|    rc4InitKey(objKey, objKeyLength, state.rc4.state);
  393|  6.58k|    state.rc4.buf = EOF;
  394|  6.58k|    break;
  395|  11.5k|  case cryptAES:
  ------------------
  |  Branch (395:3): [True: 11.5k, False: 16.6k]
  ------------------
  396|  11.5k|    aesKeyExpansion(&state.aes, objKey, objKeyLength, gTrue);
  ------------------
  |  |   17|  11.5k|#define gTrue 1
  ------------------
  397|  11.5k|    str->getBlock((char *)state.aes.cbc, 16);
  398|  11.5k|    state.aes.bufIdx = 16;
  399|  11.5k|    break;
  400|  10.0k|  case cryptAES256:
  ------------------
  |  Branch (400:3): [True: 10.0k, False: 18.1k]
  ------------------
  401|  10.0k|    aes256KeyExpansion(&state.aes256, objKey, objKeyLength);
  402|  10.0k|    str->getBlock((char *)state.aes256.cbc, 16);
  403|  10.0k|    state.aes256.bufIdx = 16;
  404|  10.0k|    break;
  405|  28.1k|  }
  406|  28.1k|}
_ZN13DecryptStream7getCharEv:
  408|  1.37M|int DecryptStream::getChar() {
  409|  1.37M|  Guchar in[16];
  410|  1.37M|  int c;
  411|       |
  412|  1.37M|  c = EOF; // make gcc happy
  413|  1.37M|  switch (algo) {
  ------------------
  |  Branch (413:11): [True: 1.37M, False: 0]
  ------------------
  414|   368k|  case cryptRC4:
  ------------------
  |  Branch (414:3): [True: 368k, False: 1.00M]
  ------------------
  415|   368k|    if (state.rc4.buf == EOF) {
  ------------------
  |  Branch (415:9): [True: 368k, False: 497]
  ------------------
  416|   368k|      c = str->getChar();
  417|   368k|      if (c != EOF) {
  ------------------
  |  Branch (417:11): [True: 361k, False: 6.50k]
  ------------------
  418|   361k|	state.rc4.buf = rc4DecryptByte(state.rc4.state, &state.rc4.x,
  419|   361k|				       &state.rc4.y, (Guchar)c);
  420|   361k|      }
  421|   368k|    }
  422|   368k|    c = state.rc4.buf;
  423|   368k|    state.rc4.buf = EOF;
  424|   368k|    break;
  425|   286k|  case cryptAES:
  ------------------
  |  Branch (425:3): [True: 286k, False: 1.09M]
  ------------------
  426|   286k|    if (state.aes.bufIdx == 16) {
  ------------------
  |  Branch (426:9): [True: 28.7k, False: 257k]
  ------------------
  427|  28.7k|      if (str->getBlock((char *)in, 16) != 16) {
  ------------------
  |  Branch (427:11): [True: 10.5k, False: 18.2k]
  ------------------
  428|  10.5k|	return EOF;
  429|  10.5k|      }
  430|  18.2k|      aesDecryptBlock(&state.aes, in, str->lookChar() == EOF);
  431|  18.2k|    }
  432|   275k|    if (state.aes.bufIdx == 16) {
  ------------------
  |  Branch (432:9): [True: 966, False: 274k]
  ------------------
  433|    966|      c = EOF;
  434|   274k|    } else {
  435|   274k|      c = state.aes.buf[state.aes.bufIdx++];
  436|   274k|    }
  437|   275k|    break;
  438|   722k|  case cryptAES256:
  ------------------
  |  Branch (438:3): [True: 722k, False: 655k]
  ------------------
  439|   722k|    if (state.aes256.bufIdx == 16) {
  ------------------
  |  Branch (439:9): [True: 55.3k, False: 667k]
  ------------------
  440|  55.3k|      if (str->getBlock((char *)in, 16) != 16) {
  ------------------
  |  Branch (440:11): [True: 8.64k, False: 46.6k]
  ------------------
  441|  8.64k|	return EOF;
  442|  8.64k|      }
  443|  46.6k|      aes256DecryptBlock(&state.aes256, in, str->lookChar() == EOF);
  444|  46.6k|    }
  445|   714k|    if (state.aes256.bufIdx == 16) {
  ------------------
  |  Branch (445:9): [True: 1.26k, False: 712k]
  ------------------
  446|  1.26k|      c = EOF;
  447|   712k|    } else {
  448|   712k|      c = state.aes256.buf[state.aes256.bufIdx++];
  449|   712k|    }
  450|   714k|    break;
  451|  1.37M|  }
  452|  1.35M|  return c;
  453|  1.37M|}
_ZN13DecryptStream8lookCharEv:
  455|  2.90k|int DecryptStream::lookChar() {
  456|  2.90k|  Guchar in[16];
  457|  2.90k|  int c;
  458|       |
  459|  2.90k|  c = EOF; // make gcc happy
  460|  2.90k|  switch (algo) {
  ------------------
  |  Branch (460:11): [True: 2.90k, False: 0]
  ------------------
  461|    523|  case cryptRC4:
  ------------------
  |  Branch (461:3): [True: 523, False: 2.37k]
  ------------------
  462|    523|    if (state.rc4.buf == EOF) {
  ------------------
  |  Branch (462:9): [True: 505, False: 18]
  ------------------
  463|    505|      c = str->getChar();
  464|    505|      if (c != EOF) {
  ------------------
  |  Branch (464:11): [True: 501, False: 4]
  ------------------
  465|    501|	state.rc4.buf = rc4DecryptByte(state.rc4.state, &state.rc4.x,
  466|    501|				       &state.rc4.y, (Guchar)c);
  467|    501|      }
  468|    505|    }
  469|    523|    c = state.rc4.buf;
  470|    523|    break;
  471|    936|  case cryptAES:
  ------------------
  |  Branch (471:3): [True: 936, False: 1.96k]
  ------------------
  472|    936|    if (state.aes.bufIdx == 16) {
  ------------------
  |  Branch (472:9): [True: 59, False: 877]
  ------------------
  473|     59|      if (str->getBlock((char *)in, 16) != 16) {
  ------------------
  |  Branch (473:11): [True: 0, False: 59]
  ------------------
  474|      0|	return EOF;
  475|      0|      }
  476|     59|      aesDecryptBlock(&state.aes, in, str->lookChar() == EOF);
  477|     59|    }
  478|    936|    if (state.aes.bufIdx == 16) {
  ------------------
  |  Branch (478:9): [True: 0, False: 936]
  ------------------
  479|      0|      c = EOF;
  480|    936|    } else {
  481|    936|      c = state.aes.buf[state.aes.bufIdx];
  482|    936|    }
  483|    936|    break;
  484|  1.44k|  case cryptAES256:
  ------------------
  |  Branch (484:3): [True: 1.44k, False: 1.45k]
  ------------------
  485|  1.44k|    if (state.aes256.bufIdx == 16) {
  ------------------
  |  Branch (485:9): [True: 94, False: 1.34k]
  ------------------
  486|     94|      if (str->getBlock((char *)in, 16) != 16) {
  ------------------
  |  Branch (486:11): [True: 4, False: 90]
  ------------------
  487|      4|	return EOF;
  488|      4|      }
  489|     90|      aes256DecryptBlock(&state.aes256, in, str->lookChar() == EOF);
  490|     90|    }
  491|  1.43k|    if (state.aes256.bufIdx == 16) {
  ------------------
  |  Branch (491:9): [True: 10, False: 1.42k]
  ------------------
  492|     10|      c = EOF;
  493|  1.42k|    } else {
  494|  1.42k|      c = state.aes256.buf[state.aes256.bufIdx];
  495|  1.42k|    }
  496|  1.43k|    break;
  497|  2.90k|  }
  498|  2.89k|  return c;
  499|  2.90k|}
_Z10rc4InitKeyPhiS_:
  509|  7.70k|void rc4InitKey(Guchar *key, int keyLen, Guchar *state) {
  510|  7.70k|  Guchar index1, index2;
  511|  7.70k|  Guchar t;
  512|  7.70k|  int i;
  513|       |
  514|  1.98M|  for (i = 0; i < 256; ++i)
  ------------------
  |  Branch (514:15): [True: 1.97M, False: 7.70k]
  ------------------
  515|  1.97M|    state[i] = (Guchar)i;
  516|  7.70k|  index1 = index2 = 0;
  517|  1.98M|  for (i = 0; i < 256; ++i) {
  ------------------
  |  Branch (517:15): [True: 1.97M, False: 7.70k]
  ------------------
  518|  1.97M|    index2 = (Guchar)(key[index1] + state[i] + index2);
  519|  1.97M|    t = state[i];
  520|  1.97M|    state[i] = state[index2];
  521|  1.97M|    state[index2] = t;
  522|  1.97M|    index1 = (Guchar)((index1 + 1) % keyLen);
  523|  1.97M|  }
  524|  7.70k|}
_Z14rc4DecryptBytePhS_S_h:
  526|   398k|Guchar rc4DecryptByte(Guchar *state, Guchar *x, Guchar *y, Guchar c) {
  527|   398k|  Guchar x1, y1, tx, ty;
  528|       |
  529|   398k|  x1 = *x = (Guchar)(*x + 1);
  530|   398k|  y1 = *y = (Guchar)(state[*x] + *y);
  531|   398k|  tx = state[x1];
  532|   398k|  ty = state[y1];
  533|   398k|  state[x1] = ty;
  534|   398k|  state[y1] = tx;
  535|   398k|  return c ^ state[(tx + ty) % 256];
  536|   398k|}
_Z15aesKeyExpansionP15DecryptAESStatePhii:
  784|  31.3k|		     GBool decrypt) {
  785|  31.3k|  Guint temp;
  786|  31.3k|  int i, round;
  787|       |
  788|       |  //~ this assumes objKeyLen == 16
  789|       |
  790|   156k|  for (i = 0; i < 4; ++i) {
  ------------------
  |  Branch (790:15): [True: 125k, False: 31.3k]
  ------------------
  791|   125k|    s->w[i] = (objKey[4*i] << 24) + (objKey[4*i+1] << 16) +
  792|   125k|              (objKey[4*i+2] << 8) + objKey[4*i+3];
  793|   125k|  }
  794|  1.28M|  for (i = 4; i < 44; ++i) {
  ------------------
  |  Branch (794:15): [True: 1.25M, False: 31.3k]
  ------------------
  795|  1.25M|    temp = s->w[i-1];
  796|  1.25M|    if (!(i & 3)) {
  ------------------
  |  Branch (796:9): [True: 313k, False: 940k]
  ------------------
  797|   313k|      temp = subWord(rotWord(temp)) ^ rcon[i/4];
  798|   313k|    }
  799|  1.25M|    s->w[i] = s->w[i-4] ^ temp;
  800|  1.25M|  }
  801|  31.3k|  if (decrypt) {
  ------------------
  |  Branch (801:7): [True: 11.5k, False: 19.8k]
  ------------------
  802|   115k|    for (round = 1; round <= 9; ++round) {
  ------------------
  |  Branch (802:21): [True: 103k, False: 11.5k]
  ------------------
  803|   103k|      invMixColumnsW(&s->w[round * 4]);
  804|   103k|    }
  805|  11.5k|  }
  806|  31.3k|}
_Z15aesEncryptBlockP15DecryptAESStatePh:
  808|  3.78M|void aesEncryptBlock(DecryptAESState *s, Guchar *in) {
  809|  3.78M|  int c, round;
  810|       |
  811|       |  // initial state + CBC
  812|  18.9M|  for (c = 0; c < 4; ++c) {
  ------------------
  |  Branch (812:15): [True: 15.1M, False: 3.78M]
  ------------------
  813|  15.1M|    s->state[c] = in[4*c] ^ s->cbc[4*c];
  814|  15.1M|    s->state[4+c] = in[4*c+1] ^ s->cbc[4*c+1];
  815|  15.1M|    s->state[8+c] = in[4*c+2] ^ s->cbc[4*c+2];
  816|  15.1M|    s->state[12+c] = in[4*c+3] ^ s->cbc[4*c+3];
  817|  15.1M|  }
  818|       |
  819|       |  // round 0
  820|  3.78M|  addRoundKey(s->state, &s->w[0]);
  821|       |
  822|       |  // rounds 1 .. 9
  823|  37.8M|  for (round = 1; round <= 9; ++round) {
  ------------------
  |  Branch (823:19): [True: 34.0M, False: 3.78M]
  ------------------
  824|  34.0M|    subBytes(s->state);
  825|  34.0M|    shiftRows(s->state);
  826|  34.0M|    mixColumns(s->state);
  827|  34.0M|    addRoundKey(s->state, &s->w[round * 4]);
  828|  34.0M|  }
  829|       |
  830|       |  // round 10
  831|  3.78M|  subBytes(s->state);
  832|  3.78M|  shiftRows(s->state);
  833|  3.78M|  addRoundKey(s->state, &s->w[10 * 4]);
  834|       |
  835|       |  // output + save for next CBC
  836|  18.9M|  for (c = 0; c < 4; ++c) {
  ------------------
  |  Branch (836:15): [True: 15.1M, False: 3.78M]
  ------------------
  837|  15.1M|    s->buf[4*c] = s->cbc[4*c] = s->state[c];
  838|  15.1M|    s->buf[4*c+1] = s->cbc[4*c+1] = s->state[4+c];
  839|  15.1M|    s->buf[4*c+2] = s->cbc[4*c+2] = s->state[8+c];
  840|  15.1M|    s->buf[4*c+3] = s->cbc[4*c+3] = s->state[12+c];
  841|  15.1M|  }
  842|  3.78M|}
_Z15aesDecryptBlockP15DecryptAESStatePhi:
  844|  18.3k|void aesDecryptBlock(DecryptAESState *s, Guchar *in, GBool last) {
  845|  18.3k|  int c, round, n, i;
  846|       |
  847|       |  // initial state
  848|  91.5k|  for (c = 0; c < 4; ++c) {
  ------------------
  |  Branch (848:15): [True: 73.2k, False: 18.3k]
  ------------------
  849|  73.2k|    s->state[c] = in[4*c];
  850|  73.2k|    s->state[4+c] = in[4*c+1];
  851|  73.2k|    s->state[8+c] = in[4*c+2];
  852|  73.2k|    s->state[12+c] = in[4*c+3];
  853|  73.2k|  }
  854|       |
  855|       |  // round 0
  856|  18.3k|  addRoundKey(s->state, &s->w[10 * 4]);
  857|       |
  858|       |  // rounds 1-9
  859|   183k|  for (round = 9; round >= 1; --round) {
  ------------------
  |  Branch (859:19): [True: 164k, False: 18.3k]
  ------------------
  860|   164k|    invSubBytes(s->state);
  861|   164k|    invShiftRows(s->state);
  862|   164k|    invMixColumns(s->state);
  863|   164k|    addRoundKey(s->state, &s->w[round * 4]);
  864|   164k|  }
  865|       |
  866|       |  // round 10
  867|  18.3k|  invSubBytes(s->state);
  868|  18.3k|  invShiftRows(s->state);
  869|  18.3k|  addRoundKey(s->state, &s->w[0]);
  870|       |
  871|       |  // CBC
  872|  91.5k|  for (c = 0; c < 4; ++c) {
  ------------------
  |  Branch (872:15): [True: 73.2k, False: 18.3k]
  ------------------
  873|  73.2k|    s->buf[4*c] = s->state[c] ^ s->cbc[4*c];
  874|  73.2k|    s->buf[4*c+1] = s->state[4+c] ^ s->cbc[4*c+1];
  875|  73.2k|    s->buf[4*c+2] = s->state[8+c] ^ s->cbc[4*c+2];
  876|  73.2k|    s->buf[4*c+3] = s->state[12+c] ^ s->cbc[4*c+3];
  877|  73.2k|  }
  878|       |
  879|       |  // save the input block for the next CBC
  880|   311k|  for (i = 0; i < 16; ++i) {
  ------------------
  |  Branch (880:15): [True: 293k, False: 18.3k]
  ------------------
  881|   293k|    s->cbc[i] = in[i];
  882|   293k|  }
  883|       |
  884|       |  // remove padding
  885|  18.3k|  s->bufIdx = 0;
  886|  18.3k|  if (last) {
  ------------------
  |  Branch (886:7): [True: 1.36k, False: 16.9k]
  ------------------
  887|  1.36k|    n = s->buf[15];
  888|  1.36k|    if (n < 1 || n > 16) { // this should never happen
  ------------------
  |  Branch (888:9): [True: 0, False: 1.36k]
  |  Branch (888:18): [True: 963, False: 397]
  ------------------
  889|    963|      n = 16;
  890|    963|    }
  891|  5.36k|    for (i = 15; i >= n; --i) {
  ------------------
  |  Branch (891:18): [True: 4.00k, False: 1.36k]
  ------------------
  892|  4.00k|      s->buf[i] = s->buf[i-n];
  893|  4.00k|    }
  894|  1.36k|    s->bufIdx = n;
  895|  1.36k|  }
  896|  18.3k|}
_Z8md5StartP8MD5State:
 1011|  26.1k|void md5Start(MD5State *state) {
 1012|  26.1k|  state->a = 0x67452301;
 1013|  26.1k|  state->b = 0xefcdab89;
 1014|  26.1k|  state->c = 0x98badcfe;
 1015|  26.1k|  state->d = 0x10325476;
 1016|  26.1k|  state->bufLen = 0;
 1017|  26.1k|  state->msgLen = 0;
 1018|  26.1k|}
_Z9md5AppendP8MD5StatePhi:
 1116|  26.1k|void md5Append(MD5State *state, Guchar *data, int dataLen) {
 1117|  26.1k|  Guchar *p;
 1118|  26.1k|  int remain, k;
 1119|       |
 1120|  26.1k|  p = data;
 1121|  26.1k|  remain = dataLen;
 1122|  28.5k|  while (state->bufLen + remain >= 64) {
  ------------------
  |  Branch (1122:10): [True: 2.37k, False: 26.1k]
  ------------------
 1123|  2.37k|    k = 64 - state->bufLen;
 1124|  2.37k|    memcpy(state->buf + state->bufLen, p, k);
 1125|  2.37k|    state->bufLen = 64;
 1126|  2.37k|    md5ProcessBlock(state);
 1127|  2.37k|    p += k;
 1128|  2.37k|    remain -= k;
 1129|  2.37k|  }
 1130|  26.1k|  if (remain > 0) {
  ------------------
  |  Branch (1130:7): [True: 26.1k, False: 1]
  ------------------
 1131|  26.1k|    memcpy(state->buf + state->bufLen, p, remain);
 1132|  26.1k|    state->bufLen += remain;
 1133|  26.1k|  }
 1134|  26.1k|  state->msgLen += dataLen;
 1135|  26.1k|}
_Z9md5FinishP8MD5State:
 1137|  26.1k|void md5Finish(MD5State *state) {
 1138|       |  // padding and length
 1139|  26.1k|  state->buf[state->bufLen++] = 0x80;
 1140|  26.1k|  if (state->bufLen > 56) {
  ------------------
  |  Branch (1140:7): [True: 3, False: 26.1k]
  ------------------
 1141|      6|    while (state->bufLen < 64) {
  ------------------
  |  Branch (1141:12): [True: 3, False: 3]
  ------------------
 1142|      3|      state->buf[state->bufLen++] = 0x00;
 1143|      3|    }
 1144|      3|    md5ProcessBlock(state);
 1145|      3|  }      
 1146|   955k|  while (state->bufLen < 56) {
  ------------------
  |  Branch (1146:10): [True: 929k, False: 26.1k]
  ------------------
 1147|   929k|    state->buf[state->bufLen++] = 0x00;
 1148|   929k|  }
 1149|  26.1k|  state->buf[56] = (Guchar)(state->msgLen << 3);
 1150|  26.1k|  state->buf[57] = (Guchar)(state->msgLen >> 5);
 1151|  26.1k|  state->buf[58] = (Guchar)(state->msgLen >> 13);
 1152|  26.1k|  state->buf[59] = (Guchar)(state->msgLen >> 21);
 1153|  26.1k|  state->buf[60] = (Guchar)(state->msgLen >> 29);
 1154|  26.1k|  state->buf[61] = (Guchar)0;
 1155|  26.1k|  state->buf[62] = (Guchar)0;
 1156|  26.1k|  state->buf[63] = (Guchar)0;
 1157|  26.1k|  state->bufLen = 64;
 1158|  26.1k|  md5ProcessBlock(state);
 1159|       |
 1160|       |  // break digest into bytes
 1161|  26.1k|  state->digest[0] = (Guchar)state->a;
 1162|  26.1k|  state->digest[1] = (Guchar)(state->a >> 8);
 1163|  26.1k|  state->digest[2] = (Guchar)(state->a >> 16);
 1164|  26.1k|  state->digest[3] = (Guchar)(state->a >> 24);
 1165|  26.1k|  state->digest[4] = (Guchar)state->b;
 1166|  26.1k|  state->digest[5] = (Guchar)(state->b >> 8);
 1167|  26.1k|  state->digest[6] = (Guchar)(state->b >> 16);
 1168|  26.1k|  state->digest[7] = (Guchar)(state->b >> 24);
 1169|  26.1k|  state->digest[8] = (Guchar)state->c;
 1170|  26.1k|  state->digest[9] = (Guchar)(state->c >> 8);
 1171|  26.1k|  state->digest[10] = (Guchar)(state->c >> 16);
 1172|  26.1k|  state->digest[11] = (Guchar)(state->c >> 24);
 1173|  26.1k|  state->digest[12] = (Guchar)state->d;
 1174|  26.1k|  state->digest[13] = (Guchar)(state->d >> 8);
 1175|  26.1k|  state->digest[14] = (Guchar)(state->d >> 16);
 1176|  26.1k|  state->digest[15] = (Guchar)(state->d >> 24);
 1177|  26.1k|}
_Z3md5PhiS_:
 1179|  26.1k|void md5(Guchar *msg, int msgLen, Guchar *digest) {
 1180|  26.1k|  MD5State state;
 1181|  26.1k|  int i;
 1182|       |
 1183|  26.1k|  if (msgLen < 0) {
  ------------------
  |  Branch (1183:7): [True: 0, False: 26.1k]
  ------------------
 1184|      0|    return;
 1185|      0|  }
 1186|  26.1k|  md5Start(&state);
 1187|  26.1k|  md5Append(&state, msg, msgLen);
 1188|  26.1k|  md5Finish(&state);
 1189|   444k|  for (i = 0; i < 16; ++i) {
  ------------------
  |  Branch (1189:15): [True: 418k, False: 26.1k]
  ------------------
 1190|   418k|    digest[i] = state.digest[i];
 1191|   418k|  }
 1192|  26.1k|}
Decrypt.cc:_ZL7subWordj:
  594|   446k|static inline Guint subWord(Guint x) {
  595|   446k|  return (sbox[x >> 24] << 24)
  596|   446k|         | (sbox[(x >> 16) & 0xff] << 16)
  597|   446k|         | (sbox[(x >> 8) & 0xff] << 8)
  598|   446k|         | sbox[x & 0xff];
  599|   446k|}
Decrypt.cc:_ZL7rotWordj:
  601|   384k|static inline Guint rotWord(Guint x) {
  602|   384k|  return ((x << 8) & 0xffffffff) | (x >> 24);
  603|   384k|}
Decrypt.cc:_ZL14invMixColumnsWPj:
  755|   236k|static inline void invMixColumnsW(Guint *w) {
  756|   236k|  int c;
  757|   236k|  Guchar s0, s1, s2, s3;
  758|       |
  759|  1.18M|  for (c = 0; c < 4; ++c) {
  ------------------
  |  Branch (759:15): [True: 945k, False: 236k]
  ------------------
  760|   945k|    s0 = (Guchar)(w[c] >> 24);
  761|   945k|    s1 = (Guchar)(w[c] >> 16);
  762|   945k|    s2 = (Guchar)(w[c] >> 8);
  763|   945k|    s3 = (Guchar)w[c];
  764|   945k|    w[c] = ((mul0e(s0) ^ mul0b(s1) ^ mul0d(s2) ^ mul09(s3)) << 24)
  765|   945k|           | ((mul09(s0) ^ mul0e(s1) ^ mul0b(s2) ^ mul0d(s3)) << 16)
  766|   945k|           | ((mul0d(s0) ^ mul09(s1) ^ mul0e(s2) ^ mul0b(s3)) << 8)
  767|   945k|           | (mul0b(s0) ^ mul0d(s1) ^ mul09(s2) ^ mul0e(s3));
  768|   945k|  }
  769|   236k|}
Decrypt.cc:_ZL5mul0eh:
  714|  16.2M|static inline Guchar mul0e(Guchar s) {
  715|  16.2M|  Guchar s2, s4, s8;
  716|       |
  717|  16.2M|  s2 = (Guchar)((s & 0x80) ? ((s << 1) ^ 0x1b) : (s << 1));
  ------------------
  |  Branch (717:17): [True: 8.20M, False: 8.00M]
  ------------------
  718|  16.2M|  s4 = (Guchar)((s2 & 0x80) ? ((s2 << 1) ^ 0x1b) : (s2 << 1));
  ------------------
  |  Branch (718:17): [True: 8.21M, False: 7.99M]
  ------------------
  719|  16.2M|  s8 = (Guchar)((s4 & 0x80) ? ((s4 << 1) ^ 0x1b) : (s4 << 1));
  ------------------
  |  Branch (719:17): [True: 8.11M, False: 8.09M]
  ------------------
  720|  16.2M|  return s2 ^ s4 ^ s8;
  721|  16.2M|}
Decrypt.cc:_ZL5mul0bh:
  694|  16.2M|static inline Guchar mul0b(Guchar s) {
  695|  16.2M|  Guchar s2, s4, s8;
  696|       |
  697|  16.2M|  s2 = (Guchar)((s & 0x80) ? ((s << 1) ^ 0x1b) : (s << 1));
  ------------------
  |  Branch (697:17): [True: 8.20M, False: 8.00M]
  ------------------
  698|  16.2M|  s4 = (Guchar)((s2 & 0x80) ? ((s2 << 1) ^ 0x1b) : (s2 << 1));
  ------------------
  |  Branch (698:17): [True: 8.21M, False: 7.99M]
  ------------------
  699|  16.2M|  s8 = (Guchar)((s4 & 0x80) ? ((s4 << 1) ^ 0x1b) : (s4 << 1));
  ------------------
  |  Branch (699:17): [True: 8.11M, False: 8.09M]
  ------------------
  700|  16.2M|  return s ^ s2 ^ s8;
  701|  16.2M|}
Decrypt.cc:_ZL5mul0dh:
  704|  16.2M|static inline Guchar mul0d(Guchar s) {
  705|  16.2M|  Guchar s2, s4, s8;
  706|       |
  707|  16.2M|  s2 = (Guchar)((s & 0x80) ? ((s << 1) ^ 0x1b) : (s << 1));
  ------------------
  |  Branch (707:17): [True: 8.20M, False: 8.00M]
  ------------------
  708|  16.2M|  s4 = (Guchar)((s2 & 0x80) ? ((s2 << 1) ^ 0x1b) : (s2 << 1));
  ------------------
  |  Branch (708:17): [True: 8.21M, False: 7.99M]
  ------------------
  709|  16.2M|  s8 = (Guchar)((s4 & 0x80) ? ((s4 << 1) ^ 0x1b) : (s4 << 1));
  ------------------
  |  Branch (709:17): [True: 8.11M, False: 8.09M]
  ------------------
  710|  16.2M|  return s ^ s4 ^ s8;
  711|  16.2M|}
Decrypt.cc:_ZL5mul09h:
  684|  16.2M|static inline Guchar mul09(Guchar s) {
  685|  16.2M|  Guchar s2, s4, s8;
  686|       |
  687|  16.2M|  s2 = (Guchar)((s & 0x80) ? ((s << 1) ^ 0x1b) : (s << 1));
  ------------------
  |  Branch (687:17): [True: 8.20M, False: 8.00M]
  ------------------
  688|  16.2M|  s4 = (Guchar)((s2 & 0x80) ? ((s2 << 1) ^ 0x1b) : (s2 << 1));
  ------------------
  |  Branch (688:17): [True: 8.21M, False: 7.99M]
  ------------------
  689|  16.2M|  s8 = (Guchar)((s4 & 0x80) ? ((s4 << 1) ^ 0x1b) : (s4 << 1));
  ------------------
  |  Branch (689:17): [True: 8.11M, False: 8.09M]
  ------------------
  690|  16.2M|  return s ^ s8;
  691|  16.2M|}
Decrypt.cc:_ZL11addRoundKeyPhPj:
  771|  42.5M|static inline void addRoundKey(Guchar *state, Guint *w) {
  772|  42.5M|  int c;
  773|       |
  774|   212M|  for (c = 0; c < 4; ++c) {
  ------------------
  |  Branch (774:15): [True: 170M, False: 42.5M]
  ------------------
  775|   170M|    state[c] ^= (Guchar)(w[c] >> 24);
  776|   170M|    state[4+c] ^= (Guchar)(w[c] >> 16);
  777|   170M|    state[8+c] ^= (Guchar)(w[c] >> 8);
  778|   170M|    state[12+c] ^= (Guchar)w[c];
  779|   170M|  }
  780|  42.5M|}
Decrypt.cc:_ZL8subBytesPh:
  605|  37.8M|static inline void subBytes(Guchar *state) {
  606|  37.8M|  int i;
  607|       |
  608|   643M|  for (i = 0; i < 16; ++i) {
  ------------------
  |  Branch (608:15): [True: 605M, False: 37.8M]
  ------------------
  609|   605M|    state[i] = sbox[state[i]];
  610|   605M|  }
  611|  37.8M|}
Decrypt.cc:_ZL9shiftRowsPh:
  621|  37.8M|static inline void shiftRows(Guchar *state) {
  622|  37.8M|  Guchar t;
  623|       |
  624|  37.8M|  t = state[4];
  625|  37.8M|  state[4] = state[5];
  626|  37.8M|  state[5] = state[6];
  627|  37.8M|  state[6] = state[7];
  628|  37.8M|  state[7] = t;
  629|       |
  630|  37.8M|  t = state[8];
  631|  37.8M|  state[8] = state[10];
  632|  37.8M|  state[10] = t;
  633|  37.8M|  t = state[9];
  634|  37.8M|  state[9] = state[11];
  635|  37.8M|  state[11] = t;
  636|       |
  637|  37.8M|  t = state[15];
  638|  37.8M|  state[15] = state[14];
  639|  37.8M|  state[14] = state[13];
  640|  37.8M|  state[13] = state[12];
  641|  37.8M|  state[12] = t;
  642|  37.8M|}
Decrypt.cc:_ZL10mixColumnsPh:
  723|  34.0M|static inline void mixColumns(Guchar *state) {
  724|  34.0M|  int c;
  725|  34.0M|  Guchar s0, s1, s2, s3;
  726|       |
  727|   170M|  for (c = 0; c < 4; ++c) {
  ------------------
  |  Branch (727:15): [True: 136M, False: 34.0M]
  ------------------
  728|   136M|    s0 = state[c];
  729|   136M|    s1 = state[4+c];
  730|   136M|    s2 = state[8+c];
  731|   136M|    s3 = state[12+c];
  732|   136M|    state[c] =    mul02(s0) ^ mul03(s1) ^       s2  ^       s3;
  733|   136M|    state[4+c] =        s0  ^ mul02(s1) ^ mul03(s2) ^       s3;
  734|   136M|    state[8+c] =        s0  ^       s1  ^ mul02(s2) ^ mul03(s3);
  735|   136M|    state[12+c] = mul03(s0) ^       s1  ^       s2  ^ mul02(s3);
  736|   136M|  }
  737|  34.0M|}
Decrypt.cc:_ZL5mul02h:
  668|   545M|static inline Guchar mul02(Guchar s) {
  669|   545M|  Guchar s2;
  670|       |
  671|   545M|  s2 = (Guchar)((s & 0x80) ? ((s << 1) ^ 0x1b) : (s << 1));
  ------------------
  |  Branch (671:17): [True: 272M, False: 272M]
  ------------------
  672|   545M|  return s2;
  673|   545M|}
Decrypt.cc:_ZL5mul03h:
  676|   545M|static inline Guchar mul03(Guchar s) {
  677|   545M|  Guchar s2;
  678|       |
  679|   545M|  s2 = (Guchar)((s & 0x80) ? ((s << 1) ^ 0x1b) : (s << 1));
  ------------------
  |  Branch (679:17): [True: 272M, False: 272M]
  ------------------
  680|   545M|  return s ^ s2;
  681|   545M|}
Decrypt.cc:_ZL11invSubBytesPh:
  613|   841k|static inline void invSubBytes(Guchar *state) {
  614|   841k|  int i;
  615|       |
  616|  14.3M|  for (i = 0; i < 16; ++i) {
  ------------------
  |  Branch (616:15): [True: 13.4M, False: 841k]
  ------------------
  617|  13.4M|    state[i] = invSbox[state[i]];
  618|  13.4M|  }
  619|   841k|}
Decrypt.cc:_ZL12invShiftRowsPh:
  644|   841k|static inline void invShiftRows(Guchar *state) {
  645|   841k|  Guchar t;
  646|       |
  647|   841k|  t = state[7];
  648|   841k|  state[7] = state[6];
  649|   841k|  state[6] = state[5];
  650|   841k|  state[5] = state[4];
  651|   841k|  state[4] = t;
  652|       |
  653|   841k|  t = state[8];
  654|   841k|  state[8] = state[10];
  655|   841k|  state[10] = t;
  656|   841k|  t = state[9];
  657|   841k|  state[9] = state[11];
  658|   841k|  state[11] = t;
  659|       |
  660|   841k|  t = state[12];
  661|   841k|  state[12] = state[13];
  662|   841k|  state[13] = state[14];
  663|   841k|  state[14] = state[15];
  664|   841k|  state[15] = t;
  665|   841k|}
Decrypt.cc:_ZL13invMixColumnsPh:
  739|   776k|static inline void invMixColumns(Guchar *state) {
  740|   776k|  int c;
  741|   776k|  Guchar s0, s1, s2, s3;
  742|       |
  743|  3.88M|  for (c = 0; c < 4; ++c) {
  ------------------
  |  Branch (743:15): [True: 3.10M, False: 776k]
  ------------------
  744|  3.10M|    s0 = state[c];
  745|  3.10M|    s1 = state[4+c];
  746|  3.10M|    s2 = state[8+c];
  747|  3.10M|    s3 = state[12+c];
  748|  3.10M|    state[c] =    mul0e(s0) ^ mul0b(s1) ^ mul0d(s2) ^ mul09(s3);
  749|  3.10M|    state[4+c] =  mul09(s0) ^ mul0e(s1) ^ mul0b(s2) ^ mul0d(s3);
  750|  3.10M|    state[8+c] =  mul0d(s0) ^ mul09(s1) ^ mul0e(s2) ^ mul0b(s3);
  751|  3.10M|    state[12+c] = mul0b(s0) ^ mul0d(s1) ^ mul09(s2) ^ mul0e(s3);
  752|  3.10M|  }
  753|   776k|}
Decrypt.cc:_ZL18aes256KeyExpansionP18DecryptAES256StatePhi:
  903|  10.1k|			       Guchar *objKey, int objKeyLen) {
  904|  10.1k|  Guint temp;
  905|  10.1k|  int i, round;
  906|       |
  907|       |  //~ this assumes objKeyLen == 32
  908|       |
  909|  91.6k|  for (i = 0; i < 8; ++i) {
  ------------------
  |  Branch (909:15): [True: 81.5k, False: 10.1k]
  ------------------
  910|  81.5k|    s->w[i] = (objKey[4*i] << 24) + (objKey[4*i+1] << 16) +
  911|  81.5k|              (objKey[4*i+2] << 8) + objKey[4*i+3];
  912|  81.5k|  }
  913|   539k|  for (i = 8; i < 60; ++i) {
  ------------------
  |  Branch (913:15): [True: 529k, False: 10.1k]
  ------------------
  914|   529k|    temp = s->w[i-1];
  915|   529k|    if ((i & 7) == 0) {
  ------------------
  |  Branch (915:9): [True: 71.3k, False: 458k]
  ------------------
  916|  71.3k|      temp = subWord(rotWord(temp)) ^ rcon[i/8];
  917|   458k|    } else if ((i & 7) == 4) {
  ------------------
  |  Branch (917:16): [True: 61.1k, False: 397k]
  ------------------
  918|  61.1k|      temp = subWord(temp);
  919|  61.1k|    }
  920|   529k|    s->w[i] = s->w[i-8] ^ temp;
  921|   529k|  }
  922|   142k|  for (round = 1; round <= 13; ++round) {
  ------------------
  |  Branch (922:19): [True: 132k, False: 10.1k]
  ------------------
  923|   132k|    invMixColumnsW(&s->w[round * 4]);
  924|   132k|  }
  925|  10.1k|}
Decrypt.cc:_ZL18aes256DecryptBlockP18DecryptAES256StatePhi:
  927|  47.0k|static void aes256DecryptBlock(DecryptAES256State *s, Guchar *in, GBool last) {
  928|  47.0k|  int c, round, n, i;
  929|       |
  930|       |  // initial state
  931|   235k|  for (c = 0; c < 4; ++c) {
  ------------------
  |  Branch (931:15): [True: 188k, False: 47.0k]
  ------------------
  932|   188k|    s->state[c] = in[4*c];
  933|   188k|    s->state[4+c] = in[4*c+1];
  934|   188k|    s->state[8+c] = in[4*c+2];
  935|   188k|    s->state[12+c] = in[4*c+3];
  936|   188k|  }
  937|       |
  938|       |  // round 0
  939|  47.0k|  addRoundKey(s->state, &s->w[14 * 4]);
  940|       |
  941|       |  // rounds 13-1
  942|   658k|  for (round = 13; round >= 1; --round) {
  ------------------
  |  Branch (942:20): [True: 611k, False: 47.0k]
  ------------------
  943|   611k|    invSubBytes(s->state);
  944|   611k|    invShiftRows(s->state);
  945|   611k|    invMixColumns(s->state);
  946|   611k|    addRoundKey(s->state, &s->w[round * 4]);
  947|   611k|  }
  948|       |
  949|       |  // round 14
  950|  47.0k|  invSubBytes(s->state);
  951|  47.0k|  invShiftRows(s->state);
  952|  47.0k|  addRoundKey(s->state, &s->w[0]);
  953|       |
  954|       |  // CBC
  955|   235k|  for (c = 0; c < 4; ++c) {
  ------------------
  |  Branch (955:15): [True: 188k, False: 47.0k]
  ------------------
  956|   188k|    s->buf[4*c] = s->state[c] ^ s->cbc[4*c];
  957|   188k|    s->buf[4*c+1] = s->state[4+c] ^ s->cbc[4*c+1];
  958|   188k|    s->buf[4*c+2] = s->state[8+c] ^ s->cbc[4*c+2];
  959|   188k|    s->buf[4*c+3] = s->state[12+c] ^ s->cbc[4*c+3];
  960|   188k|  }
  961|       |
  962|       |  // save the input block for the next CBC
  963|   799k|  for (i = 0; i < 16; ++i) {
  ------------------
  |  Branch (963:15): [True: 752k, False: 47.0k]
  ------------------
  964|   752k|    s->cbc[i] = in[i];
  965|   752k|  }
  966|       |
  967|       |  // remove padding
  968|  47.0k|  s->bufIdx = 0;
  969|  47.0k|  if (last) {
  ------------------
  |  Branch (969:7): [True: 2.55k, False: 44.4k]
  ------------------
  970|  2.55k|    n = s->buf[15];
  971|  2.55k|    if (n < 1 || n > 16) { // this should never happen
  ------------------
  |  Branch (971:9): [True: 0, False: 2.55k]
  |  Branch (971:18): [True: 1.27k, False: 1.27k]
  ------------------
  972|  1.27k|      n = 16;
  973|  1.27k|    }
  974|  8.75k|    for (i = 15; i >= n; --i) {
  ------------------
  |  Branch (974:18): [True: 6.19k, False: 2.55k]
  ------------------
  975|  6.19k|      s->buf[i] = s->buf[i-n];
  976|  6.19k|    }
  977|  2.55k|    s->bufIdx = n;
  978|  2.55k|  }
  979|  47.0k|}
Decrypt.cc:_ZL15md5ProcessBlockP8MD5State:
 1020|  28.5k|static void md5ProcessBlock(MD5State *state) {
 1021|  28.5k|  Gulong x[16];
 1022|  28.5k|  Gulong a, b, c, d;
 1023|  28.5k|  int i;
 1024|       |
 1025|   484k|  for (i = 0; i < 16; ++i) {
  ------------------
  |  Branch (1025:15): [True: 456k, False: 28.5k]
  ------------------
 1026|   456k|    x[i] = state->buf[4*i] | (state->buf[4*i+1] << 8) |
 1027|   456k|           (state->buf[4*i+2] << 16) | (state->buf[4*i+3] << 24);
 1028|   456k|  }
 1029|       |
 1030|  28.5k|  a = state->a;
 1031|  28.5k|  b = state->b;
 1032|  28.5k|  c = state->c;
 1033|  28.5k|  d = state->d;
 1034|       |
 1035|       |  // round 1
 1036|  28.5k|  a = md5Round1(a, b, c, d, x[0],   7, 0xd76aa478);
 1037|  28.5k|  d = md5Round1(d, a, b, c, x[1],  12, 0xe8c7b756);
 1038|  28.5k|  c = md5Round1(c, d, a, b, x[2],  17, 0x242070db);
 1039|  28.5k|  b = md5Round1(b, c, d, a, x[3],  22, 0xc1bdceee);
 1040|  28.5k|  a = md5Round1(a, b, c, d, x[4],   7, 0xf57c0faf);
 1041|  28.5k|  d = md5Round1(d, a, b, c, x[5],  12, 0x4787c62a);
 1042|  28.5k|  c = md5Round1(c, d, a, b, x[6],  17, 0xa8304613);
 1043|  28.5k|  b = md5Round1(b, c, d, a, x[7],  22, 0xfd469501);
 1044|  28.5k|  a = md5Round1(a, b, c, d, x[8],   7, 0x698098d8);
 1045|  28.5k|  d = md5Round1(d, a, b, c, x[9],  12, 0x8b44f7af);
 1046|  28.5k|  c = md5Round1(c, d, a, b, x[10], 17, 0xffff5bb1);
 1047|  28.5k|  b = md5Round1(b, c, d, a, x[11], 22, 0x895cd7be);
 1048|  28.5k|  a = md5Round1(a, b, c, d, x[12],  7, 0x6b901122);
 1049|  28.5k|  d = md5Round1(d, a, b, c, x[13], 12, 0xfd987193);
 1050|  28.5k|  c = md5Round1(c, d, a, b, x[14], 17, 0xa679438e);
 1051|  28.5k|  b = md5Round1(b, c, d, a, x[15], 22, 0x49b40821);
 1052|       |
 1053|       |  // round 2
 1054|  28.5k|  a = md5Round2(a, b, c, d, x[1],   5, 0xf61e2562);
 1055|  28.5k|  d = md5Round2(d, a, b, c, x[6],   9, 0xc040b340);
 1056|  28.5k|  c = md5Round2(c, d, a, b, x[11], 14, 0x265e5a51);
 1057|  28.5k|  b = md5Round2(b, c, d, a, x[0],  20, 0xe9b6c7aa);
 1058|  28.5k|  a = md5Round2(a, b, c, d, x[5],   5, 0xd62f105d);
 1059|  28.5k|  d = md5Round2(d, a, b, c, x[10],  9, 0x02441453);
 1060|  28.5k|  c = md5Round2(c, d, a, b, x[15], 14, 0xd8a1e681);
 1061|  28.5k|  b = md5Round2(b, c, d, a, x[4],  20, 0xe7d3fbc8);
 1062|  28.5k|  a = md5Round2(a, b, c, d, x[9],   5, 0x21e1cde6);
 1063|  28.5k|  d = md5Round2(d, a, b, c, x[14],  9, 0xc33707d6);
 1064|  28.5k|  c = md5Round2(c, d, a, b, x[3],  14, 0xf4d50d87);
 1065|  28.5k|  b = md5Round2(b, c, d, a, x[8],  20, 0x455a14ed);
 1066|  28.5k|  a = md5Round2(a, b, c, d, x[13],  5, 0xa9e3e905);
 1067|  28.5k|  d = md5Round2(d, a, b, c, x[2],   9, 0xfcefa3f8);
 1068|  28.5k|  c = md5Round2(c, d, a, b, x[7],  14, 0x676f02d9);
 1069|  28.5k|  b = md5Round2(b, c, d, a, x[12], 20, 0x8d2a4c8a);
 1070|       |
 1071|       |  // round 3
 1072|  28.5k|  a = md5Round3(a, b, c, d, x[5],   4, 0xfffa3942);
 1073|  28.5k|  d = md5Round3(d, a, b, c, x[8],  11, 0x8771f681);
 1074|  28.5k|  c = md5Round3(c, d, a, b, x[11], 16, 0x6d9d6122);
 1075|  28.5k|  b = md5Round3(b, c, d, a, x[14], 23, 0xfde5380c);
 1076|  28.5k|  a = md5Round3(a, b, c, d, x[1],   4, 0xa4beea44);
 1077|  28.5k|  d = md5Round3(d, a, b, c, x[4],  11, 0x4bdecfa9);
 1078|  28.5k|  c = md5Round3(c, d, a, b, x[7],  16, 0xf6bb4b60);
 1079|  28.5k|  b = md5Round3(b, c, d, a, x[10], 23, 0xbebfbc70);
 1080|  28.5k|  a = md5Round3(a, b, c, d, x[13],  4, 0x289b7ec6);
 1081|  28.5k|  d = md5Round3(d, a, b, c, x[0],  11, 0xeaa127fa);
 1082|  28.5k|  c = md5Round3(c, d, a, b, x[3],  16, 0xd4ef3085);
 1083|  28.5k|  b = md5Round3(b, c, d, a, x[6],  23, 0x04881d05);
 1084|  28.5k|  a = md5Round3(a, b, c, d, x[9],   4, 0xd9d4d039);
 1085|  28.5k|  d = md5Round3(d, a, b, c, x[12], 11, 0xe6db99e5);
 1086|  28.5k|  c = md5Round3(c, d, a, b, x[15], 16, 0x1fa27cf8);
 1087|  28.5k|  b = md5Round3(b, c, d, a, x[2],  23, 0xc4ac5665);
 1088|       |
 1089|       |  // round 4
 1090|  28.5k|  a = md5Round4(a, b, c, d, x[0],   6, 0xf4292244);
 1091|  28.5k|  d = md5Round4(d, a, b, c, x[7],  10, 0x432aff97);
 1092|  28.5k|  c = md5Round4(c, d, a, b, x[14], 15, 0xab9423a7);
 1093|  28.5k|  b = md5Round4(b, c, d, a, x[5],  21, 0xfc93a039);
 1094|  28.5k|  a = md5Round4(a, b, c, d, x[12],  6, 0x655b59c3);
 1095|  28.5k|  d = md5Round4(d, a, b, c, x[3],  10, 0x8f0ccc92);
 1096|  28.5k|  c = md5Round4(c, d, a, b, x[10], 15, 0xffeff47d);
 1097|  28.5k|  b = md5Round4(b, c, d, a, x[1],  21, 0x85845dd1);
 1098|  28.5k|  a = md5Round4(a, b, c, d, x[8],   6, 0x6fa87e4f);
 1099|  28.5k|  d = md5Round4(d, a, b, c, x[15], 10, 0xfe2ce6e0);
 1100|  28.5k|  c = md5Round4(c, d, a, b, x[6],  15, 0xa3014314);
 1101|  28.5k|  b = md5Round4(b, c, d, a, x[13], 21, 0x4e0811a1);
 1102|  28.5k|  a = md5Round4(a, b, c, d, x[4],   6, 0xf7537e82);
 1103|  28.5k|  d = md5Round4(d, a, b, c, x[11], 10, 0xbd3af235);
 1104|  28.5k|  c = md5Round4(c, d, a, b, x[2],  15, 0x2ad7d2bb);
 1105|  28.5k|  b = md5Round4(b, c, d, a, x[9],  21, 0xeb86d391);
 1106|       |
 1107|       |  // increment a, b, c, d
 1108|  28.5k|  state->a += a;
 1109|  28.5k|  state->b += b;
 1110|  28.5k|  state->c += c;
 1111|  28.5k|  state->d += d;
 1112|       |
 1113|  28.5k|  state->bufLen = 0;
 1114|  28.5k|}
Decrypt.cc:_ZL9md5Round1mmmmmim:
  992|   456k|			       Gulong Xk, int s, Gulong Ti) {
  993|   456k|  return b + rotateLeft((a + ((b & c) | (~b & d)) + Xk + Ti), s);
  994|   456k|}
Decrypt.cc:_ZL10rotateLeftmi:
  986|  1.82M|static inline Gulong rotateLeft(Gulong x, int r) {
  987|  1.82M|  x &= 0xffffffff;
  988|  1.82M|  return ((x << r) | (x >> (32 - r))) & 0xffffffff;
  989|  1.82M|}
Decrypt.cc:_ZL9md5Round2mmmmmim:
  997|   456k|			       Gulong Xk, int s, Gulong Ti) {
  998|   456k|  return b + rotateLeft((a + ((b & d) | (c & ~d)) + Xk + Ti), s);
  999|   456k|}
Decrypt.cc:_ZL9md5Round3mmmmmim:
 1002|   456k|			       Gulong Xk, int s, Gulong Ti) {
 1003|   456k|  return b + rotateLeft((a + (b ^ c ^ d) + Xk + Ti), s);
 1004|   456k|}
Decrypt.cc:_ZL9md5Round4mmmmmim:
 1007|   456k|			       Gulong Xk, int s, Gulong Ti) {
 1008|   456k|  return b + rotateLeft((a + (c ^ (b | ~d)) + Xk + Ti), s);
 1009|   456k|}
Decrypt.cc:_ZL6sha256PhiS_:
 1297|  6.67k|static void sha256(Guchar *msg, int msgLen, Guchar *hash) {
 1298|  6.67k|  Guchar blk[64];
 1299|  6.67k|  Guint H[8];
 1300|  6.67k|  int blkLen, i;
 1301|       |
 1302|  6.67k|  H[0] = 0x6a09e667;
 1303|  6.67k|  H[1] = 0xbb67ae85;
 1304|  6.67k|  H[2] = 0x3c6ef372;
 1305|  6.67k|  H[3] = 0xa54ff53a;
 1306|  6.67k|  H[4] = 0x510e527f;
 1307|  6.67k|  H[5] = 0x9b05688c;
 1308|  6.67k|  H[6] = 0x1f83d9ab;
 1309|  6.67k|  H[7] = 0x5be0cd19;
 1310|       |
 1311|  6.67k|  blkLen = 0;
 1312|   304k|  for (i = 0; i + 64 <= msgLen; i += 64) {
  ------------------
  |  Branch (1312:15): [True: 297k, False: 6.67k]
  ------------------
 1313|   297k|    sha256HashBlock(msg + i, H);
 1314|   297k|  }
 1315|  6.67k|  blkLen = msgLen - i;
 1316|  6.67k|  if (blkLen > 0) {
  ------------------
  |  Branch (1316:7): [True: 284, False: 6.39k]
  ------------------
 1317|    284|    memcpy(blk, msg + i, blkLen);
 1318|    284|  }
 1319|       |
 1320|       |  // pad the message
 1321|  6.67k|  blk[blkLen++] = 0x80;
 1322|  6.67k|  if (blkLen > 56) {
  ------------------
  |  Branch (1322:7): [True: 0, False: 6.67k]
  ------------------
 1323|      0|    while (blkLen < 64) {
  ------------------
  |  Branch (1323:12): [True: 0, False: 0]
  ------------------
 1324|      0|      blk[blkLen++] = 0;
 1325|      0|    }
 1326|      0|    sha256HashBlock(blk, H);
 1327|      0|    blkLen = 0;
 1328|      0|  }
 1329|   371k|  while (blkLen < 56) {
  ------------------
  |  Branch (1329:10): [True: 364k, False: 6.67k]
  ------------------
 1330|   364k|    blk[blkLen++] = 0;
 1331|   364k|  }
 1332|  6.67k|  blk[56] = 0;
 1333|  6.67k|  blk[57] = 0;
 1334|  6.67k|  blk[58] = 0;
 1335|  6.67k|  blk[59] = 0;
 1336|  6.67k|  blk[60] = (Guchar)(msgLen >> 21);
 1337|  6.67k|  blk[61] = (Guchar)(msgLen >> 13);
 1338|  6.67k|  blk[62] = (Guchar)(msgLen >> 5);
 1339|  6.67k|  blk[63] = (Guchar)(msgLen << 3);
 1340|  6.67k|  sha256HashBlock(blk, H);
 1341|       |
 1342|       |  // copy the output into the buffer (convert words to bytes)
 1343|  60.0k|  for (i = 0; i < 8; ++i) {
  ------------------
  |  Branch (1343:15): [True: 53.3k, False: 6.67k]
  ------------------
 1344|  53.3k|    hash[i*4]     = (Guchar)(H[i] >> 24);
 1345|  53.3k|    hash[i*4 + 1] = (Guchar)(H[i] >> 16);
 1346|  53.3k|    hash[i*4 + 2] = (Guchar)(H[i] >> 8);
 1347|  53.3k|    hash[i*4 + 3] = (Guchar)H[i];
 1348|  53.3k|  }
 1349|  6.67k|}
Decrypt.cc:_ZL15sha256HashBlockPhPj:
 1245|   304k|static void sha256HashBlock(Guchar *blk, Guint *H) {
 1246|   304k|  Guint W[64];
 1247|   304k|  Guint a, b, c, d, e, f, g, h;
 1248|   304k|  Guint T1, T2;
 1249|   304k|  Guint t;
 1250|       |
 1251|       |  // 1. prepare the message schedule
 1252|  5.17M|  for (t = 0; t < 16; ++t) {
  ------------------
  |  Branch (1252:15): [True: 4.87M, False: 304k]
  ------------------
 1253|  4.87M|    W[t] = (blk[t*4] << 24) |
 1254|  4.87M|           (blk[t*4 + 1] << 16) |
 1255|  4.87M|           (blk[t*4 + 2] << 8) |
 1256|  4.87M|           blk[t*4 + 3];
 1257|  4.87M|  }
 1258|  14.9M|  for (t = 16; t < 64; ++t) {
  ------------------
  |  Branch (1258:16): [True: 14.6M, False: 304k]
  ------------------
 1259|  14.6M|    W[t] = sha256sigma1(W[t-2]) + W[t-7] + sha256sigma0(W[t-15]) + W[t-16];
 1260|  14.6M|  }
 1261|       |
 1262|       |  // 2. initialize the eight working variables
 1263|   304k|  a = H[0];
 1264|   304k|  b = H[1];
 1265|   304k|  c = H[2];
 1266|   304k|  d = H[3];
 1267|   304k|  e = H[4];
 1268|   304k|  f = H[5];
 1269|   304k|  g = H[6];
 1270|   304k|  h = H[7];
 1271|       |
 1272|       |  // 3.
 1273|  19.7M|  for (t = 0; t < 64; ++t) {
  ------------------
  |  Branch (1273:15): [True: 19.4M, False: 304k]
  ------------------
 1274|  19.4M|    T1 = h + sha256Sigma1(e) + sha256Ch(e,f,g) + sha256K[t] + W[t];
 1275|  19.4M|    T2 = sha256Sigma0(a) + sha256Maj(a,b,c);
 1276|  19.4M|    h = g;
 1277|  19.4M|    g = f;
 1278|  19.4M|    f = e;
 1279|  19.4M|    e = d + T1;
 1280|  19.4M|    d = c;
 1281|  19.4M|    c = b;
 1282|  19.4M|    b = a;
 1283|  19.4M|    a = T1 + T2;
 1284|  19.4M|  }
 1285|       |
 1286|       |  // 4. compute the intermediate hash value
 1287|   304k|  H[0] += a;
 1288|   304k|  H[1] += b;
 1289|   304k|  H[2] += c;
 1290|   304k|  H[3] += d;
 1291|   304k|  H[4] += e;
 1292|   304k|  H[5] += f;
 1293|   304k|  H[6] += g;
 1294|   304k|  H[7] += h;
 1295|   304k|}
Decrypt.cc:_ZL12sha256sigma1j:
 1241|  14.6M|static inline Guint sha256sigma1(Guint x) {
 1242|  14.6M|  return rotr(x, 17) ^ rotr(x, 19) ^ (x >> 10);
 1243|  14.6M|}
Decrypt.cc:_ZL4rotrjj:
 1217|   175M|static inline Guint rotr(Guint x, Guint n) {
 1218|   175M|  return (x >> n) | (x << (32 - n));
 1219|   175M|}
Decrypt.cc:_ZL12sha256sigma0j:
 1237|  14.6M|static inline Guint sha256sigma0(Guint x) {
 1238|  14.6M|  return rotr(x, 7) ^ rotr(x, 18) ^ (x >> 3);
 1239|  14.6M|}
Decrypt.cc:_ZL12sha256Sigma1j:
 1233|  19.4M|static inline Guint sha256Sigma1(Guint x) {
 1234|  19.4M|  return rotr(x, 6) ^ rotr(x, 11) ^ rotr(x, 25);
 1235|  19.4M|}
Decrypt.cc:_ZL8sha256Chjjj:
 1221|  19.4M|static inline Guint sha256Ch(Guint x, Guint y, Guint z) {
 1222|  19.4M|  return (x & y) ^ (~x & z);
 1223|  19.4M|}
Decrypt.cc:_ZL12sha256Sigma0j:
 1229|  19.4M|static inline Guint sha256Sigma0(Guint x) {
 1230|  19.4M|  return rotr(x, 2) ^ rotr(x, 13) ^ rotr(x, 22);
 1231|  19.4M|}
Decrypt.cc:_ZL9sha256Majjjj:
 1225|  19.4M|static inline Guint sha256Maj(Guint x, Guint y, Guint z) {
 1226|  19.4M|  return (x & y) ^ (x & z) ^ (y & z);
 1227|  19.4M|}
Decrypt.cc:_ZL6sha512PhiS_:
 1486|  6.47k|static void sha512(Guchar *msg, int msgLen, Guchar *hash) {
 1487|  6.47k|  Guchar blk[128];
 1488|  6.47k|  SHA512Uint64 H[8];
 1489|  6.47k|  int blkLen, i;
 1490|       |
 1491|  6.47k|  H[0] = 0x6a09e667f3bcc908ULL;
 1492|  6.47k|  H[1] = 0xbb67ae8584caa73bULL;
 1493|  6.47k|  H[2] = 0x3c6ef372fe94f82bULL;
 1494|  6.47k|  H[3] = 0xa54ff53a5f1d36f1ULL;
 1495|  6.47k|  H[4] = 0x510e527fade682d1ULL;
 1496|  6.47k|  H[5] = 0x9b05688c2b3e6c1fULL;
 1497|  6.47k|  H[6] = 0x1f83d9abfb41bd6bULL;
 1498|  6.47k|  H[7] = 0x5be0cd19137e2179ULL;
 1499|       |
 1500|  6.47k|  blkLen = 0;
 1501|   162k|  for (i = 0; i + 128 <= msgLen; i += 128) {
  ------------------
  |  Branch (1501:15): [True: 155k, False: 6.47k]
  ------------------
 1502|   155k|    sha512HashBlock(msg + i, H);
 1503|   155k|  }
 1504|  6.47k|  blkLen = msgLen - i;
 1505|  6.47k|  if (blkLen > 0) {
  ------------------
  |  Branch (1505:7): [True: 0, False: 6.47k]
  ------------------
 1506|      0|    memcpy(blk, msg + i, blkLen);
 1507|      0|  }
 1508|       |
 1509|       |  // pad the message
 1510|  6.47k|  blk[blkLen++] = 0x80;
 1511|  6.47k|  if (blkLen > 112) {
  ------------------
  |  Branch (1511:7): [True: 0, False: 6.47k]
  ------------------
 1512|      0|    while (blkLen < 128) {
  ------------------
  |  Branch (1512:12): [True: 0, False: 0]
  ------------------
 1513|      0|      blk[blkLen++] = 0;
 1514|      0|    }
 1515|      0|    sha512HashBlock(blk, H);
 1516|      0|    blkLen = 0;
 1517|      0|  }
 1518|   725k|  while (blkLen < 112) {
  ------------------
  |  Branch (1518:10): [True: 718k, False: 6.47k]
  ------------------
 1519|   718k|    blk[blkLen++] = 0;
 1520|   718k|  }
 1521|  6.47k|  blk[112] = 0;
 1522|  6.47k|  blk[113] = 0;
 1523|  6.47k|  blk[114] = 0;
 1524|  6.47k|  blk[115] = 0;
 1525|  6.47k|  blk[116] = 0;
 1526|  6.47k|  blk[117] = 0;
 1527|  6.47k|  blk[118] = 0;
 1528|  6.47k|  blk[119] = 0;
 1529|  6.47k|  blk[120] = 0;
 1530|  6.47k|  blk[121] = 0;
 1531|  6.47k|  blk[122] = 0;
 1532|  6.47k|  blk[123] = 0;
 1533|  6.47k|  blk[124] = (Guchar)(msgLen >> 21);
 1534|  6.47k|  blk[125] = (Guchar)(msgLen >> 13);
 1535|  6.47k|  blk[126] = (Guchar)(msgLen >> 5);
 1536|  6.47k|  blk[127] = (Guchar)(msgLen << 3);
 1537|  6.47k|  sha512HashBlock(blk, H);
 1538|       |
 1539|       |  // copy the output into the buffer (convert words to bytes)
 1540|  58.2k|  for (i = 0; i < 8; ++i) {
  ------------------
  |  Branch (1540:15): [True: 51.8k, False: 6.47k]
  ------------------
 1541|  51.8k|    hash[i*8]     = (Guchar)(H[i] >> 56);
 1542|  51.8k|    hash[i*8 + 1] = (Guchar)(H[i] >> 48);
 1543|  51.8k|    hash[i*8 + 2] = (Guchar)(H[i] >> 40);
 1544|  51.8k|    hash[i*8 + 3] = (Guchar)(H[i] >> 32);
 1545|  51.8k|    hash[i*8 + 4] = (Guchar)(H[i] >> 24);
 1546|  51.8k|    hash[i*8 + 5] = (Guchar)(H[i] >> 16);
 1547|  51.8k|    hash[i*8 + 6] = (Guchar)(H[i] >> 8);
 1548|  51.8k|    hash[i*8 + 7] = (Guchar)H[i];
 1549|  51.8k|  }
 1550|  6.47k|}
Decrypt.cc:_ZL15sha512HashBlockPhPy:
 1430|   337k|static void sha512HashBlock(Guchar *blk, SHA512Uint64 *H) {
 1431|   337k|  SHA512Uint64 W[80];
 1432|   337k|  SHA512Uint64 a, b, c, d, e, f, g, h;
 1433|   337k|  SHA512Uint64 T1, T2;
 1434|   337k|  Guint t;
 1435|       |
 1436|       |  // 1. prepare the message schedule
 1437|  5.74M|  for (t = 0; t < 16; ++t) {
  ------------------
  |  Branch (1437:15): [True: 5.40M, False: 337k]
  ------------------
 1438|  5.40M|    W[t] = ((SHA512Uint64)blk[t*8] << 56) |
 1439|  5.40M|           ((SHA512Uint64)blk[t*8 + 1] << 48) |
 1440|  5.40M|           ((SHA512Uint64)blk[t*8 + 2] << 40) |
 1441|  5.40M|           ((SHA512Uint64)blk[t*8 + 3] << 32) |
 1442|  5.40M|           ((SHA512Uint64)blk[t*8 + 4] << 24) |
 1443|  5.40M|           ((SHA512Uint64)blk[t*8 + 5] << 16) |
 1444|  5.40M|           ((SHA512Uint64)blk[t*8 + 6] << 8) |
 1445|  5.40M|           (SHA512Uint64)blk[t*8 + 7];
 1446|  5.40M|  }
 1447|  21.9M|  for (t = 16; t < 80; ++t) {
  ------------------
  |  Branch (1447:16): [True: 21.6M, False: 337k]
  ------------------
 1448|  21.6M|    W[t] = sha512sigma1(W[t-2]) + W[t-7] + sha512sigma0(W[t-15]) + W[t-16];
 1449|  21.6M|  }
 1450|       |
 1451|       |  // 2. initialize the eight working variables
 1452|   337k|  a = H[0];
 1453|   337k|  b = H[1];
 1454|   337k|  c = H[2];
 1455|   337k|  d = H[3];
 1456|   337k|  e = H[4];
 1457|   337k|  f = H[5];
 1458|   337k|  g = H[6];
 1459|   337k|  h = H[7];
 1460|       |
 1461|       |  // 3.
 1462|  27.3M|  for (t = 0; t < 80; ++t) {
  ------------------
  |  Branch (1462:15): [True: 27.0M, False: 337k]
  ------------------
 1463|  27.0M|    T1 = h + sha512Sigma1(e) + sha512Ch(e,f,g) + sha512K[t] + W[t];
 1464|  27.0M|    T2 = sha512Sigma0(a) + sha512Maj(a,b,c);
 1465|  27.0M|    h = g;
 1466|  27.0M|    g = f;
 1467|  27.0M|    f = e;
 1468|  27.0M|    e = d + T1;
 1469|  27.0M|    d = c;
 1470|  27.0M|    c = b;
 1471|  27.0M|    b = a;
 1472|  27.0M|    a = T1 + T2;
 1473|  27.0M|  }
 1474|       |
 1475|       |  // 4. compute the intermediate hash value
 1476|   337k|  H[0] += a;
 1477|   337k|  H[1] += b;
 1478|   337k|  H[2] += c;
 1479|   337k|  H[3] += d;
 1480|   337k|  H[4] += e;
 1481|   337k|  H[5] += f;
 1482|   337k|  H[6] += g;
 1483|   337k|  H[7] += h;
 1484|   337k|}
Decrypt.cc:_ZL12sha512sigma1y:
 1426|  21.6M|static inline SHA512Uint64 sha512sigma1(SHA512Uint64 x) {
 1427|  21.6M|  return rotr64(x, 19) ^ rotr64(x, 61) ^ (x >> 6);
 1428|  21.6M|}
Decrypt.cc:_ZL6rotr64yj:
 1400|   248M|static inline SHA512Uint64 rotr64(SHA512Uint64 x, Guint n) {
 1401|   248M|  return (x >> n) | (x << (64 - n));
 1402|   248M|}
Decrypt.cc:_ZL12sha512sigma0y:
 1422|  21.6M|static inline SHA512Uint64 sha512sigma0(SHA512Uint64 x) {
 1423|  21.6M|  return rotr64(x, 1) ^ rotr64(x, 8) ^ (x >> 7);
 1424|  21.6M|}
Decrypt.cc:_ZL12sha512Sigma1y:
 1418|  27.0M|static inline SHA512Uint64 sha512Sigma1(SHA512Uint64 x) {
 1419|  27.0M|  return rotr64(x, 14) ^ rotr64(x, 18) ^ rotr64(x, 41);
 1420|  27.0M|}
Decrypt.cc:_ZL8sha512Chyyy:
 1405|  27.0M|				    SHA512Uint64 z) {
 1406|  27.0M|  return (x & y) ^ (~x & z);
 1407|  27.0M|}
Decrypt.cc:_ZL12sha512Sigma0y:
 1414|  27.0M|static inline SHA512Uint64 sha512Sigma0(SHA512Uint64 x) {
 1415|  27.0M|  return rotr64(x, 28) ^ rotr64(x, 34) ^ rotr64(x, 39);
 1416|  27.0M|}
Decrypt.cc:_ZL9sha512Majyyy:
 1410|  27.0M|				     SHA512Uint64 z) {
 1411|  27.0M|  return (x & y) ^ (x & z) ^ (y & z);
 1412|  27.0M|}
Decrypt.cc:_ZL6sha384PhiS_:
 1552|  6.94k|static void sha384(Guchar *msg, int msgLen, Guchar *hash) {
 1553|  6.94k|  Guchar blk[128];
 1554|  6.94k|  SHA512Uint64 H[8];
 1555|  6.94k|  int blkLen, i;
 1556|       |
 1557|  6.94k|  H[0] = 0xcbbb9d5dc1059ed8ULL;
 1558|  6.94k|  H[1] = 0x629a292a367cd507ULL;
 1559|  6.94k|  H[2] = 0x9159015a3070dd17ULL;
 1560|  6.94k|  H[3] = 0x152fecd8f70e5939ULL;
 1561|  6.94k|  H[4] = 0x67332667ffc00b31ULL;
 1562|  6.94k|  H[5] = 0x8eb44a8768581511ULL;
 1563|  6.94k|  H[6] = 0xdb0c2e0d64f98fa7ULL;
 1564|  6.94k|  H[7] = 0x47b5481dbefa4fa4ULL;
 1565|       |
 1566|  6.94k|  blkLen = 0;
 1567|   175k|  for (i = 0; i + 128 <= msgLen; i += 128) {
  ------------------
  |  Branch (1567:15): [True: 168k, False: 6.94k]
  ------------------
 1568|   168k|    sha512HashBlock(msg + i, H);
 1569|   168k|  }
 1570|  6.94k|  blkLen = msgLen - i;
 1571|  6.94k|  if (blkLen > 0) {
  ------------------
  |  Branch (1571:7): [True: 0, False: 6.94k]
  ------------------
 1572|      0|    memcpy(blk, msg + i, blkLen);
 1573|      0|  }
 1574|       |
 1575|       |  // pad the message
 1576|  6.94k|  blk[blkLen++] = 0x80;
 1577|  6.94k|  if (blkLen > 112) {
  ------------------
  |  Branch (1577:7): [True: 0, False: 6.94k]
  ------------------
 1578|      0|    while (blkLen < 128) {
  ------------------
  |  Branch (1578:12): [True: 0, False: 0]
  ------------------
 1579|      0|      blk[blkLen++] = 0;
 1580|      0|    }
 1581|      0|    sha512HashBlock(blk, H);
 1582|      0|    blkLen = 0;
 1583|      0|  }
 1584|   777k|  while (blkLen < 112) {
  ------------------
  |  Branch (1584:10): [True: 771k, False: 6.94k]
  ------------------
 1585|   771k|    blk[blkLen++] = 0;
 1586|   771k|  }
 1587|  6.94k|  blk[112] = 0;
 1588|  6.94k|  blk[113] = 0;
 1589|  6.94k|  blk[114] = 0;
 1590|  6.94k|  blk[115] = 0;
 1591|  6.94k|  blk[116] = 0;
 1592|  6.94k|  blk[117] = 0;
 1593|  6.94k|  blk[118] = 0;
 1594|  6.94k|  blk[119] = 0;
 1595|  6.94k|  blk[120] = 0;
 1596|  6.94k|  blk[121] = 0;
 1597|  6.94k|  blk[122] = 0;
 1598|  6.94k|  blk[123] = 0;
 1599|  6.94k|  blk[124] = (Guchar)(msgLen >> 21);
 1600|  6.94k|  blk[125] = (Guchar)(msgLen >> 13);
 1601|  6.94k|  blk[126] = (Guchar)(msgLen >> 5);
 1602|  6.94k|  blk[127] = (Guchar)(msgLen << 3);
 1603|  6.94k|  sha512HashBlock(blk, H);
 1604|       |
 1605|       |  // copy the output into the buffer (convert words to bytes)
 1606|  48.6k|  for (i = 0; i < 6; ++i) {
  ------------------
  |  Branch (1606:15): [True: 41.6k, False: 6.94k]
  ------------------
 1607|  41.6k|    hash[i*8]     = (Guchar)(H[i] >> 56);
 1608|  41.6k|    hash[i*8 + 1] = (Guchar)(H[i] >> 48);
 1609|  41.6k|    hash[i*8 + 2] = (Guchar)(H[i] >> 40);
 1610|  41.6k|    hash[i*8 + 3] = (Guchar)(H[i] >> 32);
 1611|  41.6k|    hash[i*8 + 4] = (Guchar)(H[i] >> 24);
 1612|  41.6k|    hash[i*8 + 5] = (Guchar)(H[i] >> 16);
 1613|  41.6k|    hash[i*8 + 6] = (Guchar)(H[i] >> 8);
 1614|  41.6k|    hash[i*8 + 7] = (Guchar)H[i];
 1615|  41.6k|  }
 1616|  6.94k|}

_ZN4DictC2EP4XRef:
   31|   634k|Dict::Dict(XRef *xrefA) {
   32|   634k|  xref = xrefA;
   33|   634k|  size = 8;
   34|   634k|  length = 0;
   35|   634k|  entries = (DictEntry *)gmallocn(size, sizeof(DictEntry));
   36|   634k|  hashTab = (DictEntry **)gmallocn(2 * size - 1, sizeof(DictEntry *));
   37|   634k|  memset(hashTab, 0, (2 * size - 1) * sizeof(DictEntry *));
   38|   634k|  ref = 1;
   39|   634k|}
_ZN4DictD2Ev:
   41|   497k|Dict::~Dict() {
   42|   497k|  int i;
   43|       |
   44|  2.11M|  for (i = 0; i < length; ++i) {
  ------------------
  |  Branch (44:15): [True: 1.62M, False: 497k]
  ------------------
   45|  1.62M|    gfree(entries[i].key);
   46|  1.62M|    entries[i].val.free();
   47|  1.62M|  }
   48|   497k|  gfree(entries);
   49|   497k|  gfree(hashTab);
   50|   497k|}
_ZN4Dict3addEPcP6Object:
   52|  2.75M|void Dict::add(char *key, Object *val) {
   53|  2.75M|  DictEntry *e;
   54|  2.75M|  int h;
   55|       |
   56|  2.75M|  if ((e = find(key))) {
  ------------------
  |  Branch (56:7): [True: 602k, False: 2.14M]
  ------------------
   57|   602k|    e->val.free();
   58|   602k|    e->val = *val;
   59|   602k|    gfree(key);
   60|  2.14M|  } else {
   61|  2.14M|    if (length == size) {
  ------------------
  |  Branch (61:9): [True: 68.4k, False: 2.08M]
  ------------------
   62|  68.4k|      expand();
   63|  68.4k|    }
   64|  2.14M|    h = hash(key);
   65|  2.14M|    entries[length].key = key;
   66|  2.14M|    entries[length].val = *val;
   67|  2.14M|    entries[length].next = hashTab[h];
   68|  2.14M|    hashTab[h] = &entries[length];
   69|  2.14M|    ++length;
   70|  2.14M|  }
   71|  2.75M|}
_ZN4Dict6expandEv:
   73|  68.4k|void Dict::expand() {
   74|  68.4k|  int h, i;
   75|       |
   76|  68.4k|  size *= 2;
   77|  68.4k|  entries = (DictEntry *)greallocn(entries, size, sizeof(DictEntry));
   78|  68.4k|  hashTab = (DictEntry **)greallocn(hashTab, 2 * size - 1,
   79|  68.4k|				    sizeof(DictEntry *));
   80|  68.4k|  memset(hashTab, 0, (2 * size - 1) * sizeof(DictEntry *));
   81|   654k|  for (i = 0; i < length; ++i) {
  ------------------
  |  Branch (81:15): [True: 586k, False: 68.4k]
  ------------------
   82|   586k|    h = hash(entries[i].key);
   83|   586k|    entries[i].next = hashTab[h];
   84|   586k|    hashTab[h] = &entries[i];
   85|   586k|  }
   86|  68.4k|}
_ZN4Dict4hashEPKc:
  101|  9.70M|int Dict::hash(const char *key) {
  102|  9.70M|  const char *p;
  103|  9.70M|  unsigned int h;
  104|       |
  105|  9.70M|  h = 0;
  106|  62.6M|  for (p = key; *p; ++p) {
  ------------------
  |  Branch (106:17): [True: 52.9M, False: 9.70M]
  ------------------
  107|  52.9M|    h = 17 * h + (int)(*p & 0xff);
  108|  52.9M|  }
  109|  9.70M|  return (int)(h % (2 * size - 1));
  110|  9.70M|}
_ZN4Dict6lookupEPKcP6Objecti:
  118|  3.68M|Object *Dict::lookup(const char *key, Object *obj, int recursion) {
  119|  3.68M|  DictEntry *e;
  120|       |
  121|  3.68M|  return (e = find(key)) ? e->val.fetch(xref, obj, recursion)
  ------------------
  |  Branch (121:10): [True: 921k, False: 2.76M]
  ------------------
  122|  3.68M|                         : obj->initNull();
  123|  3.68M|}
_ZN4Dict8lookupNFEPKcP6Object:
  125|   532k|Object *Dict::lookupNF(const char *key, Object *obj) {
  126|   532k|  DictEntry *e;
  127|       |
  128|   532k|  return (e = find(key)) ? e->val.copy(obj) : obj->initNull();
  ------------------
  |  Branch (128:10): [True: 164k, False: 368k]
  ------------------
  129|   532k|}
_ZN4Dict6getKeyEi:
  131|    254|char *Dict::getKey(int i) {
  132|    254|  return entries[i].key;
  133|    254|}
_ZN4Dict6getValEiP6Object:
  135|    254|Object *Dict::getVal(int i, Object *obj) {
  136|    254|  return entries[i].val.fetch(xref, obj);
  137|    254|}
_ZN4Dict4findEPKc:
   88|  6.96M|inline DictEntry *Dict::find(const char *key) {
   89|  6.96M|  DictEntry *e;
   90|  6.96M|  int h;
   91|       |
   92|  6.96M|  h = hash(key);
   93|  8.98M|  for (e = hashTab[h]; e; e = e->next) {
  ------------------
  |  Branch (93:24): [True: 3.70M, False: 5.27M]
  ------------------
   94|  3.70M|    if (!strcmp(key, e->key)) {
  ------------------
  |  Branch (94:9): [True: 1.68M, False: 2.02M]
  ------------------
   95|  1.68M|      return e;
   96|  1.68M|    }
   97|  3.70M|  }
   98|  5.27M|  return NULL;
   99|  6.96M|}

_ZN4Dict6incRefEv:
   36|  1.62M|  long incRef() { return gAtomicIncrement(&ref); }
_ZN4Dict6decRefEv:
   37|  2.12M|  long decRef() { return gAtomicDecrement(&ref); }
_ZN4Dict9getLengthEv:
   44|    402|  int getLength() { return length; }
_ZN4Dict7setXRefEP4XRef:
   65|  2.61k|  void setXRef(XRef *xrefA) { xref = xrefA; }

_Z5error13ErrorCategorylPKcz:
   46|  54.2M|		 const char *msg, ...) {
   47|  54.2M|  va_list args;
   48|  54.2M|  GString *s, *sanitized;
   49|  54.2M|  char c;
   50|  54.2M|  int i;
   51|       |
   52|       |  // NB: this can be called before the globalParams object is created
   53|  54.2M|  if (!errorCbk && globalParams && globalParams->getErrQuiet()) {
  ------------------
  |  Branch (53:7): [True: 54.2M, False: 0]
  |  Branch (53:20): [True: 54.2M, False: 0]
  |  Branch (53:36): [True: 54.2M, False: 0]
  ------------------
   54|  54.2M|    return;
   55|  54.2M|  }
   56|  54.2M|  va_start(args, msg);
   57|      0|  s = GString::formatv(msg, args);
   58|      0|  va_end(args);
   59|       |
   60|       |  // remove non-printable characters, just in case they might cause
   61|       |  // problems for the terminal program
   62|      0|  sanitized = new GString();
   63|      0|  for (i = 0; i < s->getLength(); ++i) {
  ------------------
  |  Branch (63:15): [True: 0, False: 0]
  ------------------
   64|      0|    c = s->getChar(i);
   65|      0|    if (c >= 0x20 && c <= 0x7e) {
  ------------------
  |  Branch (65:9): [True: 0, False: 0]
  |  Branch (65:22): [True: 0, False: 0]
  ------------------
   66|      0|      sanitized->append(c);
   67|      0|    } else {
   68|      0|      sanitized->appendf("<{0:02x}>", c & 0xff);
   69|      0|    }
   70|      0|  }
   71|       |
   72|      0|  if (errorCbk) {
  ------------------
  |  Branch (72:7): [True: 0, False: 0]
  ------------------
   73|      0|    (*errorCbk)(errorCbkData, category, (int)pos, sanitized->getCString());
   74|      0|  } else {
   75|      0|    fflush(stdout);
   76|      0|    if (pos >= 0) {
  ------------------
  |  Branch (76:9): [True: 0, False: 0]
  ------------------
   77|      0|      fprintf(stderr, "%s (%d): %s\n",
   78|      0|	      errorCategoryNames[category], (int)pos, sanitized->getCString());
   79|      0|    } else {
   80|      0|      fprintf(stderr, "%s: %s\n",
   81|      0|	      errorCategoryNames[category], sanitized->getCString());
   82|      0|    }
   83|      0|    fflush(stderr);
   84|      0|  }
   85|       |
   86|      0|  delete s;
   87|      0|  delete sanitized;
   88|      0|}

_ZN11SysFontListC2Ev:
  459|  4.70k|SysFontList::SysFontList() {
  460|  4.70k|  fonts = new GList();
  461|  4.70k|}
_ZN11SysFontListD2Ev:
  463|  4.70k|SysFontList::~SysFontList() {
  464|  4.70k|  deleteGList(fonts, SysFontInfo);
  ------------------
  |  |   94|  4.70k|  do {                                              \
  |  |   95|  4.70k|    GList *_list = (list);                          \
  |  |   96|  4.70k|    {                                               \
  |  |   97|  4.70k|      int _i;                                       \
  |  |   98|  4.70k|      for (_i = 0; _i < _list->getLength(); ++_i) { \
  |  |  ------------------
  |  |  |  Branch (98:20): [True: 0, False: 4.70k]
  |  |  ------------------
  |  |   99|      0|        delete (T*)_list->get(_i);                  \
  |  |  100|      0|      }                                             \
  |  |  101|  4.70k|      delete _list;                                 \
  |  |  102|  4.70k|    }                                               \
  |  |  103|  4.70k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (103:12): [Folded, False: 4.70k]
  |  |  ------------------
  ------------------
  465|  4.70k|}
_ZN10KeyBindingC2EiiiPKc:
  645|   286k|KeyBinding::KeyBinding(int codeA, int modsA, int contextA, const char *cmd0) {
  646|   286k|  code = codeA;
  647|   286k|  mods = modsA;
  648|   286k|  context = contextA;
  649|   286k|  cmds = new GList();
  650|   286k|  cmds->append(new GString(cmd0));
  651|   286k|}
_ZN10KeyBindingD2Ev:
  670|   286k|KeyBinding::~KeyBinding() {
  671|   286k|  deleteGList(cmds, GString);
  ------------------
  |  |   94|   286k|  do {                                              \
  |  |   95|   286k|    GList *_list = (list);                          \
  |  |   96|   286k|    {                                               \
  |  |   97|   286k|      int _i;                                       \
  |  |   98|   573k|      for (_i = 0; _i < _list->getLength(); ++_i) { \
  |  |  ------------------
  |  |  |  Branch (98:20): [True: 286k, False: 286k]
  |  |  ------------------
  |  |   99|   286k|        delete (T*)_list->get(_i);                  \
  |  |  100|   286k|      }                                             \
  |  |  101|   286k|      delete _list;                                 \
  |  |  102|   286k|    }                                               \
  |  |  103|   286k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (103:12): [Folded, False: 286k]
  |  |  ------------------
  ------------------
  672|   286k|}
_ZN12GlobalParamsC2EPKc:
  692|  4.70k|GlobalParams::GlobalParams(const char *cfgFileName) {
  693|  4.70k|  UnicodeMap *map;
  694|  4.70k|  GString *fileName;
  695|  4.70k|  FILE *f;
  696|  4.70k|  int i;
  697|       |
  698|  4.70k|#if MULTITHREADED
  699|  4.70k|  gInitMutex(&mutex);
  ------------------
  |  |   51|  4.70k|#define gInitMutex(m) pthread_mutex_init(m, NULL)
  ------------------
  700|  4.70k|  gInitMutex(&unicodeMapCacheMutex);
  ------------------
  |  |   51|  4.70k|#define gInitMutex(m) pthread_mutex_init(m, NULL)
  ------------------
  701|  4.70k|  gInitMutex(&cMapCacheMutex);
  ------------------
  |  |   51|  4.70k|#define gInitMutex(m) pthread_mutex_init(m, NULL)
  ------------------
  702|  4.70k|#endif
  703|       |
  704|       |#ifdef _WIN32
  705|       |  tlsWin32ErrorInfo = TlsAlloc();
  706|       |#endif
  707|       |
  708|  4.70k|  initBuiltinFontTables();
  709|       |
  710|       |  // scan the encoding in reverse because we want the lowest-numbered
  711|       |  // index for each char name ('space' is encoded twice)
  712|  4.70k|  macRomanReverseMap = new NameToCharCode();
  713|  1.20M|  for (i = 255; i >= 0; --i) {
  ------------------
  |  Branch (713:17): [True: 1.20M, False: 4.70k]
  ------------------
  714|  1.20M|    if (macRomanEncoding[i]) {
  ------------------
  |  Branch (714:9): [True: 1.04M, False: 155k]
  ------------------
  715|  1.04M|      macRomanReverseMap->add(macRomanEncoding[i], (CharCode)i);
  716|  1.04M|    }
  717|  1.20M|  }
  718|       |
  719|       |#ifdef _WIN32
  720|       |  // baseDir will be set by a call to setBaseDir
  721|       |  baseDir = new GString();
  722|       |#else
  723|  4.70k|  baseDir = appendToPath(getHomeDir(), ".xpdf");
  724|  4.70k|#endif
  725|  4.70k|  configFileVars = new GHash(gTrue);
  ------------------
  |  |   17|  4.70k|#define gTrue 1
  ------------------
  726|  4.70k|  setDataDirVar();
  727|  4.70k|  nameToUnicode = new NameToCharCode();
  728|  4.70k|  cidToUnicodes = new GHash(gTrue);
  ------------------
  |  |   17|  4.70k|#define gTrue 1
  ------------------
  729|  4.70k|  unicodeToUnicodes = new GHash(gTrue);
  ------------------
  |  |   17|  4.70k|#define gTrue 1
  ------------------
  730|  4.70k|  residentUnicodeMaps = new GHash();
  731|  4.70k|  unicodeMaps = new GHash(gTrue);
  ------------------
  |  |   17|  4.70k|#define gTrue 1
  ------------------
  732|  4.70k|  cMapDirs = new GHash(gTrue);
  ------------------
  |  |   17|  4.70k|#define gTrue 1
  ------------------
  733|  4.70k|  toUnicodeDirs = new GList();
  734|  4.70k|  unicodeRemapping = new UnicodeRemapping();
  735|  4.70k|  fontFiles = new GHash(gTrue);
  ------------------
  |  |   17|  4.70k|#define gTrue 1
  ------------------
  736|  4.70k|  fontDirs = new GList();
  737|  4.70k|  ccFontFiles = new GHash(gTrue);
  ------------------
  |  |   17|  4.70k|#define gTrue 1
  ------------------
  738|  4.70k|  base14SysFonts = new GHash(gTrue);
  ------------------
  |  |   17|  4.70k|#define gTrue 1
  ------------------
  739|  4.70k|  sysFonts = new SysFontList();
  740|       |#if HAVE_PAPER_H
  741|       |  const char *paperName;
  742|       |  const struct paper *paperType;
  743|       |  paperinit();
  744|       |  if ((paperName = systempapername())) {
  745|       |    paperType = paperinfo(paperName);
  746|       |    psPaperWidth = (int)paperpswidth(paperType);
  747|       |    psPaperHeight = (int)paperpsheight(paperType);
  748|       |  } else {
  749|       |    error(errConfig, -1, "No paper information available - using defaults");
  750|       |    psPaperWidth = defPaperWidth;
  751|       |    psPaperHeight = defPaperHeight;
  752|       |  }
  753|       |  paperdone();
  754|       |#else
  755|  4.70k|  psPaperWidth = defPaperWidth;
  ------------------
  |  |   46|  4.70k|#define defPaperWidth  612    // American letter (8.5x11")
  ------------------
  756|  4.70k|  psPaperHeight = defPaperHeight;
  ------------------
  |  |   47|  4.70k|#define defPaperHeight 792
  ------------------
  757|  4.70k|#endif
  758|  4.70k|  psImageableLLX = psImageableLLY = 0;
  759|  4.70k|  psImageableURX = psPaperWidth;
  760|  4.70k|  psImageableURY = psPaperHeight;
  761|  4.70k|  psCrop = gTrue;
  ------------------
  |  |   17|  4.70k|#define gTrue 1
  ------------------
  762|  4.70k|  psUseCropBoxAsPage = gFalse;
  ------------------
  |  |   18|  4.70k|#define gFalse 0
  ------------------
  763|  4.70k|  psExpandSmaller = gFalse;
  ------------------
  |  |   18|  4.70k|#define gFalse 0
  ------------------
  764|  4.70k|  psShrinkLarger = gTrue;
  ------------------
  |  |   17|  4.70k|#define gTrue 1
  ------------------
  765|  4.70k|  psCenter = gTrue;
  ------------------
  |  |   17|  4.70k|#define gTrue 1
  ------------------
  766|  4.70k|  psDuplex = gFalse;
  ------------------
  |  |   18|  4.70k|#define gFalse 0
  ------------------
  767|  4.70k|  psLevel = psLevel3;
  768|  4.70k|  psResidentFonts = new GHash(gTrue);
  ------------------
  |  |   17|  4.70k|#define gTrue 1
  ------------------
  769|  4.70k|  psResidentFonts16 = new GList();
  770|  4.70k|  psResidentFontsCC = new GList();
  771|  4.70k|  psEmbedType1 = gTrue;
  ------------------
  |  |   17|  4.70k|#define gTrue 1
  ------------------
  772|  4.70k|  psEmbedTrueType = gTrue;
  ------------------
  |  |   17|  4.70k|#define gTrue 1
  ------------------
  773|  4.70k|  psEmbedCIDPostScript = gTrue;
  ------------------
  |  |   17|  4.70k|#define gTrue 1
  ------------------
  774|  4.70k|  psEmbedCIDTrueType = gTrue;
  ------------------
  |  |   17|  4.70k|#define gTrue 1
  ------------------
  775|  4.70k|  psFontPassthrough = gFalse;
  ------------------
  |  |   18|  4.70k|#define gFalse 0
  ------------------
  776|  4.70k|  psPreload = gFalse;
  ------------------
  |  |   18|  4.70k|#define gFalse 0
  ------------------
  777|  4.70k|  psOPI = gFalse;
  ------------------
  |  |   18|  4.70k|#define gFalse 0
  ------------------
  778|  4.70k|  psASCIIHex = gFalse;
  ------------------
  |  |   18|  4.70k|#define gFalse 0
  ------------------
  779|  4.70k|  psLZW = gTrue;
  ------------------
  |  |   17|  4.70k|#define gTrue 1
  ------------------
  780|  4.70k|  psUncompressPreloadedImages = gFalse;
  ------------------
  |  |   18|  4.70k|#define gFalse 0
  ------------------
  781|  4.70k|  psMinLineWidth = 0;
  782|  4.70k|  psRasterResolution = 300;
  783|  4.70k|  psRasterMono = gFalse;
  ------------------
  |  |   18|  4.70k|#define gFalse 0
  ------------------
  784|  4.70k|  psRasterSliceSize = 20000000;
  785|  4.70k|  psAlwaysRasterize = gFalse;
  ------------------
  |  |   18|  4.70k|#define gFalse 0
  ------------------
  786|  4.70k|  psNeverRasterize = gFalse;
  ------------------
  |  |   18|  4.70k|#define gFalse 0
  ------------------
  787|  4.70k|  textEncoding = new GString(defaultTextEncoding);
  788|       |#if defined(_WIN32)
  789|       |  textEOL = eolDOS;
  790|       |#else
  791|  4.70k|  textEOL = eolUnix;
  792|  4.70k|#endif
  793|  4.70k|  textPageBreaks = gTrue;
  ------------------
  |  |   17|  4.70k|#define gTrue 1
  ------------------
  794|  4.70k|  textKeepTinyChars = gTrue;
  ------------------
  |  |   17|  4.70k|#define gTrue 1
  ------------------
  795|  4.70k|  initialZoom = new GString("125");
  796|  4.70k|  defaultFitZoom = 0;
  797|  4.70k|  zoomScaleFactor = 1;
  798|  4.70k|  zoomValues = new GList();
  799|  4.70k|  zoomValues->append(new GString("25"));
  800|  4.70k|  zoomValues->append(new GString("50"));
  801|  4.70k|  zoomValues->append(new GString("75"));
  802|  4.70k|  zoomValues->append(new GString("100"));
  803|  4.70k|  zoomValues->append(new GString("110"));
  804|  4.70k|  zoomValues->append(new GString("125"));
  805|  4.70k|  zoomValues->append(new GString("150"));
  806|  4.70k|  zoomValues->append(new GString("175"));
  807|  4.70k|  zoomValues->append(new GString("200"));
  808|  4.70k|  zoomValues->append(new GString("300"));
  809|  4.70k|  zoomValues->append(new GString("400"));
  810|  4.70k|  zoomValues->append(new GString("600"));
  811|  4.70k|  zoomValues->append(new GString("800"));
  812|  4.70k|  initialDisplayMode = new GString("continuous");
  813|  4.70k|  initialToolbarState = gTrue;
  ------------------
  |  |   17|  4.70k|#define gTrue 1
  ------------------
  814|  4.70k|  initialSidebarState = gTrue;
  ------------------
  |  |   17|  4.70k|#define gTrue 1
  ------------------
  815|  4.70k|  initialSidebarWidth = 0;
  816|  4.70k|  initialSelectMode = new GString("linear");
  817|  4.70k|  initialMaximized = gFalse;
  ------------------
  |  |   18|  4.70k|#define gFalse 0
  ------------------
  818|  4.70k|  maxTileWidth = 1500;
  819|  4.70k|  maxTileHeight = 1500;
  820|  4.70k|  tileCacheSize = 10;
  821|  4.70k|  workerThreads = 1;
  822|  4.70k|  enableFreeType = gTrue;
  ------------------
  |  |   17|  4.70k|#define gTrue 1
  ------------------
  823|  4.70k|  disableFreeTypeHinting = gFalse;
  ------------------
  |  |   18|  4.70k|#define gFalse 0
  ------------------
  824|  4.70k|  antialias = gTrue;
  ------------------
  |  |   17|  4.70k|#define gTrue 1
  ------------------
  825|  4.70k|  vectorAntialias = gTrue;
  ------------------
  |  |   17|  4.70k|#define gTrue 1
  ------------------
  826|  4.70k|  imageMaskAntialias = gTrue;
  ------------------
  |  |   17|  4.70k|#define gTrue 1
  ------------------
  827|  4.70k|  antialiasPrinting = gFalse;
  ------------------
  |  |   18|  4.70k|#define gFalse 0
  ------------------
  828|  4.70k|  strokeAdjust = strokeAdjustNormal;
  829|  4.70k|  screenType = screenUnset;
  830|  4.70k|  screenSize = -1;
  831|  4.70k|  screenDotRadius = -1;
  832|  4.70k|  screenGamma = 1.0;
  833|  4.70k|  screenBlackThreshold = 0.0;
  834|  4.70k|  screenWhiteThreshold = 1.0;
  835|  4.70k|  minLineWidth = 0.0;
  836|  4.70k|  enablePathSimplification = gFalse;
  ------------------
  |  |   18|  4.70k|#define gFalse 0
  ------------------
  837|  4.70k|  drawAnnotations = gTrue;
  ------------------
  |  |   17|  4.70k|#define gTrue 1
  ------------------
  838|  4.70k|  drawFormFields = gTrue;
  ------------------
  |  |   17|  4.70k|#define gTrue 1
  ------------------
  839|  4.70k|  enableXFA = gTrue;
  ------------------
  |  |   17|  4.70k|#define gTrue 1
  ------------------
  840|  4.70k|  preferXFAFieldValues = gTrue;
  ------------------
  |  |   17|  4.70k|#define gTrue 1
  ------------------
  841|  4.70k|  overprintPreview = gFalse;
  ------------------
  |  |   18|  4.70k|#define gFalse 0
  ------------------
  842|  4.70k|  paperColor = new GString("#ffffff");
  843|  4.70k|  matteColor = new GString("#808080");
  844|  4.70k|  fullScreenMatteColor = new GString("#000000");
  845|  4.70k|  selectionColor = new GString("#8080ff");
  846|  4.70k|  reverseVideoInvertImages = gFalse;
  ------------------
  |  |   18|  4.70k|#define gFalse 0
  ------------------
  847|  4.70k|  allowLinksToChangeZoom = gTrue;
  ------------------
  |  |   17|  4.70k|#define gTrue 1
  ------------------
  848|  4.70k|  launchCommand = NULL;
  849|  4.70k|  movieCommand = NULL;
  850|  4.70k|  defaultPrinter = NULL;
  851|  4.70k|  mapNumericCharNames = gTrue;
  ------------------
  |  |   17|  4.70k|#define gTrue 1
  ------------------
  852|  4.70k|  mapUnknownCharNames = gFalse;
  ------------------
  |  |   18|  4.70k|#define gFalse 0
  ------------------
  853|  4.70k|  mapExtTrueTypeFontsViaUnicode = gTrue;
  ------------------
  |  |   17|  4.70k|#define gTrue 1
  ------------------
  854|  4.70k|  useTrueTypeUnicodeMapping = gFalse;
  ------------------
  |  |   18|  4.70k|#define gFalse 0
  ------------------
  855|  4.70k|  ignoreWrongSizeToUnicode = gFalse;
  ------------------
  |  |   18|  4.70k|#define gFalse 0
  ------------------
  856|  4.70k|  droppedFonts = new GHash(gTrue);
  ------------------
  |  |   17|  4.70k|#define gTrue 1
  ------------------
  857|  4.70k|  separateRotatedText = gFalse;
  ------------------
  |  |   18|  4.70k|#define gFalse 0
  ------------------
  858|  4.70k|  discardCoveredText = gFalse;
  ------------------
  |  |   18|  4.70k|#define gFalse 0
  ------------------
  859|  4.70k|  createDefaultKeyBindings();
  860|  4.70k|  popupMenuCmds = new GList();
  861|  4.70k|  initStateFilePaths();
  862|  4.70k|  saveSessionOnQuit = gTrue;
  ------------------
  |  |   17|  4.70k|#define gTrue 1
  ------------------
  863|  4.70k|  savePageNumbers = gTrue;
  ------------------
  |  |   17|  4.70k|#define gTrue 1
  ------------------
  864|  4.70k|  printCommands = gFalse;
  ------------------
  |  |   18|  4.70k|#define gFalse 0
  ------------------
  865|  4.70k|  printStatusInfo = gFalse;
  ------------------
  |  |   18|  4.70k|#define gFalse 0
  ------------------
  866|  4.70k|  errQuiet = gFalse;
  ------------------
  |  |   18|  4.70k|#define gFalse 0
  ------------------
  867|  4.70k|  debugLogFile = NULL;
  868|       |
  869|  4.70k|  cidToUnicodeCache = new CharCodeToUnicodeCache(cidToUnicodeCacheSize);
  ------------------
  |  |   71|  4.70k|#define cidToUnicodeCacheSize     4
  ------------------
  870|  4.70k|  unicodeToUnicodeCache =
  871|  4.70k|      new CharCodeToUnicodeCache(unicodeToUnicodeCacheSize);
  ------------------
  |  |   72|  4.70k|#define unicodeToUnicodeCacheSize 4
  ------------------
  872|  4.70k|  unicodeMapCache = new UnicodeMapCache();
  873|  4.70k|  cMapCache = new CMapCache();
  874|       |
  875|       |  // set up the initial nameToUnicode table
  876|  19.9M|  for (i = 0; nameToUnicodeTab[i].name; ++i) {
  ------------------
  |  Branch (876:15): [True: 19.9M, False: 4.70k]
  ------------------
  877|  19.9M|    nameToUnicode->add(nameToUnicodeTab[i].name, nameToUnicodeTab[i].u);
  878|  19.9M|  }
  879|       |
  880|       |  // set up the residentUnicodeMaps table
  881|  4.70k|  map = new UnicodeMap("Latin1", gFalse,
  ------------------
  |  |   18|  4.70k|#define gFalse 0
  ------------------
  882|  4.70k|		       latin1UnicodeMapRanges, latin1UnicodeMapLen);
  ------------------
  |  |   71|  4.70k|#define latin1UnicodeMapLen (sizeof(latin1UnicodeMapRanges) / sizeof(UnicodeMapRange))
  ------------------
  883|  4.70k|  residentUnicodeMaps->add(map->getEncodingName(), map);
  884|  4.70k|  map = new UnicodeMap("ASCII7", gFalse,
  ------------------
  |  |   18|  4.70k|#define gFalse 0
  ------------------
  885|  4.70k|		       ascii7UnicodeMapRanges, ascii7UnicodeMapLen);
  ------------------
  |  |  207|  4.70k|#define ascii7UnicodeMapLen (sizeof(ascii7UnicodeMapRanges) / sizeof(UnicodeMapRange))
  ------------------
  886|  4.70k|  residentUnicodeMaps->add(map->getEncodingName(), map);
  887|  4.70k|  map = new UnicodeMap("Symbol", gFalse,
  ------------------
  |  |   18|  4.70k|#define gFalse 0
  ------------------
  888|  4.70k|		       symbolUnicodeMapRanges, symbolUnicodeMapLen);
  ------------------
  |  |  332|  4.70k|#define symbolUnicodeMapLen (sizeof(symbolUnicodeMapRanges) / sizeof(UnicodeMapRange))
  ------------------
  889|  4.70k|  residentUnicodeMaps->add(map->getEncodingName(), map);
  890|  4.70k|  map = new UnicodeMap("ZapfDingbats", gFalse, zapfDingbatsUnicodeMapRanges,
  ------------------
  |  |   18|  4.70k|#define gFalse 0
  ------------------
  891|  4.70k|		       zapfDingbatsUnicodeMapLen);
  ------------------
  |  |  366|  4.70k|#define zapfDingbatsUnicodeMapLen (sizeof(zapfDingbatsUnicodeMapRanges) / sizeof(UnicodeMapRange))
  ------------------
  892|  4.70k|  residentUnicodeMaps->add(map->getEncodingName(), map);
  893|  4.70k|  map = new UnicodeMap("UTF-8", gTrue, &mapUTF8);
  ------------------
  |  |   17|  4.70k|#define gTrue 1
  ------------------
  894|  4.70k|  residentUnicodeMaps->add(map->getEncodingName(), map);
  895|  4.70k|  map = new UnicodeMap("UCS-2", gTrue, &mapUCS2);
  ------------------
  |  |   17|  4.70k|#define gTrue 1
  ------------------
  896|  4.70k|  residentUnicodeMaps->add(map->getEncodingName(), map);
  897|       |
  898|       |  // read the config file
  899|  4.70k|  f = openConfigFile(cfgFileName, &fileName);
  900|  4.70k|  if (f) {
  ------------------
  |  Branch (900:7): [True: 0, False: 4.70k]
  ------------------
  901|      0|    parseFile(fileName, f);
  902|      0|    delete fileName;
  903|      0|    fclose(f);
  904|      0|  }
  905|  4.70k|}
_ZN12GlobalParams13setDataDirVarEv:
  907|  4.70k|void GlobalParams::setDataDirVar() {
  908|  4.70k|  GString *dir;
  909|       |
  910|       |#if defined(XPDFRC_DATADIR)
  911|       |  dir = new GString(XPDFRC_DATADIR);
  912|       |#elif defined(_WIN32)
  913|       |  wchar_t buf[512];
  914|       |  DWORD n = GetModuleFileNameW(NULL, buf, sizeof(buf) / sizeof(wchar_t));
  915|       |  if (n <= 0 || n >= sizeof(buf)) {
  916|       |    // error or path too long for buffer - just use the current dir
  917|       |    buf[0] = L'\0';
  918|       |  }
  919|       |  GString *path = fileNameToUTF8(buf);
  920|       |  dir = grabPath(path->getCString());
  921|       |  delete path;
  922|       |  appendToPath(dir, "data");
  923|       |#else
  924|       |  //~ may be useful to allow the options of using the install dir
  925|       |  //~   and/or the user's home dir (?)
  926|  4.70k|  dir = new GString("./data");
  927|  4.70k|#endif
  928|       |
  929|  4.70k|  configFileVars->add(new GString("DATADIR"), dir);
  930|  4.70k|}
_ZN12GlobalParams24createDefaultKeyBindingsEv:
  932|  4.70k|void GlobalParams::createDefaultKeyBindings() {
  933|  4.70k|  keyBindings = new GList();
  934|       |
  935|       |  //----- mouse buttons
  936|  4.70k|  keyBindings->append(new KeyBinding(xpdfKeyCodeMousePress1, xpdfKeyModNone,
  ------------------
  |  |  147|  4.70k|#define xpdfKeyCodeMousePress1        0x2001
  ------------------
                keyBindings->append(new KeyBinding(xpdfKeyCodeMousePress1, xpdfKeyModNone,
  ------------------
  |  |  192|  4.70k|#define xpdfKeyModNone            0
  ------------------
  937|  4.70k|				     xpdfKeyContextAny, "startSelection"));
  ------------------
  |  |  196|  4.70k|#define xpdfKeyContextAny         0
  ------------------
  938|  4.70k|  keyBindings->append(new KeyBinding(xpdfKeyCodeMousePress1, xpdfKeyModShift,
  ------------------
  |  |  147|  4.70k|#define xpdfKeyCodeMousePress1        0x2001
  ------------------
                keyBindings->append(new KeyBinding(xpdfKeyCodeMousePress1, xpdfKeyModShift,
  ------------------
  |  |  193|  4.70k|#define xpdfKeyModShift           (1 << 0)
  ------------------
  939|  4.70k|				     xpdfKeyContextAny,
  ------------------
  |  |  196|  4.70k|#define xpdfKeyContextAny         0
  ------------------
  940|  4.70k|				     "startExtendedSelection"));
  941|  4.70k|  keyBindings->append(new KeyBinding(xpdfKeyCodeMouseRelease1, xpdfKeyModNone,
  ------------------
  |  |  156|  4.70k|#define xpdfKeyCodeMouseRelease1      0x2101
  ------------------
                keyBindings->append(new KeyBinding(xpdfKeyCodeMouseRelease1, xpdfKeyModNone,
  ------------------
  |  |  192|  4.70k|#define xpdfKeyModNone            0
  ------------------
  942|  4.70k|				     xpdfKeyContextAny, "endSelection"));
  ------------------
  |  |  196|  4.70k|#define xpdfKeyContextAny         0
  ------------------
  943|  4.70k|  keyBindings->append(new KeyBinding(xpdfKeyCodeMouseRelease1, xpdfKeyModShift,
  ------------------
  |  |  156|  4.70k|#define xpdfKeyCodeMouseRelease1      0x2101
  ------------------
                keyBindings->append(new KeyBinding(xpdfKeyCodeMouseRelease1, xpdfKeyModShift,
  ------------------
  |  |  193|  4.70k|#define xpdfKeyModShift           (1 << 0)
  ------------------
  944|  4.70k|				     xpdfKeyContextAny,
  ------------------
  |  |  196|  4.70k|#define xpdfKeyContextAny         0
  ------------------
  945|  4.70k|				     "endSelection"));
  946|  4.70k|  keyBindings->append(new KeyBinding(xpdfKeyCodeMouseDoubleClick1,
  ------------------
  |  |  174|  4.70k|#define xpdfKeyCodeMouseDoubleClick1  0x2301
  ------------------
  947|  4.70k|				     xpdfKeyModNone, xpdfKeyContextAny,
  ------------------
  |  |  192|  4.70k|#define xpdfKeyModNone            0
  ------------------
              				     xpdfKeyModNone, xpdfKeyContextAny,
  ------------------
  |  |  196|  4.70k|#define xpdfKeyContextAny         0
  ------------------
  948|  4.70k|				     "selectWord"));
  949|  4.70k|  keyBindings->append(new KeyBinding(xpdfKeyCodeMouseTripleClick1,
  ------------------
  |  |  183|  4.70k|#define xpdfKeyCodeMouseTripleClick1  0x2401
  ------------------
  950|  4.70k|				     xpdfKeyModNone, xpdfKeyContextAny,
  ------------------
  |  |  192|  4.70k|#define xpdfKeyModNone            0
  ------------------
              				     xpdfKeyModNone, xpdfKeyContextAny,
  ------------------
  |  |  196|  4.70k|#define xpdfKeyContextAny         0
  ------------------
  951|  4.70k|				     "selectLine"));
  952|  4.70k|  keyBindings->append(new KeyBinding(xpdfKeyCodeMouseClick1, xpdfKeyModNone,
  ------------------
  |  |  165|  4.70k|#define xpdfKeyCodeMouseClick1        0x2201
  ------------------
                keyBindings->append(new KeyBinding(xpdfKeyCodeMouseClick1, xpdfKeyModNone,
  ------------------
  |  |  192|  4.70k|#define xpdfKeyModNone            0
  ------------------
  953|  4.70k|				     xpdfKeyContextAny, "followLinkNoSel"));
  ------------------
  |  |  196|  4.70k|#define xpdfKeyContextAny         0
  ------------------
  954|  4.70k|  keyBindings->append(new KeyBinding(xpdfKeyCodeMouseClick2, xpdfKeyModNone,
  ------------------
  |  |  166|  4.70k|#define xpdfKeyCodeMouseClick2        0x2202
  ------------------
                keyBindings->append(new KeyBinding(xpdfKeyCodeMouseClick2, xpdfKeyModNone,
  ------------------
  |  |  192|  4.70k|#define xpdfKeyModNone            0
  ------------------
  955|  4.70k|				     xpdfKeyContextOverLink,
  ------------------
  |  |  201|  4.70k|#define xpdfKeyContextOverLink    (1 << 4)
  ------------------
  956|  4.70k|				     "followLinkInNewTab"));
  957|  4.70k|  keyBindings->append(new KeyBinding(xpdfKeyCodeMousePress2, xpdfKeyModNone,
  ------------------
  |  |  148|  4.70k|#define xpdfKeyCodeMousePress2        0x2002
  ------------------
                keyBindings->append(new KeyBinding(xpdfKeyCodeMousePress2, xpdfKeyModNone,
  ------------------
  |  |  192|  4.70k|#define xpdfKeyModNone            0
  ------------------
  958|  4.70k|				     xpdfKeyContextAny, "startPan"));
  ------------------
  |  |  196|  4.70k|#define xpdfKeyContextAny         0
  ------------------
  959|  4.70k|  keyBindings->append(new KeyBinding(xpdfKeyCodeMouseRelease2, xpdfKeyModNone,
  ------------------
  |  |  157|  4.70k|#define xpdfKeyCodeMouseRelease2      0x2102
  ------------------
                keyBindings->append(new KeyBinding(xpdfKeyCodeMouseRelease2, xpdfKeyModNone,
  ------------------
  |  |  192|  4.70k|#define xpdfKeyModNone            0
  ------------------
  960|  4.70k|				     xpdfKeyContextAny, "endPan"));
  ------------------
  |  |  196|  4.70k|#define xpdfKeyContextAny         0
  ------------------
  961|  4.70k|  keyBindings->append(new KeyBinding(xpdfKeyCodeMousePress3, xpdfKeyModNone,
  ------------------
  |  |  149|  4.70k|#define xpdfKeyCodeMousePress3        0x2003
  ------------------
                keyBindings->append(new KeyBinding(xpdfKeyCodeMousePress3, xpdfKeyModNone,
  ------------------
  |  |  192|  4.70k|#define xpdfKeyModNone            0
  ------------------
  962|  4.70k|				     xpdfKeyContextAny, "postPopupMenu"));
  ------------------
  |  |  196|  4.70k|#define xpdfKeyContextAny         0
  ------------------
  963|  4.70k|  keyBindings->append(new KeyBinding(xpdfKeyCodeMousePress4, xpdfKeyModNone,
  ------------------
  |  |  150|  4.70k|#define xpdfKeyCodeMousePress4        0x2004
  ------------------
                keyBindings->append(new KeyBinding(xpdfKeyCodeMousePress4, xpdfKeyModNone,
  ------------------
  |  |  192|  4.70k|#define xpdfKeyModNone            0
  ------------------
  964|  4.70k|				     xpdfKeyContextAny,
  ------------------
  |  |  196|  4.70k|#define xpdfKeyContextAny         0
  ------------------
  965|  4.70k|				     "scrollUpPrevPage(16)"));
  966|  4.70k|  keyBindings->append(new KeyBinding(xpdfKeyCodeMousePress5, xpdfKeyModNone,
  ------------------
  |  |  151|  4.70k|#define xpdfKeyCodeMousePress5        0x2005
  ------------------
                keyBindings->append(new KeyBinding(xpdfKeyCodeMousePress5, xpdfKeyModNone,
  ------------------
  |  |  192|  4.70k|#define xpdfKeyModNone            0
  ------------------
  967|  4.70k|				     xpdfKeyContextAny,
  ------------------
  |  |  196|  4.70k|#define xpdfKeyContextAny         0
  ------------------
  968|  4.70k|				     "scrollDownNextPage(16)"));
  969|  4.70k|  keyBindings->append(new KeyBinding(xpdfKeyCodeMousePress6, xpdfKeyModNone,
  ------------------
  |  |  152|  4.70k|#define xpdfKeyCodeMousePress6        0x2006
  ------------------
                keyBindings->append(new KeyBinding(xpdfKeyCodeMousePress6, xpdfKeyModNone,
  ------------------
  |  |  192|  4.70k|#define xpdfKeyModNone            0
  ------------------
  970|  4.70k|				     xpdfKeyContextAny, "scrollLeft(16)"));
  ------------------
  |  |  196|  4.70k|#define xpdfKeyContextAny         0
  ------------------
  971|  4.70k|  keyBindings->append(new KeyBinding(xpdfKeyCodeMousePress7, xpdfKeyModNone,
  ------------------
  |  |  153|  4.70k|#define xpdfKeyCodeMousePress7        0x2007
  ------------------
                keyBindings->append(new KeyBinding(xpdfKeyCodeMousePress7, xpdfKeyModNone,
  ------------------
  |  |  192|  4.70k|#define xpdfKeyModNone            0
  ------------------
  972|  4.70k|				     xpdfKeyContextAny, "scrollRight(16)"));
  ------------------
  |  |  196|  4.70k|#define xpdfKeyContextAny         0
  ------------------
  973|  4.70k|  keyBindings->append(new KeyBinding(xpdfKeyCodeMousePress4, xpdfKeyModCtrl,
  ------------------
  |  |  150|  4.70k|#define xpdfKeyCodeMousePress4        0x2004
  ------------------
                keyBindings->append(new KeyBinding(xpdfKeyCodeMousePress4, xpdfKeyModCtrl,
  ------------------
  |  |  194|  4.70k|#define xpdfKeyModCtrl            (1 << 1)
  ------------------
  974|  4.70k|				     xpdfKeyContextAny, "zoomIn"));
  ------------------
  |  |  196|  4.70k|#define xpdfKeyContextAny         0
  ------------------
  975|  4.70k|  keyBindings->append(new KeyBinding(xpdfKeyCodeMousePress5, xpdfKeyModCtrl,
  ------------------
  |  |  151|  4.70k|#define xpdfKeyCodeMousePress5        0x2005
  ------------------
                keyBindings->append(new KeyBinding(xpdfKeyCodeMousePress5, xpdfKeyModCtrl,
  ------------------
  |  |  194|  4.70k|#define xpdfKeyModCtrl            (1 << 1)
  ------------------
  976|  4.70k|				     xpdfKeyContextAny, "zoomOut"));
  ------------------
  |  |  196|  4.70k|#define xpdfKeyContextAny         0
  ------------------
  977|       |
  978|       |  //----- control keys
  979|  4.70k|  keyBindings->append(new KeyBinding('o', xpdfKeyModCtrl,
  ------------------
  |  |  194|  4.70k|#define xpdfKeyModCtrl            (1 << 1)
  ------------------
  980|  4.70k|				     xpdfKeyContextAny, "open"));
  ------------------
  |  |  196|  4.70k|#define xpdfKeyContextAny         0
  ------------------
  981|  4.70k|  keyBindings->append(new KeyBinding('r', xpdfKeyModCtrl,
  ------------------
  |  |  194|  4.70k|#define xpdfKeyModCtrl            (1 << 1)
  ------------------
  982|  4.70k|				     xpdfKeyContextAny, "reload"));
  ------------------
  |  |  196|  4.70k|#define xpdfKeyContextAny         0
  ------------------
  983|  4.70k|  keyBindings->append(new KeyBinding('f', xpdfKeyModCtrl,
  ------------------
  |  |  194|  4.70k|#define xpdfKeyModCtrl            (1 << 1)
  ------------------
  984|  4.70k|				     xpdfKeyContextAny, "find"));
  ------------------
  |  |  196|  4.70k|#define xpdfKeyContextAny         0
  ------------------
  985|  4.70k|  keyBindings->append(new KeyBinding('g', xpdfKeyModCtrl,
  ------------------
  |  |  194|  4.70k|#define xpdfKeyModCtrl            (1 << 1)
  ------------------
  986|  4.70k|				     xpdfKeyContextAny, "findNext"));
  ------------------
  |  |  196|  4.70k|#define xpdfKeyContextAny         0
  ------------------
  987|  4.70k|  keyBindings->append(new KeyBinding('c', xpdfKeyModCtrl,
  ------------------
  |  |  194|  4.70k|#define xpdfKeyModCtrl            (1 << 1)
  ------------------
  988|  4.70k|				     xpdfKeyContextAny, "copy"));
  ------------------
  |  |  196|  4.70k|#define xpdfKeyContextAny         0
  ------------------
  989|  4.70k|  keyBindings->append(new KeyBinding('p', xpdfKeyModCtrl,
  ------------------
  |  |  194|  4.70k|#define xpdfKeyModCtrl            (1 << 1)
  ------------------
  990|  4.70k|				     xpdfKeyContextAny, "print"));
  ------------------
  |  |  196|  4.70k|#define xpdfKeyContextAny         0
  ------------------
  991|  4.70k|  keyBindings->append(new KeyBinding('0', xpdfKeyModCtrl,
  ------------------
  |  |  194|  4.70k|#define xpdfKeyModCtrl            (1 << 1)
  ------------------
  992|  4.70k|				     xpdfKeyContextAny, "zoomPercent(125)"));
  ------------------
  |  |  196|  4.70k|#define xpdfKeyContextAny         0
  ------------------
  993|  4.70k|  keyBindings->append(new KeyBinding('+', xpdfKeyModCtrl,
  ------------------
  |  |  194|  4.70k|#define xpdfKeyModCtrl            (1 << 1)
  ------------------
  994|  4.70k|				     xpdfKeyContextAny, "zoomIn"));
  ------------------
  |  |  196|  4.70k|#define xpdfKeyContextAny         0
  ------------------
  995|  4.70k|  keyBindings->append(new KeyBinding('=', xpdfKeyModCtrl,
  ------------------
  |  |  194|  4.70k|#define xpdfKeyModCtrl            (1 << 1)
  ------------------
  996|  4.70k|				     xpdfKeyContextAny, "zoomIn"));
  ------------------
  |  |  196|  4.70k|#define xpdfKeyContextAny         0
  ------------------
  997|  4.70k|  keyBindings->append(new KeyBinding('-', xpdfKeyModCtrl,
  ------------------
  |  |  194|  4.70k|#define xpdfKeyModCtrl            (1 << 1)
  ------------------
  998|  4.70k|				     xpdfKeyContextAny, "zoomOut"));
  ------------------
  |  |  196|  4.70k|#define xpdfKeyContextAny         0
  ------------------
  999|  4.70k|  keyBindings->append(new KeyBinding('s', xpdfKeyModCtrl,
  ------------------
  |  |  194|  4.70k|#define xpdfKeyModCtrl            (1 << 1)
  ------------------
 1000|  4.70k|				     xpdfKeyContextAny, "saveAs"));
  ------------------
  |  |  196|  4.70k|#define xpdfKeyContextAny         0
  ------------------
 1001|  4.70k|  keyBindings->append(new KeyBinding('t', xpdfKeyModCtrl,
  ------------------
  |  |  194|  4.70k|#define xpdfKeyModCtrl            (1 << 1)
  ------------------
 1002|  4.70k|				     xpdfKeyContextAny, "newTab"));
  ------------------
  |  |  196|  4.70k|#define xpdfKeyContextAny         0
  ------------------
 1003|  4.70k|  keyBindings->append(new KeyBinding('n', xpdfKeyModCtrl,
  ------------------
  |  |  194|  4.70k|#define xpdfKeyModCtrl            (1 << 1)
  ------------------
 1004|  4.70k|				     xpdfKeyContextAny, "newWindow"));
  ------------------
  |  |  196|  4.70k|#define xpdfKeyContextAny         0
  ------------------
 1005|  4.70k|  keyBindings->append(new KeyBinding('w', xpdfKeyModCtrl,
  ------------------
  |  |  194|  4.70k|#define xpdfKeyModCtrl            (1 << 1)
  ------------------
 1006|  4.70k|				     xpdfKeyContextAny, "closeTabOrQuit"));
  ------------------
  |  |  196|  4.70k|#define xpdfKeyContextAny         0
  ------------------
 1007|  4.70k|  keyBindings->append(new KeyBinding('l', xpdfKeyModCtrl,
  ------------------
  |  |  194|  4.70k|#define xpdfKeyModCtrl            (1 << 1)
  ------------------
 1008|  4.70k|				     xpdfKeyContextAny,
  ------------------
  |  |  196|  4.70k|#define xpdfKeyContextAny         0
  ------------------
 1009|  4.70k|				     "toggleFullScreenMode"));
 1010|  4.70k|  keyBindings->append(new KeyBinding('q', xpdfKeyModCtrl,
  ------------------
  |  |  194|  4.70k|#define xpdfKeyModCtrl            (1 << 1)
  ------------------
 1011|  4.70k|				     xpdfKeyContextAny, "quit"));
  ------------------
  |  |  196|  4.70k|#define xpdfKeyContextAny         0
  ------------------
 1012|  4.70k|  keyBindings->append(new KeyBinding(xpdfKeyCodeTab, xpdfKeyModCtrl,
  ------------------
  |  |  130|  4.70k|#define xpdfKeyCodeTab                0x1000
  ------------------
                keyBindings->append(new KeyBinding(xpdfKeyCodeTab, xpdfKeyModCtrl,
  ------------------
  |  |  194|  4.70k|#define xpdfKeyModCtrl            (1 << 1)
  ------------------
 1013|  4.70k|				     xpdfKeyContextAny, "nextTab"));
  ------------------
  |  |  196|  4.70k|#define xpdfKeyContextAny         0
  ------------------
 1014|  4.70k|  keyBindings->append(new KeyBinding(xpdfKeyCodeTab,
  ------------------
  |  |  130|  4.70k|#define xpdfKeyCodeTab                0x1000
  ------------------
 1015|  4.70k|				     xpdfKeyModShift | xpdfKeyModCtrl,
  ------------------
  |  |  193|  4.70k|#define xpdfKeyModShift           (1 << 0)
  ------------------
              				     xpdfKeyModShift | xpdfKeyModCtrl,
  ------------------
  |  |  194|  4.70k|#define xpdfKeyModCtrl            (1 << 1)
  ------------------
 1016|  4.70k|				     xpdfKeyContextAny, "prevTab"));
  ------------------
  |  |  196|  4.70k|#define xpdfKeyContextAny         0
  ------------------
 1017|  4.70k|  keyBindings->append(new KeyBinding('?', xpdfKeyModCtrl,
  ------------------
  |  |  194|  4.70k|#define xpdfKeyModCtrl            (1 << 1)
  ------------------
 1018|  4.70k|				     xpdfKeyContextAny, "help"));
  ------------------
  |  |  196|  4.70k|#define xpdfKeyContextAny         0
  ------------------
 1019|       |
 1020|       |  //----- alt keys
 1021|  4.70k|  keyBindings->append(new KeyBinding(xpdfKeyCodeLeft, xpdfKeyModAlt,
  ------------------
  |  |  141|  4.70k|#define xpdfKeyCodeLeft               0x100b
  ------------------
                keyBindings->append(new KeyBinding(xpdfKeyCodeLeft, xpdfKeyModAlt,
  ------------------
  |  |  195|  4.70k|#define xpdfKeyModAlt             (1 << 2)
  ------------------
 1022|  4.70k|				     xpdfKeyContextAny, "goBackward"));
  ------------------
  |  |  196|  4.70k|#define xpdfKeyContextAny         0
  ------------------
 1023|  4.70k|  keyBindings->append(new KeyBinding(xpdfKeyCodeRight, xpdfKeyModAlt,
  ------------------
  |  |  142|  4.70k|#define xpdfKeyCodeRight              0x100c
  ------------------
                keyBindings->append(new KeyBinding(xpdfKeyCodeRight, xpdfKeyModAlt,
  ------------------
  |  |  195|  4.70k|#define xpdfKeyModAlt             (1 << 2)
  ------------------
 1024|  4.70k|				     xpdfKeyContextAny, "goForward"));
  ------------------
  |  |  196|  4.70k|#define xpdfKeyContextAny         0
  ------------------
 1025|       |
 1026|       |  //----- home/end keys
 1027|  4.70k|  keyBindings->append(new KeyBinding(xpdfKeyCodeHome, xpdfKeyModCtrl,
  ------------------
  |  |  137|  4.70k|#define xpdfKeyCodeHome               0x1007
  ------------------
                keyBindings->append(new KeyBinding(xpdfKeyCodeHome, xpdfKeyModCtrl,
  ------------------
  |  |  194|  4.70k|#define xpdfKeyModCtrl            (1 << 1)
  ------------------
 1028|  4.70k|				     xpdfKeyContextAny, "gotoPage(1)"));
  ------------------
  |  |  196|  4.70k|#define xpdfKeyContextAny         0
  ------------------
 1029|  4.70k|  keyBindings->append(new KeyBinding(xpdfKeyCodeHome, xpdfKeyModNone,
  ------------------
  |  |  137|  4.70k|#define xpdfKeyCodeHome               0x1007
  ------------------
                keyBindings->append(new KeyBinding(xpdfKeyCodeHome, xpdfKeyModNone,
  ------------------
  |  |  192|  4.70k|#define xpdfKeyModNone            0
  ------------------
 1030|  4.70k|				     xpdfKeyContextAny, "scrollToTopLeft"));
  ------------------
  |  |  196|  4.70k|#define xpdfKeyContextAny         0
  ------------------
 1031|  4.70k|  keyBindings->append(new KeyBinding(xpdfKeyCodeEnd, xpdfKeyModCtrl,
  ------------------
  |  |  138|  4.70k|#define xpdfKeyCodeEnd                0x1008
  ------------------
                keyBindings->append(new KeyBinding(xpdfKeyCodeEnd, xpdfKeyModCtrl,
  ------------------
  |  |  194|  4.70k|#define xpdfKeyModCtrl            (1 << 1)
  ------------------
 1032|  4.70k|				     xpdfKeyContextAny, "gotoLastPage"));
  ------------------
  |  |  196|  4.70k|#define xpdfKeyContextAny         0
  ------------------
 1033|  4.70k|  keyBindings->append(new KeyBinding(xpdfKeyCodeEnd, xpdfKeyModNone,
  ------------------
  |  |  138|  4.70k|#define xpdfKeyCodeEnd                0x1008
  ------------------
                keyBindings->append(new KeyBinding(xpdfKeyCodeEnd, xpdfKeyModNone,
  ------------------
  |  |  192|  4.70k|#define xpdfKeyModNone            0
  ------------------
 1034|  4.70k|				     xpdfKeyContextAny,
  ------------------
  |  |  196|  4.70k|#define xpdfKeyContextAny         0
  ------------------
 1035|  4.70k|				     "scrollToBottomRight"));
 1036|       |
 1037|       |  //----- pgup/pgdn keys
 1038|  4.70k|  keyBindings->append(new KeyBinding(xpdfKeyCodePgUp, xpdfKeyModNone,
  ------------------
  |  |  139|  4.70k|#define xpdfKeyCodePgUp               0x1009
  ------------------
                keyBindings->append(new KeyBinding(xpdfKeyCodePgUp, xpdfKeyModNone,
  ------------------
  |  |  192|  4.70k|#define xpdfKeyModNone            0
  ------------------
 1039|  4.70k|				     xpdfKeyContextAny, "pageUp"));
  ------------------
  |  |  196|  4.70k|#define xpdfKeyContextAny         0
  ------------------
 1040|  4.70k|  keyBindings->append(new KeyBinding(xpdfKeyCodePgDn, xpdfKeyModNone,
  ------------------
  |  |  140|  4.70k|#define xpdfKeyCodePgDn               0x100a
  ------------------
                keyBindings->append(new KeyBinding(xpdfKeyCodePgDn, xpdfKeyModNone,
  ------------------
  |  |  192|  4.70k|#define xpdfKeyModNone            0
  ------------------
 1041|  4.70k|				     xpdfKeyContextAny, "pageDown"));
  ------------------
  |  |  196|  4.70k|#define xpdfKeyContextAny         0
  ------------------
 1042|  4.70k|  keyBindings->append(new KeyBinding(xpdfKeyCodePgUp, xpdfKeyModCtrl,
  ------------------
  |  |  139|  4.70k|#define xpdfKeyCodePgUp               0x1009
  ------------------
                keyBindings->append(new KeyBinding(xpdfKeyCodePgUp, xpdfKeyModCtrl,
  ------------------
  |  |  194|  4.70k|#define xpdfKeyModCtrl            (1 << 1)
  ------------------
 1043|  4.70k|				     xpdfKeyContextAny, "prevPage"));
  ------------------
  |  |  196|  4.70k|#define xpdfKeyContextAny         0
  ------------------
 1044|  4.70k|  keyBindings->append(new KeyBinding(xpdfKeyCodePgDn, xpdfKeyModCtrl,
  ------------------
  |  |  140|  4.70k|#define xpdfKeyCodePgDn               0x100a
  ------------------
                keyBindings->append(new KeyBinding(xpdfKeyCodePgDn, xpdfKeyModCtrl,
  ------------------
  |  |  194|  4.70k|#define xpdfKeyModCtrl            (1 << 1)
  ------------------
 1045|  4.70k|				     xpdfKeyContextAny, "nextPage"));
  ------------------
  |  |  196|  4.70k|#define xpdfKeyContextAny         0
  ------------------
 1046|  4.70k|  keyBindings->append(new KeyBinding(xpdfKeyCodePgUp, xpdfKeyModCtrl,
  ------------------
  |  |  139|  4.70k|#define xpdfKeyCodePgUp               0x1009
  ------------------
                keyBindings->append(new KeyBinding(xpdfKeyCodePgUp, xpdfKeyModCtrl,
  ------------------
  |  |  194|  4.70k|#define xpdfKeyModCtrl            (1 << 1)
  ------------------
 1047|  4.70k|				     xpdfKeyContextScrLockOn,
  ------------------
  |  |  205|  4.70k|#define xpdfKeyContextScrLockOn   (1 << 8)
  ------------------
 1048|  4.70k|				     "prevPageNoScroll"));
 1049|  4.70k|  keyBindings->append(new KeyBinding(xpdfKeyCodePgDn, xpdfKeyModCtrl,
  ------------------
  |  |  140|  4.70k|#define xpdfKeyCodePgDn               0x100a
  ------------------
                keyBindings->append(new KeyBinding(xpdfKeyCodePgDn, xpdfKeyModCtrl,
  ------------------
  |  |  194|  4.70k|#define xpdfKeyModCtrl            (1 << 1)
  ------------------
 1050|  4.70k|				     xpdfKeyContextScrLockOn,
  ------------------
  |  |  205|  4.70k|#define xpdfKeyContextScrLockOn   (1 << 8)
  ------------------
 1051|  4.70k|				     "nextPageNoScroll"));
 1052|       |
 1053|       |  //----- esc key
 1054|  4.70k|  keyBindings->append(new KeyBinding(xpdfKeyCodeEsc, xpdfKeyModNone,
  ------------------
  |  |  134|  4.70k|#define xpdfKeyCodeEsc                0x1004
  ------------------
                keyBindings->append(new KeyBinding(xpdfKeyCodeEsc, xpdfKeyModNone,
  ------------------
  |  |  192|  4.70k|#define xpdfKeyModNone            0
  ------------------
 1055|  4.70k|				     xpdfKeyContextFullScreen,
  ------------------
  |  |  197|  4.70k|#define xpdfKeyContextFullScreen  (1 << 0)
  ------------------
 1056|  4.70k|				     "windowMode"));
 1057|       |
 1058|       |  //----- arrow keys
 1059|  4.70k|  keyBindings->append(new KeyBinding(xpdfKeyCodeLeft, xpdfKeyModNone,
  ------------------
  |  |  141|  4.70k|#define xpdfKeyCodeLeft               0x100b
  ------------------
                keyBindings->append(new KeyBinding(xpdfKeyCodeLeft, xpdfKeyModNone,
  ------------------
  |  |  192|  4.70k|#define xpdfKeyModNone            0
  ------------------
 1060|  4.70k|				     xpdfKeyContextAny, "scrollLeft(16)"));
  ------------------
  |  |  196|  4.70k|#define xpdfKeyContextAny         0
  ------------------
 1061|  4.70k|  keyBindings->append(new KeyBinding(xpdfKeyCodeRight, xpdfKeyModNone,
  ------------------
  |  |  142|  4.70k|#define xpdfKeyCodeRight              0x100c
  ------------------
                keyBindings->append(new KeyBinding(xpdfKeyCodeRight, xpdfKeyModNone,
  ------------------
  |  |  192|  4.70k|#define xpdfKeyModNone            0
  ------------------
 1062|  4.70k|				     xpdfKeyContextAny, "scrollRight(16)"));
  ------------------
  |  |  196|  4.70k|#define xpdfKeyContextAny         0
  ------------------
 1063|  4.70k|  keyBindings->append(new KeyBinding(xpdfKeyCodeUp, xpdfKeyModNone,
  ------------------
  |  |  143|  4.70k|#define xpdfKeyCodeUp                 0x100d
  ------------------
                keyBindings->append(new KeyBinding(xpdfKeyCodeUp, xpdfKeyModNone,
  ------------------
  |  |  192|  4.70k|#define xpdfKeyModNone            0
  ------------------
 1064|  4.70k|				     xpdfKeyContextAny, "scrollUp(16)"));
  ------------------
  |  |  196|  4.70k|#define xpdfKeyContextAny         0
  ------------------
 1065|  4.70k|  keyBindings->append(new KeyBinding(xpdfKeyCodeDown, xpdfKeyModNone,
  ------------------
  |  |  144|  4.70k|#define xpdfKeyCodeDown               0x100e
  ------------------
                keyBindings->append(new KeyBinding(xpdfKeyCodeDown, xpdfKeyModNone,
  ------------------
  |  |  192|  4.70k|#define xpdfKeyModNone            0
  ------------------
 1066|  4.70k|				     xpdfKeyContextAny, "scrollDown(16)"));
  ------------------
  |  |  196|  4.70k|#define xpdfKeyContextAny         0
  ------------------
 1067|  4.70k|  keyBindings->append(new KeyBinding(xpdfKeyCodeUp, xpdfKeyModCtrl,
  ------------------
  |  |  143|  4.70k|#define xpdfKeyCodeUp                 0x100d
  ------------------
                keyBindings->append(new KeyBinding(xpdfKeyCodeUp, xpdfKeyModCtrl,
  ------------------
  |  |  194|  4.70k|#define xpdfKeyModCtrl            (1 << 1)
  ------------------
 1068|  4.70k|				     xpdfKeyContextAny, "prevPage"));
  ------------------
  |  |  196|  4.70k|#define xpdfKeyContextAny         0
  ------------------
 1069|  4.70k|  keyBindings->append(new KeyBinding(xpdfKeyCodeDown, xpdfKeyModCtrl,
  ------------------
  |  |  144|  4.70k|#define xpdfKeyCodeDown               0x100e
  ------------------
                keyBindings->append(new KeyBinding(xpdfKeyCodeDown, xpdfKeyModCtrl,
  ------------------
  |  |  194|  4.70k|#define xpdfKeyModCtrl            (1 << 1)
  ------------------
 1070|  4.70k|				     xpdfKeyContextAny, "nextPage"));
  ------------------
  |  |  196|  4.70k|#define xpdfKeyContextAny         0
  ------------------
 1071|  4.70k|  keyBindings->append(new KeyBinding(xpdfKeyCodeUp, xpdfKeyModCtrl,
  ------------------
  |  |  143|  4.70k|#define xpdfKeyCodeUp                 0x100d
  ------------------
                keyBindings->append(new KeyBinding(xpdfKeyCodeUp, xpdfKeyModCtrl,
  ------------------
  |  |  194|  4.70k|#define xpdfKeyModCtrl            (1 << 1)
  ------------------
 1072|  4.70k|				     xpdfKeyContextScrLockOn,
  ------------------
  |  |  205|  4.70k|#define xpdfKeyContextScrLockOn   (1 << 8)
  ------------------
 1073|  4.70k|				     "prevPageNoScroll"));
 1074|  4.70k|  keyBindings->append(new KeyBinding(xpdfKeyCodeDown, xpdfKeyModCtrl,
  ------------------
  |  |  144|  4.70k|#define xpdfKeyCodeDown               0x100e
  ------------------
                keyBindings->append(new KeyBinding(xpdfKeyCodeDown, xpdfKeyModCtrl,
  ------------------
  |  |  194|  4.70k|#define xpdfKeyModCtrl            (1 << 1)
  ------------------
 1075|  4.70k|				     xpdfKeyContextScrLockOn,
  ------------------
  |  |  205|  4.70k|#define xpdfKeyContextScrLockOn   (1 << 8)
  ------------------
 1076|  4.70k|				     "nextPageNoScroll"));
 1077|       |
 1078|       |  //----- letter keys
 1079|  4.70k|  keyBindings->append(new KeyBinding(' ', xpdfKeyModNone,
  ------------------
  |  |  192|  4.70k|#define xpdfKeyModNone            0
  ------------------
 1080|  4.70k|				     xpdfKeyContextAny, "pageDown"));
  ------------------
  |  |  196|  4.70k|#define xpdfKeyContextAny         0
  ------------------
 1081|  4.70k|  keyBindings->append(new KeyBinding('g', xpdfKeyModNone,
  ------------------
  |  |  192|  4.70k|#define xpdfKeyModNone            0
  ------------------
 1082|  4.70k|				     xpdfKeyContextAny, "focusToPageNum"));
  ------------------
  |  |  196|  4.70k|#define xpdfKeyContextAny         0
  ------------------
 1083|  4.70k|  keyBindings->append(new KeyBinding('z', xpdfKeyModNone,
  ------------------
  |  |  192|  4.70k|#define xpdfKeyModNone            0
  ------------------
 1084|  4.70k|				     xpdfKeyContextAny, "zoomFitPage"));
  ------------------
  |  |  196|  4.70k|#define xpdfKeyContextAny         0
  ------------------
 1085|  4.70k|  keyBindings->append(new KeyBinding('w', xpdfKeyModNone,
  ------------------
  |  |  192|  4.70k|#define xpdfKeyModNone            0
  ------------------
 1086|  4.70k|				     xpdfKeyContextAny, "zoomFitWidth"));
  ------------------
  |  |  196|  4.70k|#define xpdfKeyContextAny         0
  ------------------
 1087|  4.70k|}
_ZN12GlobalParams18initStateFilePathsEv:
 1089|  4.70k|void GlobalParams::initStateFilePaths() {
 1090|       |#ifdef _WIN32
 1091|       |  // Windows state files are {APPDATA}/xpdf/xpdf.pages etc
 1092|       |  char path[MAX_PATH];
 1093|       |  if (SHGetFolderPathA(NULL, CSIDL_APPDATA, NULL,
 1094|       |		       SHGFP_TYPE_CURRENT, path) != S_OK) {
 1095|       |    return;
 1096|       |  }
 1097|       |  GString *stateDir = appendToPath(new GString(path), "xpdf");
 1098|       |  CreateDirectoryA(stateDir->getCString(), NULL);
 1099|       |  pagesFile = appendToPath(stateDir->copy(), "xpdf.pages");
 1100|       |  tabStateFile = appendToPath(stateDir->copy(), "xpdf.tab-state");
 1101|       |  sessionFile = appendToPath(stateDir, "xpdf.session");
 1102|       |#elif USE_XDG
 1103|       |  // XDG state files are {XDG_STATE}/xpdf/pages etc
 1104|  4.70k|  char *path = getenv("XDG_STATE_HOME");
 1105|  4.70k|  GString *stateDir;
 1106|  4.70k|  if (path) {
  ------------------
  |  Branch (1106:7): [True: 0, False: 4.70k]
  ------------------
 1107|      0|    stateDir = new GString(path);
 1108|  4.70k|  } else {
 1109|  4.70k|    stateDir = appendToPath(getHomeDir(), ".local/state");
 1110|  4.70k|  }
 1111|  4.70k|  createDir(stateDir->getCString(), 0700);
 1112|  4.70k|  appendToPath(stateDir, "xpdf");
 1113|  4.70k|  createDir(stateDir->getCString(), 0700);
 1114|  4.70k|  pagesFile = appendToPath(stateDir->copy(), "pages");
 1115|  4.70k|  tabStateFile = appendToPath(stateDir->copy(), "tab-state");
 1116|  4.70k|  sessionFile = appendToPath(stateDir, "session");
 1117|       |#else
 1118|       |  // Unix (non-XDG) state files are ~/.xpdf.pages etc
 1119|       |  GString *stateDir = getHomeDir();
 1120|       |  pagesFile = appendToPath(stateDir->copy(), ".xpdf.pages");
 1121|       |  tabStateFile = appendToPath(stateDir->copy(), ".xpdf.tab-state");
 1122|       |  sessionFile = appendToPath(stateDir, ".xpdf.session");
 1123|       |#endif
 1124|  4.70k|}
_ZN12GlobalParams14openConfigFileEPKcPP7GString:
 1128|  4.70k|				   GString **fileName) {
 1129|  4.70k|  FILE *f = NULL;
 1130|  4.70k|  GString *actualName = NULL;
 1131|       |
 1132|       |  //--- try the path specified on the command line
 1133|  4.70k|  if (cfgFileName && cfgFileName[0]) {
  ------------------
  |  Branch (1133:7): [True: 0, False: 4.70k]
  |  Branch (1133:22): [True: 0, False: 0]
  ------------------
 1134|      0|    actualName = new GString(cfgFileName);
 1135|      0|    if (!(f = fopen(actualName->getCString(), "r"))) {
  ------------------
  |  Branch (1135:9): [True: 0, False: 0]
  ------------------
 1136|      0|      delete actualName;
 1137|      0|    }
 1138|      0|  }
 1139|       |
 1140|       |  //--- try the XDG config path: {XDG_CONFIG}/xpdf/xpdfrc
 1141|  4.70k|#if USE_XDG
 1142|  4.70k|  if (!f) {
  ------------------
  |  Branch (1142:7): [True: 4.70k, False: 0]
  ------------------
 1143|  4.70k|    char *path = getenv("XDG_CONFIG_HOME");
 1144|  4.70k|    if (path) {
  ------------------
  |  Branch (1144:9): [True: 0, False: 4.70k]
  ------------------
 1145|      0|      actualName = new GString(path);
 1146|  4.70k|    } else {
 1147|  4.70k|      actualName = appendToPath(getHomeDir(), ".config");
 1148|  4.70k|    }
 1149|  4.70k|    appendToPath(actualName, "xpdf/xpdfrc");
 1150|  4.70k|    if (!(f = fopen(actualName->getCString(), "r"))) {
  ------------------
  |  Branch (1150:9): [True: 4.70k, False: 0]
  ------------------
 1151|  4.70k|      delete actualName;
 1152|  4.70k|    }
 1153|  4.70k|  }
 1154|  4.70k|#endif
 1155|       |
 1156|       |#ifdef _WIN32
 1157|       |  //--- try the Windows user path: {APPDATA}/xpdf/xpdfrc
 1158|       |  if (!f) {
 1159|       |    char path[MAX_PATH];
 1160|       |    if (SHGetFolderPathA(NULL, CSIDL_APPDATA, NULL, SHGFP_TYPE_CURRENT, path)
 1161|       |	== S_OK) {
 1162|       |      actualName = appendToPath(new GString(path), "xpdf/xpdfrc");
 1163|       |      if (!(f = fopen(actualName->getCString(), "r"))) {
 1164|       |	delete actualName;
 1165|       |      }
 1166|       |    }
 1167|       |  }
 1168|       |
 1169|       |#else
 1170|       |  //--- try the Unix user path: ~/.xpdfrc
 1171|  4.70k|  if (!f) {
  ------------------
  |  Branch (1171:7): [True: 4.70k, False: 0]
  ------------------
 1172|  4.70k|    actualName = appendToPath(getHomeDir(), ".xpdfrc");
 1173|  4.70k|    if (!(f = fopen(actualName->getCString(), "r"))) {
  ------------------
  |  Branch (1173:9): [True: 4.70k, False: 0]
  ------------------
 1174|  4.70k|      delete actualName;
 1175|  4.70k|    }
 1176|  4.70k|  }
 1177|  4.70k|#endif
 1178|       |
 1179|       |#ifdef _WIN32
 1180|       |  //--- try the Windows system path: {EXEDIR}/xpdfrc
 1181|       |  if (!f) {
 1182|       |    char buf[512];
 1183|       |    int i = GetModuleFileNameA(NULL, buf, sizeof(buf));
 1184|       |    if (i <= 0 || i >= sizeof(buf)) {
 1185|       |      // error or path too long for buffer - just use the current dir
 1186|       |      buf[0] = '\0';
 1187|       |    }
 1188|       |    actualName = grabPath(buf);
 1189|       |    appendToPath(actualName, "xpdfrc");
 1190|       |    if (!(f = fopen(actualName->getCString(), "r"))) {
 1191|       |      delete actualName;
 1192|       |    }
 1193|       |  }
 1194|       |
 1195|       |#else
 1196|       |  //--- try the Unix system path: {xpdfSysConfigFile}
 1197|  4.70k|  if (!f) {
  ------------------
  |  Branch (1197:7): [True: 4.70k, False: 0]
  ------------------
 1198|  4.70k|    actualName = new GString(xpdfSysConfigFile);
  ------------------
  |  |   58|  4.70k|#define xpdfSysConfigFile "/etc/xpdfrc"
  ------------------
 1199|  4.70k|    if (!(f = fopen(actualName->getCString(), "r"))) {
  ------------------
  |  Branch (1199:9): [True: 4.70k, False: 0]
  ------------------
 1200|  4.70k|      delete actualName;
 1201|  4.70k|    }
 1202|  4.70k|  }
 1203|  4.70k|#endif
 1204|       |
 1205|  4.70k|  if (f) {
  ------------------
  |  Branch (1205:7): [True: 0, False: 4.70k]
  ------------------
 1206|      0|    *fileName = actualName;
 1207|  4.70k|  } else {
 1208|       |    *fileName = NULL;
 1209|  4.70k|  }
 1210|  4.70k|  return f;
 1211|  4.70k|}
_ZN12GlobalParams11parseYesNo2EPcPi:
 2264|  4.70k|GBool GlobalParams::parseYesNo2(char *token, GBool *flag) {
 2265|  4.70k|  if (!strcmp(token, "yes")) {
  ------------------
  |  Branch (2265:7): [True: 4.70k, False: 0]
  ------------------
 2266|  4.70k|    *flag = gTrue;
  ------------------
  |  |   17|  4.70k|#define gTrue 1
  ------------------
 2267|  4.70k|  } else if (!strcmp(token, "no")) {
  ------------------
  |  Branch (2267:14): [True: 0, False: 0]
  ------------------
 2268|      0|    *flag = gFalse;
  ------------------
  |  |   18|      0|#define gFalse 0
  ------------------
 2269|      0|  } else {
 2270|      0|    return gFalse;
  ------------------
  |  |   18|      0|#define gFalse 0
  ------------------
 2271|      0|  }
 2272|  4.70k|  return gTrue;
  ------------------
  |  |   17|  4.70k|#define gTrue 1
  ------------------
 2273|  4.70k|}
_ZN12GlobalParamsD2Ev:
 2351|  4.70k|GlobalParams::~GlobalParams() {
 2352|  4.70k|  GHashIter *iter;
 2353|  4.70k|  GString *key;
 2354|  4.70k|  GList *list;
 2355|       |
 2356|  4.70k|  freeBuiltinFontTables();
 2357|       |
 2358|  4.70k|  delete macRomanReverseMap;
 2359|       |
 2360|  4.70k|  delete baseDir;
 2361|  4.70k|  deleteGHash(configFileVars, GString);
  ------------------
  |  |   60|  4.70k|  do {                                             \
  |  |   61|  4.70k|    GHash *_hash = (hash);                         \
  |  |   62|  4.70k|    {                                              \
  |  |   63|  4.70k|      GHashIter *_iter;                            \
  |  |   64|  4.70k|      GString *_key;                               \
  |  |   65|  4.70k|      void *_p;                                    \
  |  |   66|  4.70k|      _hash->startIter(&_iter);                    \
  |  |   67|  9.40k|      while (_hash->getNext(&_iter, &_key, &_p)) { \
  |  |  ------------------
  |  |  |  Branch (67:14): [True: 4.70k, False: 4.70k]
  |  |  ------------------
  |  |   68|  4.70k|        delete (T*)_p;                             \
  |  |   69|  4.70k|      }                                            \
  |  |   70|  4.70k|      delete _hash;                                \
  |  |   71|  4.70k|    }                                              \
  |  |   72|  4.70k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (72:11): [Folded, False: 4.70k]
  |  |  ------------------
  ------------------
 2362|  4.70k|  delete nameToUnicode;
 2363|  4.70k|  deleteGHash(cidToUnicodes, GString);
  ------------------
  |  |   60|  4.70k|  do {                                             \
  |  |   61|  4.70k|    GHash *_hash = (hash);                         \
  |  |   62|  4.70k|    {                                              \
  |  |   63|  4.70k|      GHashIter *_iter;                            \
  |  |   64|  4.70k|      GString *_key;                               \
  |  |   65|  4.70k|      void *_p;                                    \
  |  |   66|  4.70k|      _hash->startIter(&_iter);                    \
  |  |   67|  4.70k|      while (_hash->getNext(&_iter, &_key, &_p)) { \
  |  |  ------------------
  |  |  |  Branch (67:14): [True: 0, False: 4.70k]
  |  |  ------------------
  |  |   68|      0|        delete (T*)_p;                             \
  |  |   69|      0|      }                                            \
  |  |   70|  4.70k|      delete _hash;                                \
  |  |   71|  4.70k|    }                                              \
  |  |   72|  4.70k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (72:11): [Folded, False: 4.70k]
  |  |  ------------------
  ------------------
 2364|  4.70k|  deleteGHash(unicodeToUnicodes, GString);
  ------------------
  |  |   60|  4.70k|  do {                                             \
  |  |   61|  4.70k|    GHash *_hash = (hash);                         \
  |  |   62|  4.70k|    {                                              \
  |  |   63|  4.70k|      GHashIter *_iter;                            \
  |  |   64|  4.70k|      GString *_key;                               \
  |  |   65|  4.70k|      void *_p;                                    \
  |  |   66|  4.70k|      _hash->startIter(&_iter);                    \
  |  |   67|  4.70k|      while (_hash->getNext(&_iter, &_key, &_p)) { \
  |  |  ------------------
  |  |  |  Branch (67:14): [True: 0, False: 4.70k]
  |  |  ------------------
  |  |   68|      0|        delete (T*)_p;                             \
  |  |   69|      0|      }                                            \
  |  |   70|  4.70k|      delete _hash;                                \
  |  |   71|  4.70k|    }                                              \
  |  |   72|  4.70k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (72:11): [Folded, False: 4.70k]
  |  |  ------------------
  ------------------
 2365|  4.70k|  deleteGHash(residentUnicodeMaps, UnicodeMap);
  ------------------
  |  |   60|  4.70k|  do {                                             \
  |  |   61|  4.70k|    GHash *_hash = (hash);                         \
  |  |   62|  4.70k|    {                                              \
  |  |   63|  4.70k|      GHashIter *_iter;                            \
  |  |   64|  4.70k|      GString *_key;                               \
  |  |   65|  4.70k|      void *_p;                                    \
  |  |   66|  4.70k|      _hash->startIter(&_iter);                    \
  |  |   67|  32.9k|      while (_hash->getNext(&_iter, &_key, &_p)) { \
  |  |  ------------------
  |  |  |  Branch (67:14): [True: 28.2k, False: 4.70k]
  |  |  ------------------
  |  |   68|  28.2k|        delete (T*)_p;                             \
  |  |   69|  28.2k|      }                                            \
  |  |   70|  4.70k|      delete _hash;                                \
  |  |   71|  4.70k|    }                                              \
  |  |   72|  4.70k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (72:11): [Folded, False: 4.70k]
  |  |  ------------------
  ------------------
 2366|  4.70k|  deleteGHash(unicodeMaps, GString);
  ------------------
  |  |   60|  4.70k|  do {                                             \
  |  |   61|  4.70k|    GHash *_hash = (hash);                         \
  |  |   62|  4.70k|    {                                              \
  |  |   63|  4.70k|      GHashIter *_iter;                            \
  |  |   64|  4.70k|      GString *_key;                               \
  |  |   65|  4.70k|      void *_p;                                    \
  |  |   66|  4.70k|      _hash->startIter(&_iter);                    \
  |  |   67|  4.70k|      while (_hash->getNext(&_iter, &_key, &_p)) { \
  |  |  ------------------
  |  |  |  Branch (67:14): [True: 0, False: 4.70k]
  |  |  ------------------
  |  |   68|      0|        delete (T*)_p;                             \
  |  |   69|      0|      }                                            \
  |  |   70|  4.70k|      delete _hash;                                \
  |  |   71|  4.70k|    }                                              \
  |  |   72|  4.70k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (72:11): [Folded, False: 4.70k]
  |  |  ------------------
  ------------------
 2367|  4.70k|  deleteGList(toUnicodeDirs, GString);
  ------------------
  |  |   94|  4.70k|  do {                                              \
  |  |   95|  4.70k|    GList *_list = (list);                          \
  |  |   96|  4.70k|    {                                               \
  |  |   97|  4.70k|      int _i;                                       \
  |  |   98|  4.70k|      for (_i = 0; _i < _list->getLength(); ++_i) { \
  |  |  ------------------
  |  |  |  Branch (98:20): [True: 0, False: 4.70k]
  |  |  ------------------
  |  |   99|      0|        delete (T*)_list->get(_i);                  \
  |  |  100|      0|      }                                             \
  |  |  101|  4.70k|      delete _list;                                 \
  |  |  102|  4.70k|    }                                               \
  |  |  103|  4.70k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (103:12): [Folded, False: 4.70k]
  |  |  ------------------
  ------------------
 2368|  4.70k|  delete unicodeRemapping;
 2369|  4.70k|  deleteGHash(fontFiles, GString);
  ------------------
  |  |   60|  4.70k|  do {                                             \
  |  |   61|  4.70k|    GHash *_hash = (hash);                         \
  |  |   62|  4.70k|    {                                              \
  |  |   63|  4.70k|      GHashIter *_iter;                            \
  |  |   64|  4.70k|      GString *_key;                               \
  |  |   65|  4.70k|      void *_p;                                    \
  |  |   66|  4.70k|      _hash->startIter(&_iter);                    \
  |  |   67|  4.70k|      while (_hash->getNext(&_iter, &_key, &_p)) { \
  |  |  ------------------
  |  |  |  Branch (67:14): [True: 0, False: 4.70k]
  |  |  ------------------
  |  |   68|      0|        delete (T*)_p;                             \
  |  |   69|      0|      }                                            \
  |  |   70|  4.70k|      delete _hash;                                \
  |  |   71|  4.70k|    }                                              \
  |  |   72|  4.70k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (72:11): [Folded, False: 4.70k]
  |  |  ------------------
  ------------------
 2370|  4.70k|  deleteGList(fontDirs, GString);
  ------------------
  |  |   94|  4.70k|  do {                                              \
  |  |   95|  4.70k|    GList *_list = (list);                          \
  |  |   96|  4.70k|    {                                               \
  |  |   97|  4.70k|      int _i;                                       \
  |  |   98|  4.70k|      for (_i = 0; _i < _list->getLength(); ++_i) { \
  |  |  ------------------
  |  |  |  Branch (98:20): [True: 0, False: 4.70k]
  |  |  ------------------
  |  |   99|      0|        delete (T*)_list->get(_i);                  \
  |  |  100|      0|      }                                             \
  |  |  101|  4.70k|      delete _list;                                 \
  |  |  102|  4.70k|    }                                               \
  |  |  103|  4.70k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (103:12): [Folded, False: 4.70k]
  |  |  ------------------
  ------------------
 2371|  4.70k|  deleteGHash(ccFontFiles, GString);
  ------------------
  |  |   60|  4.70k|  do {                                             \
  |  |   61|  4.70k|    GHash *_hash = (hash);                         \
  |  |   62|  4.70k|    {                                              \
  |  |   63|  4.70k|      GHashIter *_iter;                            \
  |  |   64|  4.70k|      GString *_key;                               \
  |  |   65|  4.70k|      void *_p;                                    \
  |  |   66|  4.70k|      _hash->startIter(&_iter);                    \
  |  |   67|  4.70k|      while (_hash->getNext(&_iter, &_key, &_p)) { \
  |  |  ------------------
  |  |  |  Branch (67:14): [True: 0, False: 4.70k]
  |  |  ------------------
  |  |   68|      0|        delete (T*)_p;                             \
  |  |   69|      0|      }                                            \
  |  |   70|  4.70k|      delete _hash;                                \
  |  |   71|  4.70k|    }                                              \
  |  |   72|  4.70k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (72:11): [Folded, False: 4.70k]
  |  |  ------------------
  ------------------
 2372|  4.70k|  deleteGHash(base14SysFonts, Base14FontInfo);
  ------------------
  |  |   60|  4.70k|  do {                                             \
  |  |   61|  4.70k|    GHash *_hash = (hash);                         \
  |  |   62|  4.70k|    {                                              \
  |  |   63|  4.70k|      GHashIter *_iter;                            \
  |  |   64|  4.70k|      GString *_key;                               \
  |  |   65|  4.70k|      void *_p;                                    \
  |  |   66|  4.70k|      _hash->startIter(&_iter);                    \
  |  |   67|  4.70k|      while (_hash->getNext(&_iter, &_key, &_p)) { \
  |  |  ------------------
  |  |  |  Branch (67:14): [True: 0, False: 4.70k]
  |  |  ------------------
  |  |   68|      0|        delete (T*)_p;                             \
  |  |   69|      0|      }                                            \
  |  |   70|  4.70k|      delete _hash;                                \
  |  |   71|  4.70k|    }                                              \
  |  |   72|  4.70k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (72:11): [Folded, False: 4.70k]
  |  |  ------------------
  ------------------
 2373|  4.70k|  delete sysFonts;
 2374|  4.70k|  deleteGHash(psResidentFonts, GString);
  ------------------
  |  |   60|  4.70k|  do {                                             \
  |  |   61|  4.70k|    GHash *_hash = (hash);                         \
  |  |   62|  4.70k|    {                                              \
  |  |   63|  4.70k|      GHashIter *_iter;                            \
  |  |   64|  4.70k|      GString *_key;                               \
  |  |   65|  4.70k|      void *_p;                                    \
  |  |   66|  4.70k|      _hash->startIter(&_iter);                    \
  |  |   67|  4.70k|      while (_hash->getNext(&_iter, &_key, &_p)) { \
  |  |  ------------------
  |  |  |  Branch (67:14): [True: 0, False: 4.70k]
  |  |  ------------------
  |  |   68|      0|        delete (T*)_p;                             \
  |  |   69|      0|      }                                            \
  |  |   70|  4.70k|      delete _hash;                                \
  |  |   71|  4.70k|    }                                              \
  |  |   72|  4.70k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (72:11): [Folded, False: 4.70k]
  |  |  ------------------
  ------------------
 2375|  4.70k|  deleteGList(psResidentFonts16, PSFontParam16);
  ------------------
  |  |   94|  4.70k|  do {                                              \
  |  |   95|  4.70k|    GList *_list = (list);                          \
  |  |   96|  4.70k|    {                                               \
  |  |   97|  4.70k|      int _i;                                       \
  |  |   98|  4.70k|      for (_i = 0; _i < _list->getLength(); ++_i) { \
  |  |  ------------------
  |  |  |  Branch (98:20): [True: 0, False: 4.70k]
  |  |  ------------------
  |  |   99|      0|        delete (T*)_list->get(_i);                  \
  |  |  100|      0|      }                                             \
  |  |  101|  4.70k|      delete _list;                                 \
  |  |  102|  4.70k|    }                                               \
  |  |  103|  4.70k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (103:12): [Folded, False: 4.70k]
  |  |  ------------------
  ------------------
 2376|  4.70k|  deleteGList(psResidentFontsCC, PSFontParam16);
  ------------------
  |  |   94|  4.70k|  do {                                              \
  |  |   95|  4.70k|    GList *_list = (list);                          \
  |  |   96|  4.70k|    {                                               \
  |  |   97|  4.70k|      int _i;                                       \
  |  |   98|  4.70k|      for (_i = 0; _i < _list->getLength(); ++_i) { \
  |  |  ------------------
  |  |  |  Branch (98:20): [True: 0, False: 4.70k]
  |  |  ------------------
  |  |   99|      0|        delete (T*)_list->get(_i);                  \
  |  |  100|      0|      }                                             \
  |  |  101|  4.70k|      delete _list;                                 \
  |  |  102|  4.70k|    }                                               \
  |  |  103|  4.70k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (103:12): [Folded, False: 4.70k]
  |  |  ------------------
  ------------------
 2377|  4.70k|  delete textEncoding;
 2378|  4.70k|  delete initialZoom;
 2379|  4.70k|  deleteGList(zoomValues, GString);
  ------------------
  |  |   94|  4.70k|  do {                                              \
  |  |   95|  4.70k|    GList *_list = (list);                          \
  |  |   96|  4.70k|    {                                               \
  |  |   97|  4.70k|      int _i;                                       \
  |  |   98|  65.8k|      for (_i = 0; _i < _list->getLength(); ++_i) { \
  |  |  ------------------
  |  |  |  Branch (98:20): [True: 61.1k, False: 4.70k]
  |  |  ------------------
  |  |   99|  61.1k|        delete (T*)_list->get(_i);                  \
  |  |  100|  61.1k|      }                                             \
  |  |  101|  4.70k|      delete _list;                                 \
  |  |  102|  4.70k|    }                                               \
  |  |  103|  4.70k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (103:12): [Folded, False: 4.70k]
  |  |  ------------------
  ------------------
 2380|  4.70k|  delete initialDisplayMode;
 2381|  4.70k|  delete initialSelectMode;
 2382|  4.70k|  if (paperColor) {
  ------------------
  |  Branch (2382:7): [True: 4.70k, False: 0]
  ------------------
 2383|  4.70k|    delete paperColor;
 2384|  4.70k|  }
 2385|  4.70k|  if (matteColor) {
  ------------------
  |  Branch (2385:7): [True: 4.70k, False: 0]
  ------------------
 2386|  4.70k|    delete matteColor;
 2387|  4.70k|  }
 2388|  4.70k|  if (fullScreenMatteColor) {
  ------------------
  |  Branch (2388:7): [True: 4.70k, False: 0]
  ------------------
 2389|  4.70k|    delete fullScreenMatteColor;
 2390|  4.70k|  }
 2391|  4.70k|  if (selectionColor) {
  ------------------
  |  Branch (2391:7): [True: 4.70k, False: 0]
  ------------------
 2392|  4.70k|    delete selectionColor;
 2393|  4.70k|  }
 2394|  4.70k|  if (launchCommand) {
  ------------------
  |  Branch (2394:7): [True: 0, False: 4.70k]
  ------------------
 2395|      0|    delete launchCommand;
 2396|      0|  }
 2397|  4.70k|  if (movieCommand) {
  ------------------
  |  Branch (2397:7): [True: 0, False: 4.70k]
  ------------------
 2398|      0|    delete movieCommand;
 2399|      0|  }
 2400|  4.70k|  if (defaultPrinter) {
  ------------------
  |  Branch (2400:7): [True: 0, False: 4.70k]
  ------------------
 2401|      0|    delete defaultPrinter;
 2402|      0|  }
 2403|  4.70k|  delete droppedFonts;
 2404|  4.70k|  deleteGList(keyBindings, KeyBinding);
  ------------------
  |  |   94|  4.70k|  do {                                              \
  |  |   95|  4.70k|    GList *_list = (list);                          \
  |  |   96|  4.70k|    {                                               \
  |  |   97|  4.70k|      int _i;                                       \
  |  |   98|   291k|      for (_i = 0; _i < _list->getLength(); ++_i) { \
  |  |  ------------------
  |  |  |  Branch (98:20): [True: 286k, False: 4.70k]
  |  |  ------------------
  |  |   99|   286k|        delete (T*)_list->get(_i);                  \
  |  |  100|   286k|      }                                             \
  |  |  101|  4.70k|      delete _list;                                 \
  |  |  102|  4.70k|    }                                               \
  |  |  103|  4.70k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (103:12): [Folded, False: 4.70k]
  |  |  ------------------
  ------------------
 2405|  4.70k|  deleteGList(popupMenuCmds, PopupMenuCmd);
  ------------------
  |  |   94|  4.70k|  do {                                              \
  |  |   95|  4.70k|    GList *_list = (list);                          \
  |  |   96|  4.70k|    {                                               \
  |  |   97|  4.70k|      int _i;                                       \
  |  |   98|  4.70k|      for (_i = 0; _i < _list->getLength(); ++_i) { \
  |  |  ------------------
  |  |  |  Branch (98:20): [True: 0, False: 4.70k]
  |  |  ------------------
  |  |   99|      0|        delete (T*)_list->get(_i);                  \
  |  |  100|      0|      }                                             \
  |  |  101|  4.70k|      delete _list;                                 \
  |  |  102|  4.70k|    }                                               \
  |  |  103|  4.70k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (103:12): [Folded, False: 4.70k]
  |  |  ------------------
  ------------------
 2406|  4.70k|  delete pagesFile;
 2407|  4.70k|  delete tabStateFile;
 2408|  4.70k|  delete sessionFile;
 2409|  4.70k|  delete debugLogFile;
 2410|       |
 2411|  4.70k|  cMapDirs->startIter(&iter);
 2412|  4.70k|  while (cMapDirs->getNext(&iter, &key, (void **)&list)) {
  ------------------
  |  Branch (2412:10): [True: 0, False: 4.70k]
  ------------------
 2413|      0|    deleteGList(list, GString);
  ------------------
  |  |   94|      0|  do {                                              \
  |  |   95|      0|    GList *_list = (list);                          \
  |  |   96|      0|    {                                               \
  |  |   97|      0|      int _i;                                       \
  |  |   98|      0|      for (_i = 0; _i < _list->getLength(); ++_i) { \
  |  |  ------------------
  |  |  |  Branch (98:20): [True: 0, False: 0]
  |  |  ------------------
  |  |   99|      0|        delete (T*)_list->get(_i);                  \
  |  |  100|      0|      }                                             \
  |  |  101|      0|      delete _list;                                 \
  |  |  102|      0|    }                                               \
  |  |  103|      0|  } while (0)
  |  |  ------------------
  |  |  |  Branch (103:12): [Folded, False: 0]
  |  |  ------------------
  ------------------
 2414|      0|  }
 2415|  4.70k|  delete cMapDirs;
 2416|       |
 2417|  4.70k|  delete cidToUnicodeCache;
 2418|  4.70k|  delete unicodeToUnicodeCache;
 2419|  4.70k|  delete unicodeMapCache;
 2420|  4.70k|  delete cMapCache;
 2421|       |
 2422|  4.70k|#if MULTITHREADED
 2423|  4.70k|  gDestroyMutex(&mutex);
  ------------------
  |  |   52|  4.70k|#define gDestroyMutex(m) pthread_mutex_destroy(m)
  ------------------
 2424|  4.70k|  gDestroyMutex(&unicodeMapCacheMutex);
  ------------------
  |  |   52|  4.70k|#define gDestroyMutex(m) pthread_mutex_destroy(m)
  ------------------
 2425|  4.70k|  gDestroyMutex(&cMapCacheMutex);
  ------------------
  |  |   52|  4.70k|#define gDestroyMutex(m) pthread_mutex_destroy(m)
  ------------------
 2426|  4.70k|#endif
 2427|  4.70k|}
_ZN12GlobalParams14setupBaseFontsEPKc:
 2519|  4.70k|void GlobalParams::setupBaseFonts(const char *dir) {
 2520|  4.70k|  GString *fontName;
 2521|  4.70k|  GString *fileName;
 2522|  4.70k|  int fontNum;
 2523|  4.70k|  const char *s;
 2524|  4.70k|  Base14FontInfo *base14;
 2525|       |#ifdef _WIN32
 2526|       |  char winFontDir[MAX_PATH];
 2527|       |#endif
 2528|       |#ifdef __APPLE__
 2529|       |  static const char *macFontExts[3] = { "dfont", "ttc", "ttf" };
 2530|       |  GList *dfontFontNames;
 2531|       |  GBool found;
 2532|       |  int k;
 2533|       |#endif
 2534|       |#if HAVE_FONTCONFIG
 2535|       |  SysFontInfo *fi;
 2536|       |  GString *fcName;
 2537|       |#endif
 2538|  4.70k|  FILE *f;
 2539|  4.70k|  int i, j;
 2540|       |
 2541|       |#ifdef _WIN32
 2542|       |  getWinFontDir(winFontDir);
 2543|       |#endif
 2544|       |#ifdef __APPLE__
 2545|       |  dfontFontNames = NULL;
 2546|       |#endif
 2547|       |#ifdef _WIN32
 2548|       |  if (winFontDir[0]) {
 2549|       |    sysFonts->scanWindowsFonts(winFontDir);
 2550|       |  }
 2551|       |#endif
 2552|       |#if HAVE_FONTCONFIG
 2553|       |  sysFonts->scanFontconfigFonts();
 2554|       |#endif
 2555|  70.5k|  for (i = 0; displayFontTab[i].name; ++i) {
  ------------------
  |  Branch (2555:15): [True: 65.8k, False: 4.70k]
  ------------------
 2556|  65.8k|    if (fontFiles->lookup(displayFontTab[i].name)) {
  ------------------
  |  Branch (2556:9): [True: 0, False: 65.8k]
  ------------------
 2557|      0|      continue;
 2558|      0|    }
 2559|  65.8k|    fontName = new GString(displayFontTab[i].name);
 2560|  65.8k|    fileName = NULL;
 2561|  65.8k|    fontNum = 0;
 2562|  65.8k|    if (dir) {
  ------------------
  |  Branch (2562:9): [True: 0, False: 65.8k]
  ------------------
 2563|      0|      fileName = appendToPath(new GString(dir), displayFontTab[i].t1FileName);
 2564|      0|      if ((f = fopen(fileName->getCString(), "rb"))) {
  ------------------
  |  Branch (2564:11): [True: 0, False: 0]
  ------------------
 2565|      0|	fclose(f);
 2566|      0|      } else {
 2567|      0|	delete fileName;
 2568|      0|	fileName = NULL;
 2569|      0|      }
 2570|      0|    }
 2571|       |#ifdef _WIN32
 2572|       |    if (!fileName && winFontDir[0] && displayFontTab[i].ttFileName) {
 2573|       |      fileName = appendToPath(new GString(winFontDir),
 2574|       |			      displayFontTab[i].ttFileName);
 2575|       |      if ((f = fopen(fileName->getCString(), "rb"))) {
 2576|       |	fclose(f);
 2577|       |      } else {
 2578|       |	delete fileName;
 2579|       |	fileName = NULL;
 2580|       |      }
 2581|       |    }
 2582|       |#endif
 2583|       |#ifdef __APPLE__
 2584|       |    // Check for Mac OS X system fonts.
 2585|       |    s = displayFontTab[i].macFileName;
 2586|       |    if (dfontFontNames && i > 0 &&
 2587|       |	(!s || strcmp(s, displayFontTab[i-1].macFileName))) {
 2588|       |      deleteGList(dfontFontNames, GString);
 2589|       |      dfontFontNames = NULL;
 2590|       |    }
 2591|       |    if (!fileName && s) {
 2592|       |      for (j = 0; j < 3; ++j) {
 2593|       |	fileName = GString::format("{0:s}/{1:s}.{2:s}",
 2594|       |				   macSystemFontPath, s, macFontExts[j]);
 2595|       |	if (!(f = fopen(fileName->getCString(), "rb"))) {
 2596|       |	  delete fileName;
 2597|       |	  fileName = NULL;
 2598|       |	} else {
 2599|       |	  fclose(f);
 2600|       |	  found = gFalse;
 2601|       |	  // for .dfont or .ttc, we need to scan the font list
 2602|       |	  if (j < 2) {
 2603|       |	    if (!dfontFontNames) {
 2604|       |	      dfontFontNames =
 2605|       |	          FoFiIdentifier::getFontList(fileName->getCString());
 2606|       |	    }
 2607|       |	    if (dfontFontNames) {
 2608|       |	      for (k = 0; k < dfontFontNames->getLength(); ++k) {
 2609|       |		if (macFontNameMatches((GString *)dfontFontNames->get(k),
 2610|       |				       displayFontTab[i].macFontName)) {
 2611|       |		  fontNum = k;
 2612|       |		  found = gTrue;
 2613|       |		  break;
 2614|       |		}
 2615|       |	      }
 2616|       |	    }
 2617|       |	  // for .ttf, we just use the font
 2618|       |	  } else {
 2619|       |	    found = gTrue;
 2620|       |	  }
 2621|       |	  if (!found) {
 2622|       |	    delete fileName;
 2623|       |	    fileName = NULL;
 2624|       |	  }
 2625|       |	  break;
 2626|       |	}
 2627|       |      }
 2628|       |    }
 2629|       |#endif // __APPLE__
 2630|       |#if HAVE_FONTCONFIG
 2631|       |    if (!fileName) {
 2632|       |      fcName = new GString(displayFontTab[i].fcFontName);
 2633|       |      if ((fi = sysFonts->find(fcName))) {
 2634|       |	fileName = fi->path->copy();
 2635|       |	fontNum = fi->fontNum;
 2636|       |      }
 2637|       |      delete fcName;
 2638|       |    }
 2639|       |#endif // HAVE_FONTCONFIG
 2640|       |    // On Linux, this checks the "standard" ghostscript font
 2641|       |    // directories.  On Windows, it checks the "standard" system font
 2642|       |    // directories (because SHGetSpecialFolderPath(CSIDL_FONTS)
 2643|       |    // doesn't work on Win 2k Server or Win2003 Server, or with older
 2644|       |    // versions of shell32.dll).
 2645|       |#ifdef _WIN32
 2646|       |    s = displayFontTab[i].ttFileName;
 2647|       |#else
 2648|  65.8k|    s = displayFontTab[i].t1FileName;
 2649|  65.8k|#endif
 2650|  65.8k|    if (!fileName && s) {
  ------------------
  |  Branch (2650:9): [True: 65.8k, False: 0]
  |  Branch (2650:22): [True: 65.8k, False: 0]
  ------------------
 2651|   395k|      for (j = 0; !fileName && displayFontDirs[j]; ++j) {
  ------------------
  |  Branch (2651:19): [True: 395k, False: 0]
  |  Branch (2651:32): [True: 329k, False: 65.8k]
  ------------------
 2652|   329k|	fileName = appendToPath(new GString(displayFontDirs[j]), s);
 2653|   329k|	if ((f = fopen(fileName->getCString(), "rb"))) {
  ------------------
  |  Branch (2653:6): [True: 0, False: 329k]
  ------------------
 2654|      0|	  fclose(f);
 2655|   329k|	} else {
 2656|   329k|	  delete fileName;
 2657|   329k|	  fileName = NULL;
 2658|   329k|	}
 2659|   329k|      }
 2660|  65.8k|    }
 2661|  65.8k|    if (!fileName) {
  ------------------
  |  Branch (2661:9): [True: 65.8k, False: 0]
  ------------------
 2662|  65.8k|      delete fontName;
 2663|  65.8k|      continue;
 2664|  65.8k|    }
 2665|      0|    base14SysFonts->add(fontName, new Base14FontInfo(fileName, fontNum, 0));
 2666|      0|  }
 2667|       |#ifdef __APPLE__
 2668|       |  if (dfontFontNames) {
 2669|       |    deleteGList(dfontFontNames, GString);
 2670|       |  }
 2671|       |#endif
 2672|  70.5k|  for (i = 0; displayFontTab[i].name; ++i) {
  ------------------
  |  Branch (2672:15): [True: 65.8k, False: 4.70k]
  ------------------
 2673|  65.8k|    if (!base14SysFonts->lookup(displayFontTab[i].name) &&
  ------------------
  |  Branch (2673:9): [True: 65.8k, False: 0]
  ------------------
 2674|  65.8k|	!fontFiles->lookup(displayFontTab[i].name)) {
  ------------------
  |  Branch (2674:2): [True: 65.8k, False: 0]
  ------------------
 2675|  65.8k|      if (displayFontTab[i].obliqueFont &&
  ------------------
  |  Branch (2675:11): [True: 18.8k, False: 47.0k]
  ------------------
 2676|  18.8k|	  ((base14 = (Base14FontInfo *)base14SysFonts
  ------------------
  |  Branch (2676:4): [True: 0, False: 18.8k]
  ------------------
 2677|  18.8k|	                 ->lookup(displayFontTab[i].obliqueFont)))) {
 2678|      0|	base14SysFonts->add(
 2679|      0|	        new GString(displayFontTab[i].name),
 2680|      0|		new Base14FontInfo(base14->fileName->copy(),
 2681|      0|				   base14->fontNum,
 2682|      0|				   displayFontTab[i].obliqueFactor));
 2683|  65.8k|      } else {
 2684|  65.8k|	error(errConfig, -1, "No display font for '{0:s}'",
 2685|  65.8k|	      displayFontTab[i].name);
 2686|  65.8k|      }
 2687|  65.8k|    }
 2688|  65.8k|  }
 2689|  4.70k|}
_ZN12GlobalParams12getEnableXFAEv:
 3505|  1.47k|GBool GlobalParams::getEnableXFA() {
 3506|  1.47k|  GBool xfa;
 3507|       |
 3508|  1.47k|  lockGlobalParams;
  ------------------
  |  |   50|  1.47k|#  define lockGlobalParams            gLockMutex(&mutex)
  |  |  ------------------
  |  |  |  |   53|  1.47k|#define gLockMutex(m) pthread_mutex_lock(m)
  |  |  ------------------
  ------------------
 3509|  1.47k|  xfa = enableXFA;
 3510|  1.47k|  unlockGlobalParams;
  ------------------
  |  |   53|  1.47k|#  define unlockGlobalParams          gUnlockMutex(&mutex)
  |  |  ------------------
  |  |  |  |   54|  1.47k|#define gUnlockMutex(m) pthread_mutex_unlock(m)
  |  |  ------------------
  ------------------
 3511|  1.47k|  return xfa;
 3512|  1.47k|}
_ZN12GlobalParams11getErrQuietEv:
 3775|  54.2M|GBool GlobalParams::getErrQuiet() {
 3776|       |  // no locking -- this function may get called from inside a locked
 3777|       |  // section
 3778|  54.2M|  return errQuiet;
 3779|  54.2M|}
_ZN12GlobalParams17setEnableFreeTypeEPc:
 4101|  4.70k|GBool GlobalParams::setEnableFreeType(char *s) {
 4102|  4.70k|  GBool ok;
 4103|       |
 4104|  4.70k|  lockGlobalParams;
  ------------------
  |  |   50|  4.70k|#  define lockGlobalParams            gLockMutex(&mutex)
  |  |  ------------------
  |  |  |  |   53|  4.70k|#define gLockMutex(m) pthread_mutex_lock(m)
  |  |  ------------------
  ------------------
 4105|  4.70k|  ok = parseYesNo2(s, &enableFreeType);
 4106|  4.70k|  unlockGlobalParams;
  ------------------
  |  |   53|  4.70k|#  define unlockGlobalParams          gUnlockMutex(&mutex)
  |  |  ------------------
  |  |  |  |   54|  4.70k|#define gUnlockMutex(m) pthread_mutex_unlock(m)
  |  |  ------------------
  ------------------
 4107|  4.70k|  return ok;
 4108|  4.70k|}
_ZN12GlobalParams11setErrQuietEi:
 4223|  9.40k|void GlobalParams::setErrQuiet(GBool errQuietA) {
 4224|  9.40k|  lockGlobalParams;
  ------------------
  |  |   50|  9.40k|#  define lockGlobalParams            gLockMutex(&mutex)
  |  |  ------------------
  |  |  |  |   53|  9.40k|#define gLockMutex(m) pthread_mutex_lock(m)
  |  |  ------------------
  ------------------
 4225|  9.40k|  errQuiet = errQuietA;
 4226|  9.40k|  unlockGlobalParams;
  ------------------
  |  |   53|  9.40k|#  define unlockGlobalParams          gUnlockMutex(&mutex)
  |  |  ------------------
  |  |  |  |   54|  9.40k|#define gUnlockMutex(m) pthread_mutex_unlock(m)
  |  |  ------------------
  ------------------
 4227|  9.40k|}

_ZN23JArithmeticDecoderStatsC2Ei:
   20|  5.11M|JArithmeticDecoderStats::JArithmeticDecoderStats(int contextSizeA) {
   21|  5.11M|  contextSize = contextSizeA;
   22|  5.11M|  cxTab = (Guchar *)gmallocn(contextSize, sizeof(Guchar));
   23|  5.11M|  reset();
   24|  5.11M|}
_ZN23JArithmeticDecoderStatsD2Ev:
   26|  5.10M|JArithmeticDecoderStats::~JArithmeticDecoderStats() {
   27|  5.10M|  gfree(cxTab);
   28|  5.10M|}
_ZN23JArithmeticDecoderStats4copyEv:
   30|  3.19k|JArithmeticDecoderStats *JArithmeticDecoderStats::copy() {
   31|  3.19k|  JArithmeticDecoderStats *stats;
   32|       |
   33|  3.19k|  stats = new JArithmeticDecoderStats(contextSize);
   34|  3.19k|  memcpy(stats->cxTab, cxTab, contextSize);
   35|  3.19k|  return stats;
   36|  3.19k|}
_ZN23JArithmeticDecoderStats5resetEv:
   38|  5.92M|void JArithmeticDecoderStats::reset() {
   39|  5.92M|  memset(cxTab, 0, contextSize);
   40|  5.92M|}
_ZN23JArithmeticDecoderStats8setEntryEjii:
   46|  3.23M|void JArithmeticDecoderStats::setEntry(Guint cx, int i, int mps) {
   47|  3.23M|  cxTab[cx] = (Guchar)((i << 1) + mps);
   48|  3.23M|}
_ZN18JArithmeticDecoderC2Ev:
   87|   642k|JArithmeticDecoder::JArithmeticDecoder() {
   88|   642k|  str = NULL;
   89|   642k|  dataLen = 0;
   90|   642k|  limitStream = gFalse;
  ------------------
  |  |   18|   642k|#define gFalse 0
  ------------------
   91|   642k|  nBytesRead = 0;
   92|   642k|  readBufNext = 0;
   93|   642k|  readBufLength = 0;
   94|   642k|}
_ZN18JArithmeticDecoderD2Ev:
  110|   641k|JArithmeticDecoder::~JArithmeticDecoder() {
  111|   641k|  cleanup();
  112|   641k|}
_ZN18JArithmeticDecoder5startEv:
  114|   774k|void JArithmeticDecoder::start() {
  115|   774k|  buf0 = readByte();
  116|   774k|  buf1 = readByte();
  117|       |
  118|       |  // INITDEC
  119|   774k|  c = (buf0 ^ 0xff) << 16;
  120|   774k|  byteIn();
  121|   774k|  c <<= 7;
  122|   774k|  ct -= 7;
  123|   774k|  a = 0x80000000;
  124|   774k|}
_ZN18JArithmeticDecoder7restartEi:
  126|  26.3k|void JArithmeticDecoder::restart(int dataLenA) {
  127|  26.3k|  Guint cAdd;
  128|  26.3k|  GBool prevFF;
  129|  26.3k|  int k, nBits;
  130|       |
  131|  26.3k|  if (dataLen >= 0) {
  ------------------
  |  Branch (131:7): [True: 19.5k, False: 6.82k]
  ------------------
  132|  19.5k|    dataLen = dataLenA;
  133|  19.5k|  } else if (dataLen == -1) {
  ------------------
  |  Branch (133:14): [True: 1.81k, False: 5.00k]
  ------------------
  134|  1.81k|    dataLen = dataLenA;
  135|  1.81k|    buf1 = readByte();
  136|  5.00k|  } else {
  137|  5.00k|    k = (-dataLen - 1) * 8 - ct;
  138|  5.00k|    dataLen = dataLenA;
  139|  5.00k|    cAdd = 0;
  140|  5.00k|    prevFF = gFalse;
  ------------------
  |  |   18|  5.00k|#define gFalse 0
  ------------------
  141|   306k|    while (k > 0) {
  ------------------
  |  Branch (141:12): [True: 301k, False: 5.00k]
  ------------------
  142|   301k|      buf0 = readByte();
  143|   301k|      if (prevFF) {
  ------------------
  |  Branch (143:11): [True: 241k, False: 60.7k]
  ------------------
  144|   241k|	cAdd += 0xfe00 - (buf0 << 9);
  145|   241k|	nBits = 7;
  146|   241k|      } else {
  147|  60.7k|	cAdd += 0xff00 - (buf0 << 8);
  148|  60.7k|	nBits = 8;
  149|  60.7k|      }
  150|   301k|      prevFF = buf0 == 0xff;
  151|   301k|      if (k > nBits) {
  ------------------
  |  Branch (151:11): [True: 296k, False: 5.00k]
  ------------------
  152|   296k|	cAdd <<= nBits;
  153|   296k|	k -= nBits;
  154|   296k|      } else {
  155|  5.00k|	cAdd <<= k;
  156|  5.00k|	ct = nBits - k;
  157|  5.00k|	k = 0;
  158|  5.00k|      }
  159|   301k|    }
  160|  5.00k|    c += cAdd;
  161|  5.00k|    buf1 = readByte();
  162|  5.00k|  }
  163|  26.3k|}
_ZN18JArithmeticDecoder7cleanupEv:
  165|  1.66M|void JArithmeticDecoder::cleanup() {
  166|  1.66M|  if (limitStream) {
  ------------------
  |  Branch (166:7): [True: 1.36M, False: 296k]
  ------------------
  167|       |    // This saves up to sizeof(readBuf) extra bytes of data from the
  168|       |    // end of packet i, to be used in packet i+1. It's not clear from
  169|       |    // the JPEG 2000 spec exactly how this should work, but this
  170|       |    // kludge does seem to fix decode of some problematic JPEG 2000
  171|       |    // streams. The buffer may need to larger, but I haven't run into
  172|       |    // that case. (And the buffer was originally just one byte, which
  173|       |    // works for almost all cases.)
  174|  1.36M|    readBufLength = 0;
  175|  2.02G|    while (dataLen > 0) {
  ------------------
  |  Branch (175:12): [True: 2.02G, False: 1.36M]
  ------------------
  176|  2.02G|      if (readBufLength < (int)sizeof(readBuf)) {
  ------------------
  |  Branch (176:11): [True: 6.95M, False: 2.01G]
  ------------------
  177|  6.95M|	readBuf[readBufLength++] = (Guchar)str->getChar();
  178|  6.95M|	++nBytesRead;
  179|  6.95M|      }
  180|  2.02G|      --dataLen;
  181|  2.02G|    }
  182|  1.36M|    readBufNext = 0;
  183|  1.36M|  }
  184|  1.66M|}
_ZN18JArithmeticDecoder9decodeBitEjP23JArithmeticDecoderStats:
  187|   144M|				  JArithmeticDecoderStats *stats) {
  188|   144M|  int bit;
  189|   144M|  Guint qe;
  190|   144M|  int iCX, mpsCX;
  191|       |
  192|   144M|  iCX = stats->cxTab[context] >> 1;
  193|   144M|  mpsCX = stats->cxTab[context] & 1;
  194|   144M|  qe = qeTab[iCX];
  195|   144M|  a -= qe;
  196|   144M|  if (c < a) {
  ------------------
  |  Branch (196:7): [True: 130M, False: 13.6M]
  ------------------
  197|   130M|    if (a & 0x80000000) {
  ------------------
  |  Branch (197:9): [True: 116M, False: 13.8M]
  ------------------
  198|   116M|      bit = mpsCX;
  199|   116M|    } else {
  200|       |      // MPS_EXCHANGE
  201|  13.8M|      if (a < qe) {
  ------------------
  |  Branch (201:11): [True: 2.13M, False: 11.6M]
  ------------------
  202|  2.13M|	bit = 1 - mpsCX;
  203|  2.13M|	if (switchTab[iCX]) {
  ------------------
  |  Branch (203:6): [True: 1.29M, False: 838k]
  ------------------
  204|  1.29M|	  stats->cxTab[context] = (Guchar)((nlpsTab[iCX] << 1) | (1 - mpsCX));
  205|  1.29M|	} else {
  206|   838k|	  stats->cxTab[context] = (Guchar)((nlpsTab[iCX] << 1) | mpsCX);
  207|   838k|	}
  208|  11.6M|      } else {
  209|  11.6M|	bit = mpsCX;
  210|  11.6M|	stats->cxTab[context] = (Guchar)((nmpsTab[iCX] << 1) | mpsCX);
  211|  11.6M|      }
  212|       |      // RENORMD
  213|  14.6M|      do {
  214|  14.6M|	if (ct == 0) {
  ------------------
  |  Branch (214:6): [True: 1.86M, False: 12.8M]
  ------------------
  215|  1.86M|	  byteIn();
  216|  1.86M|	}
  217|  14.6M|	a <<= 1;
  218|  14.6M|	c <<= 1;
  219|  14.6M|	--ct;
  220|  14.6M|      } while (!(a & 0x80000000));
  ------------------
  |  Branch (220:16): [True: 854k, False: 13.8M]
  ------------------
  221|  13.8M|    }
  222|   130M|  } else {
  223|  13.6M|    c -= a;
  224|       |    // LPS_EXCHANGE
  225|  13.6M|    if (a < qe) {
  ------------------
  |  Branch (225:9): [True: 2.73M, False: 10.9M]
  ------------------
  226|  2.73M|      bit = mpsCX;
  227|  2.73M|      stats->cxTab[context] = (Guchar)((nmpsTab[iCX] << 1) | mpsCX);
  228|  10.9M|    } else {
  229|  10.9M|      bit = 1 - mpsCX;
  230|  10.9M|      if (switchTab[iCX]) {
  ------------------
  |  Branch (230:11): [True: 3.52M, False: 7.41M]
  ------------------
  231|  3.52M|	stats->cxTab[context] = (Guchar)((nlpsTab[iCX] << 1) | (1 - mpsCX));
  232|  7.41M|      } else {
  233|  7.41M|	stats->cxTab[context] = (Guchar)((nlpsTab[iCX] << 1) | mpsCX);
  234|  7.41M|      }
  235|  10.9M|    }
  236|  13.6M|    a = qe;
  237|       |    // RENORMD
  238|  20.6M|    do {
  239|  20.6M|      if (ct == 0) {
  ------------------
  |  Branch (239:11): [True: 2.67M, False: 18.0M]
  ------------------
  240|  2.67M|	byteIn();
  241|  2.67M|      }
  242|  20.6M|      a <<= 1;
  243|  20.6M|      c <<= 1;
  244|  20.6M|      --ct;
  245|  20.6M|    } while (!(a & 0x80000000));
  ------------------
  |  Branch (245:14): [True: 7.01M, False: 13.6M]
  ------------------
  246|  13.6M|  }
  247|   144M|  return bit;
  248|   144M|}
_ZN18JArithmeticDecoder9decodeIntEPiP23JArithmeticDecoderStats:
  262|  84.5k|GBool JArithmeticDecoder::decodeInt(int *x, JArithmeticDecoderStats *stats) {
  263|  84.5k|  int s;
  264|  84.5k|  Guint v;
  265|  84.5k|  int i;
  266|       |
  267|  84.5k|  prev = 1;
  268|  84.5k|  s = decodeIntBit(stats);
  269|  84.5k|  if (decodeIntBit(stats)) {
  ------------------
  |  Branch (269:7): [True: 40.9k, False: 43.5k]
  ------------------
  270|  40.9k|    if (decodeIntBit(stats)) {
  ------------------
  |  Branch (270:9): [True: 16.9k, False: 24.0k]
  ------------------
  271|  16.9k|      if (decodeIntBit(stats)) {
  ------------------
  |  Branch (271:11): [True: 10.3k, False: 6.59k]
  ------------------
  272|  10.3k|	if (decodeIntBit(stats)) {
  ------------------
  |  Branch (272:6): [True: 4.11k, False: 6.21k]
  ------------------
  273|  4.11k|	  if (decodeIntBit(stats)) {
  ------------------
  |  Branch (273:8): [True: 2.90k, False: 1.20k]
  ------------------
  274|  2.90k|	    v = 0;
  275|  95.9k|	    for (i = 0; i < 32; ++i) {
  ------------------
  |  Branch (275:18): [True: 93.0k, False: 2.90k]
  ------------------
  276|  93.0k|	      v = (v << 1) | decodeIntBit(stats);
  277|  93.0k|	    }
  278|  2.90k|	    v += 4436;
  279|  2.90k|	  } else {
  280|  1.20k|	    v = 0;
  281|  15.6k|	    for (i = 0; i < 12; ++i) {
  ------------------
  |  Branch (281:18): [True: 14.4k, False: 1.20k]
  ------------------
  282|  14.4k|	      v = (v << 1) | decodeIntBit(stats);
  283|  14.4k|	    }
  284|  1.20k|	    v += 340;
  285|  1.20k|	  }
  286|  6.21k|	} else {
  287|  6.21k|	  v = 0;
  288|  55.9k|	  for (i = 0; i < 8; ++i) {
  ------------------
  |  Branch (288:16): [True: 49.7k, False: 6.21k]
  ------------------
  289|  49.7k|	    v = (v << 1) | decodeIntBit(stats);
  290|  49.7k|	  }
  291|  6.21k|	  v += 84;
  292|  6.21k|	}
  293|  10.3k|      } else {
  294|  6.59k|	v = 0;
  295|  46.1k|	for (i = 0; i < 6; ++i) {
  ------------------
  |  Branch (295:14): [True: 39.5k, False: 6.59k]
  ------------------
  296|  39.5k|	  v = (v << 1) | decodeIntBit(stats);
  297|  39.5k|	}
  298|  6.59k|	v += 20;
  299|  6.59k|      }
  300|  24.0k|    } else {
  301|  24.0k|      v = decodeIntBit(stats);
  302|  24.0k|      v = (v << 1) | decodeIntBit(stats);
  303|  24.0k|      v = (v << 1) | decodeIntBit(stats);
  304|  24.0k|      v = (v << 1) | decodeIntBit(stats);
  305|  24.0k|      v += 4;
  306|  24.0k|    }
  307|  43.5k|  } else {
  308|  43.5k|    v = decodeIntBit(stats);
  309|  43.5k|    v = (v << 1) | decodeIntBit(stats);
  310|  43.5k|  }
  311|       |
  312|  84.5k|  if (s) {
  ------------------
  |  Branch (312:7): [True: 29.6k, False: 54.8k]
  ------------------
  313|  29.6k|    if (v == 0) {
  ------------------
  |  Branch (313:9): [True: 3.68k, False: 25.9k]
  ------------------
  314|  3.68k|      return gFalse;
  ------------------
  |  |   18|  3.68k|#define gFalse 0
  ------------------
  315|  3.68k|    }
  316|  25.9k|    *x = -(int)v;
  317|  54.8k|  } else {
  318|  54.8k|    *x = (int)v;
  319|  54.8k|  }
  320|  80.8k|  return gTrue;
  ------------------
  |  |   17|  80.8k|#define gTrue 1
  ------------------
  321|  84.5k|}
_ZN18JArithmeticDecoder12decodeIntBitEP23JArithmeticDecoderStats:
  323|   621k|int JArithmeticDecoder::decodeIntBit(JArithmeticDecoderStats *stats) {
  324|   621k|  int bit;
  325|       |
  326|   621k|  bit = decodeBit(prev, stats);
  327|   621k|  if (prev < 0x100) {
  ------------------
  |  Branch (327:7): [True: 478k, False: 143k]
  ------------------
  328|   478k|    prev = (prev << 1) | bit;
  329|   478k|  } else {
  330|   143k|    prev = (((prev << 1) | bit) & 0x1ff) | 0x100;
  331|   143k|  }
  332|   621k|  return bit;
  333|   621k|}
_ZN18JArithmeticDecoder10decodeIAIDEjP23JArithmeticDecoderStats:
  336|  46.9k|				     JArithmeticDecoderStats *stats) {
  337|  46.9k|  Guint i;
  338|  46.9k|  int bit;
  339|       |
  340|  46.9k|  prev = 1;
  341|   209k|  for (i = 0; i < codeLen; ++i) {
  ------------------
  |  Branch (341:15): [True: 162k, False: 46.9k]
  ------------------
  342|   162k|    bit = decodeBit(prev, stats);
  343|   162k|    prev = (prev << 1) | bit;
  344|   162k|  }
  345|  46.9k|  return prev - (1 << codeLen);
  346|  46.9k|}
_ZN18JArithmeticDecoder6byteInEv:
  348|  5.31M|void JArithmeticDecoder::byteIn() {
  349|  5.31M|  if (buf0 == 0xff) {
  ------------------
  |  Branch (349:7): [True: 2.66M, False: 2.64M]
  ------------------
  350|  2.66M|    if (buf1 > 0x8f) {
  ------------------
  |  Branch (350:9): [True: 2.64M, False: 14.8k]
  ------------------
  351|  2.64M|      if (limitStream) {
  ------------------
  |  Branch (351:11): [True: 963k, False: 1.68M]
  ------------------
  352|   963k|	buf0 = buf1;
  353|   963k|	buf1 = readByte();
  354|   963k|	c = c + 0xff00 - (buf0 << 8);
  355|   963k|      }
  356|  2.64M|      ct = 8;
  357|  2.64M|    } else {
  358|  14.8k|      buf0 = buf1;
  359|  14.8k|      buf1 = readByte();
  360|  14.8k|      c = c + 0xfe00 - (buf0 << 9);
  361|  14.8k|      ct = 7;
  362|  14.8k|    }
  363|  2.66M|  } else {
  364|  2.64M|    buf0 = buf1;
  365|  2.64M|    buf1 = readByte();
  366|  2.64M|    c = c + 0xff00 - (buf0 << 8);
  367|  2.64M|    ct = 8;
  368|  2.64M|  }
  369|  5.31M|}
_ZN18JArithmeticDecoder8readByteEv:
   96|  5.48M|inline Guint JArithmeticDecoder::readByte() {
   97|  5.48M|  if (limitStream) {
  ------------------
  |  Branch (97:7): [True: 4.65M, False: 831k]
  ------------------
   98|  4.65M|    if (readBufNext < readBufLength) {
  ------------------
  |  Branch (98:9): [True: 1.07M, False: 3.57M]
  ------------------
   99|  1.07M|      return readBuf[readBufNext++];
  100|  1.07M|    }
  101|  3.57M|    --dataLen;
  102|  3.57M|    if (dataLen < 0) {
  ------------------
  |  Branch (102:9): [True: 1.17M, False: 2.40M]
  ------------------
  103|  1.17M|      return 0xff;
  104|  1.17M|    }
  105|  3.57M|  }
  106|  3.23M|  ++nBytesRead;
  107|  3.23M|  return (Guint)str->getChar() & 0xff;
  108|  5.48M|}

_ZN18JArithmeticDecoder9setStreamEP6Stream:
   54|  84.4k|    { str = strA; dataLen = 0; limitStream = gFalse; }
  ------------------
  |  |   18|  84.4k|#define gFalse 0
  ------------------
_ZN18JArithmeticDecoder16resetByteCounterEv:
   83|   183k|  void resetByteCounter() { nBytesRead = 0; }
_ZN18JArithmeticDecoder14getByteCounterEv:
   84|   167k|  Guint getByteCounter() { return nBytesRead; }
_ZN23JArithmeticDecoderStats14getContextSizeEv:
   31|  18.5k|  int getContextSize() { return contextSize; }
_ZN18JArithmeticDecoder9setStreamEP6Streami:
   56|   761k|    { str = strA; dataLen = dataLenA; limitStream = gTrue; }
  ------------------
  |  |   17|   761k|#define gTrue 1
  ------------------

_ZN19JBIG2HuffmanDecoderC2Ev:
  319|   296k|JBIG2HuffmanDecoder::JBIG2HuffmanDecoder() {
  320|       |  str = NULL;
  321|   296k|  byteCounter = 0;
  322|   296k|  reset();
  323|   296k|}
_ZN19JBIG2HuffmanDecoderD2Ev:
  325|   296k|JBIG2HuffmanDecoder::~JBIG2HuffmanDecoder() {
  326|   296k|}
_ZN19JBIG2HuffmanDecoder5resetEv:
  328|   312k|void JBIG2HuffmanDecoder::reset() {
  329|   312k|  buf = 0;
  330|   312k|  bufLen = 0;
  331|   312k|}
_ZN19JBIG2HuffmanDecoder9decodeIntEPiP17JBIG2HuffmanTable:
  334|   281k|GBool JBIG2HuffmanDecoder::decodeInt(int *x, JBIG2HuffmanTable *table) {
  335|   281k|  Guint i, len, prefix;
  336|       |
  337|   281k|  i = 0;
  338|   281k|  len = 0;
  339|   281k|  prefix = 0;
  340|   826k|  while (table[i].rangeLen != jbig2HuffmanEOT) {
  ------------------
  |  |   33|   826k|#define jbig2HuffmanEOT 0xffffffff
  ------------------
  |  Branch (340:10): [True: 823k, False: 3.08k]
  ------------------
  341|  1.55M|    while (len < table[i].prefixLen) {
  ------------------
  |  Branch (341:12): [True: 732k, False: 823k]
  ------------------
  342|   732k|      prefix = (prefix << 1) | readBit();
  343|   732k|      ++len;
  344|   732k|    }
  345|   823k|    if (prefix == table[i].prefix) {
  ------------------
  |  Branch (345:9): [True: 278k, False: 544k]
  ------------------
  346|   278k|      if (table[i].rangeLen == jbig2HuffmanOOB) {
  ------------------
  |  |   32|   278k|#define jbig2HuffmanOOB 0xfffffffe
  ------------------
  |  Branch (346:11): [True: 26.6k, False: 251k]
  ------------------
  347|  26.6k|	return gFalse;
  ------------------
  |  |   18|  26.6k|#define gFalse 0
  ------------------
  348|  26.6k|      }
  349|   251k|      if (table[i].rangeLen == jbig2HuffmanLOW) {
  ------------------
  |  |   31|   251k|#define jbig2HuffmanLOW 0xfffffffd
  ------------------
  |  Branch (349:11): [True: 377, False: 251k]
  ------------------
  350|    377|	*x = table[i].val - readBits(32);
  351|   251k|      } else if (table[i].rangeLen > 0) {
  ------------------
  |  Branch (351:18): [True: 152k, False: 98.7k]
  ------------------
  352|   152k|	*x = table[i].val + readBits(table[i].rangeLen);
  353|   152k|      } else {
  354|  98.7k|	*x = table[i].val;
  355|  98.7k|      }
  356|   251k|      return gTrue;
  ------------------
  |  |   17|   251k|#define gTrue 1
  ------------------
  357|   278k|    }
  358|   544k|    ++i;
  359|   544k|  }
  360|  3.08k|  return gFalse;
  ------------------
  |  |   18|  3.08k|#define gFalse 0
  ------------------
  361|   281k|}
_ZN19JBIG2HuffmanDecoder8readBitsEj:
  363|   468k|Guint JBIG2HuffmanDecoder::readBits(Guint n) {
  364|   468k|  Guint x, mask, nLeft;
  365|       |
  366|   468k|  mask = (n == 32) ? 0xffffffff : ((1 << n) - 1);
  ------------------
  |  Branch (366:10): [True: 5.72k, False: 462k]
  ------------------
  367|   468k|  if (bufLen >= n) {
  ------------------
  |  Branch (367:7): [True: 207k, False: 261k]
  ------------------
  368|   207k|    x = (buf >> (bufLen - n)) & mask;
  369|   207k|    bufLen -= n;
  370|   261k|  } else {
  371|   261k|    x = buf & ((1 << bufLen) - 1);
  372|   261k|    nLeft = n - bufLen;
  373|   261k|    bufLen = 0;
  374|   288k|    while (nLeft >= 8) {
  ------------------
  |  Branch (374:12): [True: 27.2k, False: 261k]
  ------------------
  375|  27.2k|      x = (x << 8) | (str->getChar() & 0xff);
  376|  27.2k|      ++byteCounter;
  377|  27.2k|      nLeft -= 8;
  378|  27.2k|    }
  379|   261k|    if (nLeft > 0) {
  ------------------
  |  Branch (379:9): [True: 253k, False: 7.94k]
  ------------------
  380|   253k|      buf = str->getChar();
  381|   253k|      ++byteCounter;
  382|   253k|      bufLen = 8 - nLeft;
  383|   253k|      x = (x << nLeft) | ((buf >> bufLen) & ((1 << nLeft) - 1));
  384|   253k|    }
  385|   261k|  }
  386|   468k|  return x;
  387|   468k|}
_ZN19JBIG2HuffmanDecoder7readBitEv:
  389|   761k|Guint JBIG2HuffmanDecoder::readBit() {
  390|   761k|  if (bufLen == 0) {
  ------------------
  |  Branch (390:7): [True: 107k, False: 654k]
  ------------------
  391|   107k|    buf = str->getChar();
  392|   107k|    ++byteCounter;
  393|   107k|    bufLen = 8;
  394|   107k|  }
  395|   761k|  --bufLen;
  396|   761k|  return (buf >> bufLen) & 1;
  397|   761k|}
_ZN19JBIG2HuffmanDecoder10buildTableEP17JBIG2HuffmanTablej:
  399|  7.94k|void JBIG2HuffmanDecoder::buildTable(JBIG2HuffmanTable *table, Guint len) {
  400|  7.94k|  Guint i, j, k, prefix;
  401|  7.94k|  JBIG2HuffmanTable tab;
  402|       |
  403|       |  // stable selection sort:
  404|       |  // - entries with prefixLen > 0, in ascending prefixLen order
  405|       |  // - entry with prefixLen = 0, rangeLen = EOT
  406|       |  // - all other entries with prefixLen = 0
  407|       |  // (on entry, table[len] has prefixLen = 0, rangeLen = EOT)
  408|  99.1k|  for (i = 0; i < len; ++i) {
  ------------------
  |  Branch (408:15): [True: 95.1k, False: 4.05k]
  ------------------
  409|  2.27M|    for (j = i; j < len && table[j].prefixLen == 0; ++j) ;
  ------------------
  |  Branch (409:17): [True: 2.27M, False: 3.89k]
  |  Branch (409:28): [True: 2.18M, False: 91.2k]
  ------------------
  410|  95.1k|    if (j == len) {
  ------------------
  |  Branch (410:9): [True: 3.89k, False: 91.2k]
  ------------------
  411|  3.89k|      break;
  412|  3.89k|    }
  413|  33.4M|    for (k = j + 1; k < len; ++k) {
  ------------------
  |  Branch (413:21): [True: 33.3M, False: 91.2k]
  ------------------
  414|  33.3M|      if (table[k].prefixLen > 0 &&
  ------------------
  |  Branch (414:11): [True: 26.5M, False: 6.80M]
  ------------------
  415|  26.5M|	  table[k].prefixLen < table[j].prefixLen) {
  ------------------
  |  Branch (415:4): [True: 155k, False: 26.4M]
  ------------------
  416|   155k|	j = k;
  417|   155k|      }
  418|  33.3M|    }
  419|  91.2k|    if (j != i) {
  ------------------
  |  Branch (419:9): [True: 78.6k, False: 12.5k]
  ------------------
  420|  78.6k|      tab = table[j];
  421|  13.1M|      for (k = j; k > i; --k) {
  ------------------
  |  Branch (421:19): [True: 13.0M, False: 78.6k]
  ------------------
  422|  13.0M|	table[k] = table[k - 1];
  423|  13.0M|      }
  424|  78.6k|      table[i] = tab;
  425|  78.6k|    }
  426|  91.2k|  }
  427|  7.94k|  table[i] = table[len];
  428|       |
  429|       |  // assign prefixes
  430|  7.94k|  if (table[0].rangeLen != jbig2HuffmanEOT) {
  ------------------
  |  |   33|  7.94k|#define jbig2HuffmanEOT 0xffffffff
  ------------------
  |  Branch (430:7): [True: 5.63k, False: 2.30k]
  ------------------
  431|  5.63k|    i = 0;
  432|  5.63k|    prefix = 0;
  433|  5.63k|    table[i++].prefix = prefix++;
  434|  91.2k|    for (; table[i].rangeLen != jbig2HuffmanEOT; ++i) {
  ------------------
  |  |   33|  91.2k|#define jbig2HuffmanEOT 0xffffffff
  ------------------
  |  Branch (434:12): [True: 85.5k, False: 5.63k]
  ------------------
  435|  85.5k|      prefix <<= table[i].prefixLen - table[i-1].prefixLen;
  436|  85.5k|      table[i].prefix = prefix++;
  437|  85.5k|    }
  438|  5.63k|  }
  439|  7.94k|}
_ZN15JBIG2MMRDecoderC2Ev:
  469|   296k|JBIG2MMRDecoder::JBIG2MMRDecoder() {
  470|       |  str = NULL;
  471|   296k|  byteCounter = 0;
  472|   296k|  reset();
  473|   296k|}
_ZN15JBIG2MMRDecoderD2Ev:
  475|   296k|JBIG2MMRDecoder::~JBIG2MMRDecoder() {
  476|   296k|}
_ZN15JBIG2MMRDecoder5resetEv:
  478|   299k|void JBIG2MMRDecoder::reset() {
  479|   299k|  buf = 0;
  480|   299k|  bufLen = 0;
  481|   299k|  nBytesRead = 0;
  482|   299k|}
_ZN15JBIG2MMRDecoder9get2DCodeEv:
  484|   717k|int JBIG2MMRDecoder::get2DCode() {
  485|   717k|  CCITTCode *p;
  486|       |
  487|   717k|  if (bufLen == 0) {
  ------------------
  |  Branch (487:7): [True: 22.7k, False: 694k]
  ------------------
  488|  22.7k|    buf = str->getChar() & 0xff;
  489|  22.7k|    bufLen = 8;
  490|  22.7k|    ++nBytesRead;
  491|  22.7k|    ++byteCounter;
  492|  22.7k|    p = &twoDimTab1[(buf >> 1) & 0x7f];
  493|   694k|  } else if (bufLen >= 7) {
  ------------------
  |  Branch (493:14): [True: 330k, False: 364k]
  ------------------
  494|   330k|    p = &twoDimTab1[(buf >> (bufLen - 7)) & 0x7f];
  495|   364k|  } else {
  496|   364k|    p = &twoDimTab1[(buf << (7 - bufLen)) & 0x7f];
  497|   364k|    if (p->bits < 0 || p->bits > (int)bufLen) {
  ------------------
  |  Branch (497:9): [True: 55.4k, False: 308k]
  |  Branch (497:24): [True: 52.5k, False: 256k]
  ------------------
  498|   108k|      buf = (buf << 8) | (str->getChar() & 0xff);
  499|   108k|      bufLen += 8;
  500|   108k|      ++nBytesRead;
  501|   108k|      ++byteCounter;
  502|   108k|      p = &twoDimTab1[(buf >> (bufLen - 7)) & 0x7f];
  503|   108k|    }
  504|   364k|  }
  505|   717k|  if (p->bits < 0) {
  ------------------
  |  Branch (505:7): [True: 259k, False: 457k]
  ------------------
  506|   259k|    error(errSyntaxError, str->getPos(),
  507|   259k|	  "Bad two dim code in JBIG2 MMR stream");
  508|   259k|    return EOF;
  509|   259k|  }
  510|   457k|  bufLen -= p->bits;
  511|   457k|  return p->n;
  512|   717k|}
_ZN15JBIG2MMRDecoder12getWhiteCodeEv:
  514|  66.8k|int JBIG2MMRDecoder::getWhiteCode() {
  515|  66.8k|  CCITTCode *p;
  516|  66.8k|  Guint code;
  517|       |
  518|  66.8k|  if (bufLen == 0) {
  ------------------
  |  Branch (518:7): [True: 2.43k, False: 64.4k]
  ------------------
  519|  2.43k|    buf = str->getChar() & 0xff;
  520|  2.43k|    bufLen = 8;
  521|  2.43k|    ++nBytesRead;
  522|  2.43k|    ++byteCounter;
  523|  2.43k|  }
  524|   109k|  while (1) {
  ------------------
  |  Branch (524:10): [True: 109k, Folded]
  ------------------
  525|   109k|    if (bufLen >= 11 && ((buf >> (bufLen - 7)) & 0x7f) == 0) {
  ------------------
  |  Branch (525:9): [True: 17.9k, False: 91.5k]
  |  Branch (525:25): [True: 712, False: 17.2k]
  ------------------
  526|    712|      if (bufLen <= 12) {
  ------------------
  |  Branch (526:11): [True: 199, False: 513]
  ------------------
  527|    199|	code = buf << (12 - bufLen);
  528|    513|      } else {
  529|    513|	code = buf >> (bufLen - 12);
  530|    513|      }
  531|    712|      p = &whiteTab1[code & 0x1f];
  532|   108k|    } else {
  533|   108k|      if (bufLen <= 9) {
  ------------------
  |  Branch (533:11): [True: 87.9k, False: 20.9k]
  ------------------
  534|  87.9k|	code = buf << (9 - bufLen);
  535|  87.9k|      } else {
  536|  20.9k|	code = buf >> (bufLen - 9);
  537|  20.9k|      }
  538|   108k|      p = &whiteTab2[code & 0x1ff];
  539|   108k|    }
  540|   109k|    if (p->bits > 0 && p->bits <= (int)bufLen) {
  ------------------
  |  Branch (540:9): [True: 98.7k, False: 10.8k]
  |  Branch (540:24): [True: 66.4k, False: 32.2k]
  ------------------
  541|  66.4k|      bufLen -= p->bits;
  542|  66.4k|      return p->n;
  543|  66.4k|    }
  544|  43.1k|    if (bufLen >= 12) {
  ------------------
  |  Branch (544:9): [True: 412, False: 42.7k]
  ------------------
  545|    412|      break;
  546|    412|    }
  547|  42.7k|    buf = (buf << 8) | (str->getChar() & 0xff);
  548|  42.7k|    bufLen += 8;
  549|  42.7k|    ++nBytesRead;
  550|  42.7k|    ++byteCounter;
  551|  42.7k|  }
  552|    412|  error(errSyntaxError, str->getPos(), "Bad white code in JBIG2 MMR stream");
  553|       |  // eat a bit and return a positive number so that the caller doesn't
  554|       |  // go into an infinite loop
  555|    412|  --bufLen;
  556|    412|  return 1;
  557|  66.8k|}
_ZN15JBIG2MMRDecoder12getBlackCodeEv:
  559|  61.6k|int JBIG2MMRDecoder::getBlackCode() {
  560|  61.6k|  CCITTCode *p;
  561|  61.6k|  Guint code;
  562|       |
  563|  61.6k|  if (bufLen == 0) {
  ------------------
  |  Branch (563:7): [True: 2.23k, False: 59.3k]
  ------------------
  564|  2.23k|    buf = str->getChar() & 0xff;
  565|  2.23k|    bufLen = 8;
  566|  2.23k|    ++nBytesRead;
  567|  2.23k|    ++byteCounter;
  568|  2.23k|  }
  569|  96.3k|  while (1) {
  ------------------
  |  Branch (569:10): [True: 96.3k, Folded]
  ------------------
  570|  96.3k|    if (bufLen >= 10 && ((buf >> (bufLen - 6)) & 0x3f) == 0) {
  ------------------
  |  Branch (570:9): [True: 16.2k, False: 80.0k]
  |  Branch (570:25): [True: 1.66k, False: 14.5k]
  ------------------
  571|  1.66k|      if (bufLen <= 13) {
  ------------------
  |  Branch (571:11): [True: 504, False: 1.15k]
  ------------------
  572|    504|	code = buf << (13 - bufLen);
  573|  1.15k|      } else {
  574|  1.15k|	code = buf >> (bufLen - 13);
  575|  1.15k|      }
  576|  1.66k|      p = &blackTab1[code & 0x7f];
  577|  94.6k|    } else if (bufLen >= 7 && ((buf >> (bufLen - 4)) & 0x0f) == 0 &&
  ------------------
  |  Branch (577:16): [True: 37.3k, False: 57.3k]
  |  Branch (577:31): [True: 1.77k, False: 35.5k]
  ------------------
  578|  1.77k|	       ((buf >> (bufLen - 6)) & 0x03) != 0) {
  ------------------
  |  Branch (578:9): [True: 1.16k, False: 618]
  ------------------
  579|  1.16k|      if (bufLen <= 12) {
  ------------------
  |  Branch (579:11): [True: 728, False: 433]
  ------------------
  580|    728|	code = buf << (12 - bufLen);
  581|    728|      } else {
  582|    433|	code = buf >> (bufLen - 12);
  583|    433|      }
  584|  1.16k|      p = &blackTab2[(code & 0xff) - 64];
  585|  93.5k|    } else {
  586|  93.5k|      if (bufLen <= 6) {
  ------------------
  |  Branch (586:11): [True: 57.3k, False: 36.1k]
  ------------------
  587|  57.3k|	code = buf << (6 - bufLen);
  588|  57.3k|      } else {
  589|  36.1k|	code = buf >> (bufLen - 6);
  590|  36.1k|      }
  591|  93.5k|      p = &blackTab3[code & 0x3f];
  592|  93.5k|    }
  593|  96.3k|    if (p->bits > 0 && p->bits <= (int)bufLen) {
  ------------------
  |  Branch (593:9): [True: 86.2k, False: 10.0k]
  |  Branch (593:24): [True: 60.9k, False: 25.3k]
  ------------------
  594|  60.9k|      bufLen -= p->bits;
  595|  60.9k|      return p->n;
  596|  60.9k|    }
  597|  35.3k|    if (bufLen >= 13) {
  ------------------
  |  Branch (597:9): [True: 649, False: 34.7k]
  ------------------
  598|    649|      break;
  599|    649|    }
  600|  34.7k|    buf = (buf << 8) | (str->getChar() & 0xff);
  601|  34.7k|    bufLen += 8;
  602|  34.7k|    ++nBytesRead;
  603|  34.7k|    ++byteCounter;
  604|  34.7k|  }
  605|    649|  error(errSyntaxError, str->getPos(), "Bad black code in JBIG2 MMR stream");
  606|       |  // eat a bit and return a positive number so that the caller doesn't
  607|       |  // go into an infinite loop
  608|    649|  --bufLen;
  609|    649|  return 1;
  610|  61.6k|}
_ZN15JBIG2MMRDecoder9get24BitsEv:
  612|  1.32k|Guint JBIG2MMRDecoder::get24Bits() {
  613|  4.46k|  while (bufLen < 24) {
  ------------------
  |  Branch (613:10): [True: 3.14k, False: 1.32k]
  ------------------
  614|  3.14k|    buf = (buf << 8) | (str->getChar() & 0xff);
  615|  3.14k|    bufLen += 8;
  616|  3.14k|    ++nBytesRead;
  617|  3.14k|    ++byteCounter;
  618|  3.14k|  }
  619|  1.32k|  return (buf >> (bufLen - 24)) & 0xffffff;
  620|  1.32k|}
_ZN15JBIG2MMRDecoder6skipToEj:
  622|  1.83k|void JBIG2MMRDecoder::skipTo(Guint length) {
  623|  1.83k|  int n;
  624|       |
  625|  1.83k|  n = str->discardChars(length - nBytesRead);
  626|  1.83k|  nBytesRead += n;
  627|  1.83k|  byteCounter += n;
  628|  1.83k|}
_ZN11JBIG2BitmapC2Ejii:
  702|   143k|  JBIG2Segment(segNumA)
  703|   143k|{
  704|   143k|  w = wA;
  705|   143k|  h = hA;
  706|   143k|  line = (wA + 7) >> 3;
  707|   143k|  if (w <= 0 || h <= 0 || line <= 0 || h >= (INT_MAX - 1) / line) {
  ------------------
  |  Branch (707:7): [True: 1, False: 143k]
  |  Branch (707:17): [True: 1, False: 143k]
  |  Branch (707:27): [True: 0, False: 143k]
  |  Branch (707:40): [True: 6, False: 143k]
  ------------------
  708|       |    // force a call to gmalloc(-1), which will throw an exception
  709|      8|    h = -1;
  710|      8|    line = 2;
  711|      8|  }
  712|       |  // need to allocate one extra guard byte for use in combine()
  713|   143k|  data = (Guchar *)gmalloc(h * line + 1);
  714|   143k|  data[h * line] = 0;
  715|   143k|}
_ZN11JBIG2BitmapC2EjPS_:
  718|  1.52k|  JBIG2Segment(segNumA)
  719|  1.52k|{
  720|  1.52k|  w = bitmap->w;
  721|  1.52k|  h = bitmap->h;
  722|  1.52k|  line = bitmap->line;
  723|  1.52k|  if (w <= 0 || h <= 0 || line <= 0 || h >= (INT_MAX - 1) / line) {
  ------------------
  |  Branch (723:7): [True: 0, False: 1.52k]
  |  Branch (723:17): [True: 0, False: 1.52k]
  |  Branch (723:27): [True: 0, False: 1.52k]
  |  Branch (723:40): [True: 0, False: 1.52k]
  ------------------
  724|       |    // force a call to gmalloc(-1), which will throw an exception
  725|      0|    h = -1;
  726|      0|    line = 2;
  727|      0|  }
  728|       |  // need to allocate one extra guard byte for use in combine()
  729|  1.52k|  data = (Guchar *)gmalloc(h * line + 1);
  730|  1.52k|  memcpy(data, bitmap->data, h * line);
  731|  1.52k|  data[h * line] = 0;
  732|  1.52k|}
_ZN11JBIG2BitmapD2Ev:
  734|   145k|JBIG2Bitmap::~JBIG2Bitmap() {
  735|   145k|  gfree(data);
  736|   145k|}
_ZN11JBIG2Bitmap8getSliceEjjjj:
  739|  53.2k|JBIG2Bitmap *JBIG2Bitmap::getSlice(Guint x, Guint y, Guint wA, Guint hA) {
  740|  53.2k|  JBIG2Bitmap *slice;
  741|  53.2k|  Guint xx, yy;
  742|       |
  743|  53.2k|  slice = new JBIG2Bitmap(0, wA, hA);
  744|  53.2k|  slice->clearToZero();
  745|  1.82M|  for (yy = 0; yy < hA; ++yy) {
  ------------------
  |  Branch (745:16): [True: 1.77M, False: 53.2k]
  ------------------
  746|  64.2M|    for (xx = 0; xx < wA; ++xx) {
  ------------------
  |  Branch (746:18): [True: 62.4M, False: 1.77M]
  ------------------
  747|  62.4M|      if (getPixel(x + xx, y + yy)) {
  ------------------
  |  Branch (747:11): [True: 12.4M, False: 49.9M]
  ------------------
  748|  12.4M|	slice->setPixel(xx, yy);
  749|  12.4M|      }
  750|  62.4M|    }
  751|  1.77M|  }
  752|  53.2k|  return slice;
  753|  53.2k|}
_ZN11JBIG2Bitmap6expandEij:
  755|  1.60k|void JBIG2Bitmap::expand(int newH, Guint pixel) {
  756|  1.60k|  if (newH <= h || line <= 0 || newH >= (INT_MAX - 1) / line) {
  ------------------
  |  Branch (756:7): [True: 318, False: 1.28k]
  |  Branch (756:20): [True: 0, False: 1.28k]
  |  Branch (756:33): [True: 807, False: 478]
  ------------------
  757|  1.12k|    return;
  758|  1.12k|  }
  759|       |  // need to allocate one extra guard byte for use in combine()
  760|    478|  data = (Guchar *)grealloc(data, newH * line + 1);
  761|    478|  if (pixel) {
  ------------------
  |  Branch (761:7): [True: 263, False: 215]
  ------------------
  762|    263|    memset(data + h * line, 0xff, (newH - h) * line);
  763|    263|  } else {
  764|    215|    memset(data + h * line, 0x00, (newH - h) * line);
  765|    215|  }
  766|    478|  h = newH;
  767|    478|  data[h * line] = 0;
  768|    478|}
_ZN11JBIG2Bitmap11clearToZeroEv:
  770|   105k|void JBIG2Bitmap::clearToZero() {
  771|   105k|  memset(data, 0, h * line);
  772|   105k|}
_ZN11JBIG2Bitmap10clearToOneEv:
  774|  37.8k|void JBIG2Bitmap::clearToOne() {
  775|  37.8k|  memset(data, 0xff, h * line);
  776|  37.8k|}
_ZN11JBIG2Bitmap12duplicateRowEii:
  816|  10.9k|void JBIG2Bitmap::duplicateRow(int yDest, int ySrc) {
  817|  10.9k|  memcpy(data + yDest * line, data + ySrc * line, line);
  818|  10.9k|}
_ZN11JBIG2Bitmap7combineEPS_iij:
  821|  33.2k|			  Guint combOp) {
  822|  33.2k|  int x0, x1, y0, y1, xx, yy;
  823|  33.2k|  Guchar *srcPtr, *destPtr;
  824|  33.2k|  Guchar dest, src0, src1, src, m1, m2, m3;
  825|  33.2k|  Guint s1, s2;
  826|  33.2k|  GBool oneByte;
  827|       |
  828|       |  // check for the pathological case where y = -2^31
  829|  33.2k|  if (y < -0x7fffffff) {
  ------------------
  |  Branch (829:7): [True: 276, False: 32.9k]
  ------------------
  830|    276|    return;
  831|    276|  }
  832|  32.9k|  if (y < 0) {
  ------------------
  |  Branch (832:7): [True: 1.39k, False: 31.5k]
  ------------------
  833|  1.39k|    y0 = -y;
  834|  31.5k|  } else {
  835|  31.5k|    y0 = 0;
  836|  31.5k|  }
  837|  32.9k|  if (y > INT_MAX - bitmap->h) {
  ------------------
  |  Branch (837:7): [True: 456, False: 32.5k]
  ------------------
  838|    456|    return;
  839|    456|  }
  840|  32.5k|  if (y + bitmap->h > h) {
  ------------------
  |  Branch (840:7): [True: 30.0k, False: 2.47k]
  ------------------
  841|  30.0k|    y1 = h - y;
  842|  30.0k|  } else {
  843|  2.47k|    y1 = bitmap->h;
  844|  2.47k|  }
  845|  32.5k|  if (y0 >= y1) {
  ------------------
  |  Branch (845:7): [True: 27.6k, False: 4.87k]
  ------------------
  846|  27.6k|    return;
  847|  27.6k|  }
  848|       |
  849|  4.87k|  if (x >= 0) {
  ------------------
  |  Branch (849:7): [True: 1.42k, False: 3.45k]
  ------------------
  850|  1.42k|    x0 = x & ~7;
  851|  3.45k|  } else {
  852|  3.45k|    x0 = 0;
  853|  3.45k|  }
  854|  4.87k|  x1 = x + bitmap->w;
  855|  4.87k|  if (x1 > w) {
  ------------------
  |  Branch (855:7): [True: 1.18k, False: 3.68k]
  ------------------
  856|  1.18k|    x1 = w;
  857|  1.18k|  }
  858|  4.87k|  if (x0 >= x1) {
  ------------------
  |  Branch (858:7): [True: 3.62k, False: 1.24k]
  ------------------
  859|  3.62k|    return;
  860|  3.62k|  }
  861|       |
  862|  1.24k|  s1 = x & 7;
  863|  1.24k|  s2 = 8 - s1;
  864|  1.24k|  m1 = (Guchar)(0xff >> (x1 & 7));
  865|  1.24k|  m2 = (Guchar)(0xff << (((x1 & 7) == 0) ? 0 : 8 - (x1 & 7)));
  ------------------
  |  Branch (865:26): [True: 0, False: 1.24k]
  ------------------
  866|  1.24k|  m3 = (Guchar)((0xff >> s1) & m2);
  867|       |
  868|  1.24k|  oneByte = x0 == ((x1 - 1) & ~7);
  869|       |
  870|   256k|  for (yy = y0; yy < y1; ++yy) {
  ------------------
  |  Branch (870:17): [True: 255k, False: 1.24k]
  ------------------
  871|       |
  872|       |    // one byte per line -- need to mask both left and right side
  873|   255k|    if (oneByte) {
  ------------------
  |  Branch (873:9): [True: 245k, False: 9.31k]
  ------------------
  874|   245k|      if (x >= 0) {
  ------------------
  |  Branch (874:11): [True: 43.2k, False: 202k]
  ------------------
  875|  43.2k|	destPtr = data + (y + yy) * line + (x >> 3);
  876|  43.2k|	srcPtr = bitmap->data + yy * bitmap->line;
  877|  43.2k|	dest = *destPtr;
  878|  43.2k|	src1 = *srcPtr;
  879|  43.2k|	switch (combOp) {
  ------------------
  |  Branch (879:10): [True: 43.1k, False: 135]
  ------------------
  880|  42.6k|	case 0: // or
  ------------------
  |  Branch (880:2): [True: 42.6k, False: 625]
  ------------------
  881|  42.6k|	  dest |= (Guchar)((src1 >> s1) & m2);
  882|  42.6k|	  break;
  883|      0|	case 1: // and
  ------------------
  |  Branch (883:2): [True: 0, False: 43.2k]
  ------------------
  884|      0|	  dest &= (Guchar)(((0xff00 | src1) >> s1) | m1);
  885|      0|	  break;
  886|      0|	case 2: // xor
  ------------------
  |  Branch (886:2): [True: 0, False: 43.2k]
  ------------------
  887|      0|	  dest ^= (Guchar)((src1 >> s1) & m2);
  888|      0|	  break;
  889|      0|	case 3: // xnor
  ------------------
  |  Branch (889:2): [True: 0, False: 43.2k]
  ------------------
  890|      0|	  dest ^= (Guchar)(((src1 ^ 0xff) >> s1) & m2);
  891|      0|	  break;
  892|    490|	case 4: // replace
  ------------------
  |  Branch (892:2): [True: 490, False: 42.7k]
  ------------------
  893|    490|	  dest = (Guchar)((dest & ~m3) | ((src1 >> s1) & m3));
  894|    490|	  break;
  895|  43.2k|	}
  896|  43.2k|	*destPtr = dest;
  897|   202k|      } else {
  898|   202k|	destPtr = data + (y + yy) * line;
  899|   202k|	srcPtr = bitmap->data + yy * bitmap->line + (-x >> 3);
  900|   202k|	dest = *destPtr;
  901|   202k|	src1 = *srcPtr;
  902|   202k|	switch (combOp) {
  ------------------
  |  Branch (902:10): [True: 202k, False: 220]
  ------------------
  903|      0|	case 0: // or
  ------------------
  |  Branch (903:2): [True: 0, False: 202k]
  ------------------
  904|      0|	  dest |= src1 & m2;
  905|      0|	  break;
  906|   202k|	case 1: // and
  ------------------
  |  Branch (906:2): [True: 202k, False: 237]
  ------------------
  907|   202k|	  dest &= src1 | m1;
  908|   202k|	  break;
  909|     17|	case 2: // xor
  ------------------
  |  Branch (909:2): [True: 17, False: 202k]
  ------------------
  910|     17|	  dest ^= src1 & m2;
  911|     17|	  break;
  912|      0|	case 3: // xnor
  ------------------
  |  Branch (912:2): [True: 0, False: 202k]
  ------------------
  913|      0|	  dest ^= (src1 ^ 0xff) & m2;
  914|      0|	  break;
  915|      0|	case 4: // replace
  ------------------
  |  Branch (915:2): [True: 0, False: 202k]
  ------------------
  916|      0|	  dest = (src1 & m2) | (dest & m1);
  917|      0|	  break;
  918|   202k|	}
  919|   202k|	*destPtr = dest;
  920|   202k|      }
  921|       |
  922|       |    // multiple bytes per line -- need to mask left side of left-most
  923|       |    // byte and right side of right-most byte
  924|   245k|    } else {
  925|       |
  926|       |      // left-most byte
  927|  9.31k|      if (x >= 0) {
  ------------------
  |  Branch (927:11): [True: 9.31k, False: 0]
  ------------------
  928|  9.31k|	destPtr = data + (y + yy) * line + (x >> 3);
  929|  9.31k|	srcPtr = bitmap->data + yy * bitmap->line;
  930|  9.31k|	src1 = *srcPtr++;
  931|  9.31k|	dest = *destPtr;
  932|  9.31k|	switch (combOp) {
  ------------------
  |  Branch (932:10): [True: 9.21k, False: 98]
  ------------------
  933|      0|	case 0: // or
  ------------------
  |  Branch (933:2): [True: 0, False: 9.31k]
  ------------------
  934|      0|	  dest |= (Guchar)(src1 >> s1);
  935|      0|	  break;
  936|      0|	case 1: // and
  ------------------
  |  Branch (936:2): [True: 0, False: 9.31k]
  ------------------
  937|      0|	  dest &= (Guchar)((0xff00 | src1) >> s1);
  938|      0|	  break;
  939|  9.21k|	case 2: // xor
  ------------------
  |  Branch (939:2): [True: 9.21k, False: 103]
  ------------------
  940|  9.21k|	  dest ^= (Guchar)(src1 >> s1);
  941|  9.21k|	  break;
  942|      5|	case 3: // xnor
  ------------------
  |  Branch (942:2): [True: 5, False: 9.31k]
  ------------------
  943|      5|	  dest ^= (Guchar)((src1 ^ 0xff) >> s1);
  944|      5|	  break;
  945|      0|	case 4: // replace
  ------------------
  |  Branch (945:2): [True: 0, False: 9.31k]
  ------------------
  946|      0|	  dest = (Guchar)((dest & (0xff << s2)) | (src1 >> s1));
  947|      0|	  break;
  948|  9.31k|	}
  949|  9.31k|	*destPtr++ = dest;
  950|  9.31k|	xx = x0 + 8;
  951|  9.31k|      } else {
  952|      0|	destPtr = data + (y + yy) * line;
  953|      0|	srcPtr = bitmap->data + yy * bitmap->line + (-x >> 3);
  954|      0|	src1 = *srcPtr++;
  955|      0|	xx = x0;
  956|      0|      }
  957|       |
  958|       |      // middle bytes
  959|   662k|      for (; xx < x1 - 8; xx += 8) {
  ------------------
  |  Branch (959:14): [True: 653k, False: 9.31k]
  ------------------
  960|   653k|	dest = *destPtr;
  961|   653k|	src0 = src1;
  962|   653k|	src1 = *srcPtr++;
  963|   653k|	src = (Guchar)(((src0 << 8) | src1) >> s1);
  964|   653k|	switch (combOp) {
  ------------------
  |  Branch (964:10): [True: 248k, False: 404k]
  ------------------
  965|      0|	case 0: // or
  ------------------
  |  Branch (965:2): [True: 0, False: 653k]
  ------------------
  966|      0|	  dest |= src;
  967|      0|	  break;
  968|      0|	case 1: // and
  ------------------
  |  Branch (968:2): [True: 0, False: 653k]
  ------------------
  969|      0|	  dest &= src;
  970|      0|	  break;
  971|   248k|	case 2: // xor
  ------------------
  |  Branch (971:2): [True: 248k, False: 404k]
  ------------------
  972|   248k|	  dest ^= src;
  973|   248k|	  break;
  974|      5|	case 3: // xnor
  ------------------
  |  Branch (974:2): [True: 5, False: 653k]
  ------------------
  975|      5|	  dest ^= src ^ 0xff;
  976|      5|	  break;
  977|      0|	case 4: // replace
  ------------------
  |  Branch (977:2): [True: 0, False: 653k]
  ------------------
  978|      0|	  dest = src;
  979|      0|	  break;
  980|   653k|	}
  981|   653k|	*destPtr++ = dest;
  982|   653k|      }
  983|       |
  984|       |      // right-most byte
  985|       |      // note: this last byte (src1) may not actually be used, depending
  986|       |      // on the values of s1, m1, and m2 - and in fact, it may be off
  987|       |      // the edge of the source bitmap, which means we need to allocate
  988|       |      // one extra guard byte at the end of each bitmap
  989|  9.31k|      dest = *destPtr;
  990|  9.31k|      src0 = src1;
  991|  9.31k|      src1 = *srcPtr++;
  992|  9.31k|      src = (Guchar)(((src0 << 8) | src1) >> s1);
  993|  9.31k|      switch (combOp) {
  ------------------
  |  Branch (993:15): [True: 9.21k, False: 98]
  ------------------
  994|      0|      case 0: // or
  ------------------
  |  Branch (994:7): [True: 0, False: 9.31k]
  ------------------
  995|      0|	dest |= src & m2;
  996|      0|	break;
  997|      0|      case 1: // and
  ------------------
  |  Branch (997:7): [True: 0, False: 9.31k]
  ------------------
  998|      0|	dest &= src | m1;
  999|      0|	break;
 1000|  9.21k|      case 2: // xor
  ------------------
  |  Branch (1000:7): [True: 9.21k, False: 103]
  ------------------
 1001|  9.21k|	dest ^= src & m2;
 1002|  9.21k|	break;
 1003|      5|      case 3: // xnor
  ------------------
  |  Branch (1003:7): [True: 5, False: 9.31k]
  ------------------
 1004|      5|	dest ^= (src ^ 0xff) & m2;
 1005|      5|	break;
 1006|      0|      case 4: // replace
  ------------------
  |  Branch (1006:7): [True: 0, False: 9.31k]
  ------------------
 1007|      0|	dest = (src & m2) | (dest & m1);
 1008|      0|	break;
 1009|  9.31k|      }
 1010|  9.31k|      *destPtr = dest;
 1011|  9.31k|    }
 1012|   255k|  }
 1013|  1.24k|}
_ZN15JBIG2SymbolDictC2Ejj:
 1046|  4.27k|  JBIG2Segment(segNumA)
 1047|  4.27k|{
 1048|  4.27k|  Guint i;
 1049|       |
 1050|  4.27k|  size = sizeA;
 1051|  4.27k|  bitmaps = (JBIG2Bitmap **)gmallocn(size, sizeof(JBIG2Bitmap *));
 1052|  63.0M|  for (i = 0; i < size; ++i) {
  ------------------
  |  Branch (1052:15): [True: 63.0M, False: 4.27k]
  ------------------
 1053|  63.0M|    bitmaps[i] = NULL;
 1054|  63.0M|  }
 1055|  4.27k|  genericRegionStats = NULL;
 1056|       |  refinementRegionStats = NULL;
 1057|  4.27k|}
_ZN15JBIG2SymbolDictD2Ev:
 1059|  4.27k|JBIG2SymbolDict::~JBIG2SymbolDict() {
 1060|  4.27k|  Guint i;
 1061|       |
 1062|  63.0M|  for (i = 0; i < size; ++i) {
  ------------------
  |  Branch (1062:15): [True: 63.0M, False: 4.27k]
  ------------------
 1063|  63.0M|    if (bitmaps[i]) {
  ------------------
  |  Branch (1063:9): [True: 1.52k, False: 63.0M]
  ------------------
 1064|  1.52k|      delete bitmaps[i];
 1065|  1.52k|    }
 1066|  63.0M|  }
 1067|  4.27k|  gfree(bitmaps);
 1068|  4.27k|  if (genericRegionStats) {
  ------------------
  |  Branch (1068:7): [True: 1.83k, False: 2.44k]
  ------------------
 1069|  1.83k|    delete genericRegionStats;
 1070|  1.83k|  }
 1071|  4.27k|  if (refinementRegionStats) {
  ------------------
  |  Branch (1071:7): [True: 1.35k, False: 2.91k]
  ------------------
 1072|  1.35k|    delete refinementRegionStats;
 1073|  1.35k|  }
 1074|  4.27k|}
_ZN16JBIG2PatternDictC2Ejj:
 1097|  1.27k|  JBIG2Segment(segNumA)
 1098|  1.27k|{
 1099|  1.27k|  size = sizeA;
 1100|  1.27k|  bitmaps = (JBIG2Bitmap **)gmallocn(size, sizeof(JBIG2Bitmap *));
 1101|  1.27k|}
_ZN16JBIG2PatternDictD2Ev:
 1103|  1.27k|JBIG2PatternDict::~JBIG2PatternDict() {
 1104|  1.27k|  Guint i;
 1105|       |
 1106|  4.70k|  for (i = 0; i < size; ++i) {
  ------------------
  |  Branch (1106:15): [True: 3.42k, False: 1.27k]
  ------------------
 1107|  3.42k|    delete bitmaps[i];
 1108|  3.42k|  }
 1109|  1.27k|  gfree(bitmaps);
 1110|  1.27k|}
_ZN14JBIG2CodeTableC2EjP17JBIG2HuffmanTable:
 1130|  6.04k|  JBIG2Segment(segNumA)
 1131|  6.04k|{
 1132|  6.04k|  table = tableA;
 1133|  6.04k|}
_ZN14JBIG2CodeTableD2Ev:
 1135|  6.03k|JBIG2CodeTable::~JBIG2CodeTable() {
 1136|  6.03k|  gfree(table);
 1137|  6.03k|}
_ZN11JBIG2StreamC2EP6StreamP6Object:
 1144|   296k|  FilterStream(strA)
 1145|   296k|{
 1146|   296k|  decoded = gFalse;
  ------------------
  |  |   18|   296k|#define gFalse 0
  ------------------
 1147|   296k|  pageBitmap = NULL;
 1148|       |
 1149|   296k|  arithDecoder = new JArithmeticDecoder();
 1150|   296k|  genericRegionStats = new JArithmeticDecoderStats(1 << 1);
 1151|   296k|  refinementRegionStats = new JArithmeticDecoderStats(1 << 1);
 1152|   296k|  iadhStats = new JArithmeticDecoderStats(1 << 9);
 1153|   296k|  iadwStats = new JArithmeticDecoderStats(1 << 9);
 1154|   296k|  iaexStats = new JArithmeticDecoderStats(1 << 9);
 1155|   296k|  iaaiStats = new JArithmeticDecoderStats(1 << 9);
 1156|   296k|  iadtStats = new JArithmeticDecoderStats(1 << 9);
 1157|   296k|  iaitStats = new JArithmeticDecoderStats(1 << 9);
 1158|   296k|  iafsStats = new JArithmeticDecoderStats(1 << 9);
 1159|   296k|  iadsStats = new JArithmeticDecoderStats(1 << 9);
 1160|   296k|  iardxStats = new JArithmeticDecoderStats(1 << 9);
 1161|   296k|  iardyStats = new JArithmeticDecoderStats(1 << 9);
 1162|   296k|  iardwStats = new JArithmeticDecoderStats(1 << 9);
 1163|   296k|  iardhStats = new JArithmeticDecoderStats(1 << 9);
 1164|   296k|  iariStats = new JArithmeticDecoderStats(1 << 9);
 1165|   296k|  iaidStats = new JArithmeticDecoderStats(1 << 1);
 1166|   296k|  huffDecoder = new JBIG2HuffmanDecoder();
 1167|   296k|  mmrDecoder = new JBIG2MMRDecoder();
 1168|       |
 1169|   296k|  globalsStreamA->copy(&globalsStream);
 1170|   296k|  segments = globalSegments = NULL;
 1171|   296k|  curStr = NULL;
 1172|       |  dataPtr = dataEnd = NULL;
 1173|   296k|}
_ZN11JBIG2StreamD2Ev:
 1175|   296k|JBIG2Stream::~JBIG2Stream() {
 1176|   296k|  close();
 1177|   296k|  globalsStream.free();
 1178|   296k|  delete arithDecoder;
 1179|   296k|  delete genericRegionStats;
 1180|   296k|  delete refinementRegionStats;
 1181|   296k|  delete iadhStats;
 1182|   296k|  delete iadwStats;
 1183|   296k|  delete iaexStats;
 1184|   296k|  delete iaaiStats;
 1185|   296k|  delete iadtStats;
 1186|   296k|  delete iaitStats;
 1187|   296k|  delete iafsStats;
 1188|   296k|  delete iadsStats;
 1189|   296k|  delete iardxStats;
 1190|   296k|  delete iardyStats;
 1191|   296k|  delete iardwStats;
 1192|   296k|  delete iardhStats;
 1193|   296k|  delete iariStats;
 1194|   296k|  delete iaidStats;
 1195|   296k|  delete huffDecoder;
 1196|   296k|  delete mmrDecoder;
 1197|   296k|  delete str;
 1198|   296k|}
_ZN11JBIG2Stream4copyEv:
 1200|   291k|Stream *JBIG2Stream::copy() {
 1201|   291k|  return new JBIG2Stream(str->copy(), &globalsStream);
 1202|   291k|}
_ZN11JBIG2Stream5resetEv:
 1204|  74.7k|void JBIG2Stream::reset() {
 1205|  74.7k|  segments = new GList();
 1206|  74.7k|  globalSegments = new GList();
 1207|  74.7k|  decoded = gFalse;
  ------------------
  |  |   18|  74.7k|#define gFalse 0
  ------------------
 1208|  74.7k|}
_ZN11JBIG2Stream5closeEv:
 1210|   371k|void JBIG2Stream::close() {
 1211|   371k|  if (pageBitmap) {
  ------------------
  |  Branch (1211:7): [True: 51.6k, False: 319k]
  ------------------
 1212|  51.6k|    delete pageBitmap;
 1213|  51.6k|    pageBitmap = NULL;
 1214|  51.6k|  }
 1215|   371k|  if (segments) {
  ------------------
  |  Branch (1215:7): [True: 74.5k, False: 296k]
  ------------------
 1216|  74.5k|    deleteGList(segments, JBIG2Segment);
  ------------------
  |  |   94|  74.5k|  do {                                              \
  |  |   95|  74.5k|    GList *_list = (list);                          \
  |  |   96|  74.5k|    {                                               \
  |  |   97|  74.5k|      int _i;                                       \
  |  |   98|  78.5k|      for (_i = 0; _i < _list->getLength(); ++_i) { \
  |  |  ------------------
  |  |  |  Branch (98:20): [True: 4.03k, False: 74.5k]
  |  |  ------------------
  |  |   99|  4.03k|        delete (T*)_list->get(_i);                  \
  |  |  100|  4.03k|      }                                             \
  |  |  101|  74.5k|      delete _list;                                 \
  |  |  102|  74.5k|    }                                               \
  |  |  103|  74.5k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (103:12): [Folded, False: 74.5k]
  |  |  ------------------
  ------------------
 1217|  74.5k|    segments = NULL;
 1218|  74.5k|  }
 1219|   371k|  if (globalSegments) {
  ------------------
  |  Branch (1219:7): [True: 74.5k, False: 296k]
  ------------------
 1220|  74.5k|    deleteGList(globalSegments, JBIG2Segment);
  ------------------
  |  |   94|  74.5k|  do {                                              \
  |  |   95|  74.5k|    GList *_list = (list);                          \
  |  |   96|  74.5k|    {                                               \
  |  |   97|  74.5k|      int _i;                                       \
  |  |   98|  81.8k|      for (_i = 0; _i < _list->getLength(); ++_i) { \
  |  |  ------------------
  |  |  |  Branch (98:20): [True: 7.34k, False: 74.5k]
  |  |  ------------------
  |  |   99|  7.34k|        delete (T*)_list->get(_i);                  \
  |  |  100|  7.34k|      }                                             \
  |  |  101|  74.5k|      delete _list;                                 \
  |  |  102|  74.5k|    }                                               \
  |  |  103|  74.5k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (103:12): [Folded, False: 74.5k]
  |  |  ------------------
  ------------------
 1221|  74.5k|    globalSegments = NULL;
 1222|  74.5k|  }
 1223|       |  dataPtr = dataEnd = NULL;
 1224|   371k|  FilterStream::close();
 1225|   371k|}
_ZN11JBIG2Stream7getCharEv:
 1227|   449M|int JBIG2Stream::getChar() {
 1228|   449M|  if (!decoded) {
  ------------------
  |  Branch (1228:7): [True: 74.2k, False: 449M]
  ------------------
 1229|  74.2k|    decodeImage();
 1230|  74.2k|  }
 1231|   449M|  if (dataPtr && dataPtr < dataEnd) {
  ------------------
  |  Branch (1231:7): [True: 448M, False: 261k]
  |  Branch (1231:18): [True: 448M, False: 47.4k]
  ------------------
 1232|   448M|    return (*dataPtr++ ^ 0xff) & 0xff;
 1233|   448M|  }
 1234|   309k|  return EOF;
 1235|   449M|}
_ZN11JBIG2Stream8lookCharEv:
 1237|  64.7M|int JBIG2Stream::lookChar() {
 1238|  64.7M|  if (!decoded) {
  ------------------
  |  Branch (1238:7): [True: 0, False: 64.7M]
  ------------------
 1239|      0|    decodeImage();
 1240|      0|  }
 1241|  64.7M|  if (dataPtr && dataPtr < dataEnd) {
  ------------------
  |  Branch (1241:7): [True: 64.7M, False: 0]
  |  Branch (1241:18): [True: 64.7M, False: 10.3k]
  ------------------
 1242|  64.7M|    return (*dataPtr ^ 0xff) & 0xff;
 1243|  64.7M|  }
 1244|  10.3k|  return EOF;
 1245|  64.7M|}
_ZN11JBIG2Stream8getBlockEPci:
 1247|  7.77k|int JBIG2Stream::getBlock(char *blk, int size) {
 1248|  7.77k|  int n, i;
 1249|       |
 1250|  7.77k|  if (!decoded) {
  ------------------
  |  Branch (1250:7): [True: 245, False: 7.53k]
  ------------------
 1251|    245|    decodeImage();
 1252|    245|  }
 1253|  7.77k|  if (size <= 0) {
  ------------------
  |  Branch (1253:7): [True: 0, False: 7.77k]
  ------------------
 1254|      0|    return 0;
 1255|      0|  }
 1256|  7.77k|  if (dataEnd - dataPtr < size) {
  ------------------
  |  Branch (1256:7): [True: 582, False: 7.19k]
  ------------------
 1257|    582|    n = (int)(dataEnd - dataPtr);
 1258|  7.19k|  } else {
 1259|  7.19k|    n = size;
 1260|  7.19k|  }
 1261|  29.8M|  for (i = 0; i < n; ++i) {
  ------------------
  |  Branch (1261:15): [True: 29.8M, False: 7.77k]
  ------------------
 1262|  29.8M|    blk[i] = *dataPtr++ ^ 0xff;
 1263|  29.8M|  }
 1264|  7.77k|  return n;
 1265|  7.77k|}
_ZN11JBIG2Stream11decodeImageEv:
 1276|  74.5k|void JBIG2Stream::decodeImage() {
 1277|  74.5k|  GList *t;
 1278|       |
 1279|       |  // read the globals stream
 1280|  74.5k|  if (globalsStream.isStream()) {
  ------------------
  |  Branch (1280:7): [True: 9.94k, False: 64.5k]
  ------------------
 1281|  9.94k|    curStr = globalsStream.getStream();
 1282|  9.94k|    curStr->reset();
 1283|  9.94k|    arithDecoder->setStream(curStr);
 1284|  9.94k|    huffDecoder->setStream(curStr);
 1285|  9.94k|    mmrDecoder->setStream(curStr);
 1286|  9.94k|    readSegments();
 1287|  9.94k|    curStr->close();
 1288|       |    // swap the newly read segments list into globalSegments
 1289|  9.94k|    t = segments;
 1290|  9.94k|    segments = globalSegments;
 1291|  9.94k|    globalSegments = t;
 1292|  9.94k|  }
 1293|       |
 1294|       |  // read the main stream
 1295|  74.5k|  curStr = str;
 1296|  74.5k|  curStr->reset();
 1297|  74.5k|  arithDecoder->setStream(curStr);
 1298|  74.5k|  huffDecoder->setStream(curStr);
 1299|  74.5k|  mmrDecoder->setStream(curStr);
 1300|  74.5k|  readSegments();
 1301|       |
 1302|  74.5k|  if (pageBitmap) {
  ------------------
  |  Branch (1302:7): [True: 51.6k, False: 22.8k]
  ------------------
 1303|  51.6k|    dataPtr = pageBitmap->getDataPtr();
 1304|  51.6k|    dataEnd = dataPtr + pageBitmap->getDataSize();
 1305|  51.6k|  } else {
 1306|  22.8k|    dataPtr = dataEnd = NULL;
 1307|  22.8k|  }
 1308|       |
 1309|  74.5k|  decoded = gTrue;
  ------------------
  |  |   17|  74.5k|#define gTrue 1
  ------------------
 1310|  74.5k|}
_ZN11JBIG2Stream12readSegmentsEv:
 1312|  84.4k|void JBIG2Stream::readSegments() {
 1313|  84.4k|  Guint segNum, segFlags, segType, page, segLength;
 1314|  84.4k|  Guint refFlags, nRefSegs;
 1315|  84.4k|  Guint *refSegs;
 1316|  84.4k|  int c1, c2, c3;
 1317|  84.4k|  Guint i;
 1318|       |
 1319|  84.4k|  done = gFalse;
  ------------------
  |  |   18|  84.4k|#define gFalse 0
  ------------------
 1320|   202k|  while (!done && readULong(&segNum)) {
  ------------------
  |  Branch (1320:10): [True: 201k, False: 573]
  |  Branch (1320:19): [True: 192k, False: 8.78k]
  ------------------
 1321|       |
 1322|       |    // segment header flags
 1323|   192k|    if (!readUByte(&segFlags)) {
  ------------------
  |  Branch (1323:9): [True: 358, False: 192k]
  ------------------
 1324|    358|      goto eofError1;
 1325|    358|    }
 1326|   192k|    segType = segFlags & 0x3f;
 1327|       |
 1328|       |    // referred-to segment count and retention flags
 1329|   192k|    if (!readUByte(&refFlags)) {
  ------------------
  |  Branch (1329:9): [True: 139, False: 192k]
  ------------------
 1330|    139|      goto eofError1;
 1331|    139|    }
 1332|   192k|    nRefSegs = refFlags >> 5;
 1333|   192k|    if (nRefSegs == 7) {
  ------------------
  |  Branch (1333:9): [True: 9.68k, False: 182k]
  ------------------
 1334|  9.68k|      if ((c1 = curStr->getChar()) == EOF ||
  ------------------
  |  Branch (1334:11): [True: 194, False: 9.48k]
  ------------------
 1335|  9.48k|	  (c2 = curStr->getChar()) == EOF ||
  ------------------
  |  Branch (1335:4): [True: 260, False: 9.22k]
  ------------------
 1336|  9.22k|	  (c3 = curStr->getChar()) == EOF) {
  ------------------
  |  Branch (1336:4): [True: 281, False: 8.94k]
  ------------------
 1337|    735|	goto eofError1;
 1338|    735|      }
 1339|  8.94k|      refFlags = (refFlags << 24) | (c1 << 16) | (c2 << 8) | c3;
 1340|  8.94k|      nRefSegs = refFlags & 0x1fffffff;
 1341|  8.94k|      i = (nRefSegs + 9) >> 3;
 1342|  8.94k|      if (curStr->discardChars(i) != i) {
  ------------------
  |  Branch (1342:11): [True: 1.50k, False: 7.44k]
  ------------------
 1343|  1.50k|	goto eofError1;
 1344|  1.50k|      }
 1345|  8.94k|    }
 1346|       |
 1347|       |    // referred-to segment numbers
 1348|   190k|    refSegs = (Guint *)gmallocn(nRefSegs, sizeof(Guint));
 1349|   190k|    if (segNum <= 256) {
  ------------------
  |  Branch (1349:9): [True: 12.7k, False: 177k]
  ------------------
 1350|  19.9k|      for (i = 0; i < nRefSegs; ++i) {
  ------------------
  |  Branch (1350:19): [True: 7.31k, False: 12.5k]
  ------------------
 1351|  7.31k|	if (!readUByte(&refSegs[i])) {
  ------------------
  |  Branch (1351:6): [True: 129, False: 7.18k]
  ------------------
 1352|    129|	  goto eofError2;
 1353|    129|	}
 1354|  7.31k|      }
 1355|   177k|    } else if (segNum <= 65536) {
  ------------------
  |  Branch (1355:16): [True: 11.5k, False: 165k]
  ------------------
 1356|  7.14M|      for (i = 0; i < nRefSegs; ++i) {
  ------------------
  |  Branch (1356:19): [True: 7.13M, False: 11.1k]
  ------------------
 1357|  7.13M|	if (!readUWord(&refSegs[i])) {
  ------------------
  |  Branch (1357:6): [True: 352, False: 7.13M]
  ------------------
 1358|    352|	  goto eofError2;
 1359|    352|	}
 1360|  7.13M|      }
 1361|   165k|    } else {
 1362|   436k|      for (i = 0; i < nRefSegs; ++i) {
  ------------------
  |  Branch (1362:19): [True: 271k, False: 165k]
  ------------------
 1363|   271k|	if (!readULong(&refSegs[i])) {
  ------------------
  |  Branch (1363:6): [True: 420, False: 271k]
  ------------------
 1364|    420|	  goto eofError2;
 1365|    420|	}
 1366|   271k|      }
 1367|   165k|    }
 1368|       |
 1369|       |    // segment page association
 1370|   189k|    if (segFlags & 0x40) {
  ------------------
  |  Branch (1370:9): [True: 39.3k, False: 149k]
  ------------------
 1371|  39.3k|      if (!readULong(&page)) {
  ------------------
  |  Branch (1371:11): [True: 938, False: 38.4k]
  ------------------
 1372|    938|	goto eofError2;
 1373|    938|      }
 1374|   149k|    } else {
 1375|   149k|      if (!readUByte(&page)) {
  ------------------
  |  Branch (1375:11): [True: 128, False: 149k]
  ------------------
 1376|    128|	goto eofError2;
 1377|    128|      }
 1378|   149k|    }
 1379|       |
 1380|       |    // segment data length
 1381|   188k|    if (!readULong(&segLength)) {
  ------------------
  |  Branch (1381:9): [True: 825, False: 187k]
  ------------------
 1382|    825|      goto eofError2;
 1383|    825|    }
 1384|       |
 1385|       |    // check for missing page information segment
 1386|   187k|    if (!pageBitmap && ((segType >= 4 && segType <= 7) ||
  ------------------
  |  Branch (1386:9): [True: 88.0k, False: 99.2k]
  |  Branch (1386:26): [True: 71.3k, False: 16.7k]
  |  Branch (1386:42): [True: 20, False: 71.3k]
  ------------------
 1387|  88.0k|			(segType >= 20 && segType <= 43))) {
  ------------------
  |  Branch (1387:5): [True: 68.7k, False: 19.3k]
  |  Branch (1387:22): [True: 3.44k, False: 65.2k]
  ------------------
 1388|  3.46k|      error(errSyntaxError, getPos(),
 1389|  3.46k|	    "First JBIG2 segment associated with a page must be a page information segment");
 1390|  3.46k|      goto syntaxError;
 1391|  3.46k|    }
 1392|       |
 1393|       |    // read the segment data
 1394|   183k|    arithDecoder->resetByteCounter();
 1395|   183k|    huffDecoder->resetByteCounter();
 1396|   183k|    mmrDecoder->resetByteCounter();
 1397|   183k|    byteCounter = 0;
 1398|   183k|    switch (segType) {
 1399|  17.1k|    case 0:
  ------------------
  |  Branch (1399:5): [True: 17.1k, False: 166k]
  ------------------
 1400|  17.1k|      if (!readSymbolDictSeg(segNum, segLength, refSegs, nRefSegs)) {
  ------------------
  |  Branch (1400:11): [True: 13.8k, False: 3.29k]
  ------------------
 1401|  13.8k|	goto syntaxError;
 1402|  13.8k|      }
 1403|  3.29k|      break;
 1404|  3.29k|    case 4:
  ------------------
  |  Branch (1404:5): [True: 1.13k, False: 182k]
  ------------------
 1405|  1.13k|      readTextRegionSeg(segNum, gFalse, gFalse, segLength, refSegs, nRefSegs);
  ------------------
  |  |   18|  1.13k|#define gFalse 0
  ------------------
                    readTextRegionSeg(segNum, gFalse, gFalse, segLength, refSegs, nRefSegs);
  ------------------
  |  |   18|  1.13k|#define gFalse 0
  ------------------
 1406|  1.13k|      break;
 1407|  6.70k|    case 6:
  ------------------
  |  Branch (1407:5): [True: 6.70k, False: 177k]
  ------------------
 1408|  6.70k|      readTextRegionSeg(segNum, gTrue, gFalse, segLength, refSegs, nRefSegs);
  ------------------
  |  |   17|  6.70k|#define gTrue 1
  ------------------
                    readTextRegionSeg(segNum, gTrue, gFalse, segLength, refSegs, nRefSegs);
  ------------------
  |  |   18|  6.70k|#define gFalse 0
  ------------------
 1409|  6.70k|      break;
 1410|  13.1k|    case 7:
  ------------------
  |  Branch (1410:5): [True: 13.1k, False: 170k]
  ------------------
 1411|  13.1k|      readTextRegionSeg(segNum, gTrue, gTrue, segLength, refSegs, nRefSegs);
  ------------------
  |  |   17|  13.1k|#define gTrue 1
  ------------------
                    readTextRegionSeg(segNum, gTrue, gTrue, segLength, refSegs, nRefSegs);
  ------------------
  |  |   17|  13.1k|#define gTrue 1
  ------------------
 1412|  13.1k|      break;
 1413|  2.48k|    case 16:
  ------------------
  |  Branch (1413:5): [True: 2.48k, False: 181k]
  ------------------
 1414|  2.48k|      readPatternDictSeg(segNum, segLength);
 1415|  2.48k|      break;
 1416|  6.23k|    case 20:
  ------------------
  |  Branch (1416:5): [True: 6.23k, False: 177k]
  ------------------
 1417|  6.23k|      readHalftoneRegionSeg(segNum, gFalse, gFalse, segLength,
  ------------------
  |  |   18|  6.23k|#define gFalse 0
  ------------------
                    readHalftoneRegionSeg(segNum, gFalse, gFalse, segLength,
  ------------------
  |  |   18|  6.23k|#define gFalse 0
  ------------------
 1418|  6.23k|			    refSegs, nRefSegs);
 1419|  6.23k|      break;
 1420|    879|    case 22:
  ------------------
  |  Branch (1420:5): [True: 879, False: 182k]
  ------------------
 1421|    879|      readHalftoneRegionSeg(segNum, gTrue, gFalse, segLength,
  ------------------
  |  |   17|    879|#define gTrue 1
  ------------------
                    readHalftoneRegionSeg(segNum, gTrue, gFalse, segLength,
  ------------------
  |  |   18|    879|#define gFalse 0
  ------------------
 1422|    879|			    refSegs, nRefSegs);
 1423|    879|      break;
 1424|    252|    case 23:
  ------------------
  |  Branch (1424:5): [True: 252, False: 183k]
  ------------------
 1425|    252|      readHalftoneRegionSeg(segNum, gTrue, gTrue, segLength,
  ------------------
  |  |   17|    252|#define gTrue 1
  ------------------
                    readHalftoneRegionSeg(segNum, gTrue, gTrue, segLength,
  ------------------
  |  |   17|    252|#define gTrue 1
  ------------------
 1426|    252|			    refSegs, nRefSegs);
 1427|    252|      break;
 1428|    841|    case 36:
  ------------------
  |  Branch (1428:5): [True: 841, False: 183k]
  ------------------
 1429|    841|      readGenericRegionSeg(segNum, gFalse, gFalse, segLength);
  ------------------
  |  |   18|    841|#define gFalse 0
  ------------------
                    readGenericRegionSeg(segNum, gFalse, gFalse, segLength);
  ------------------
  |  |   18|    841|#define gFalse 0
  ------------------
 1430|    841|      break;
 1431|  6.64k|    case 38:
  ------------------
  |  Branch (1431:5): [True: 6.64k, False: 177k]
  ------------------
 1432|  6.64k|      readGenericRegionSeg(segNum, gTrue, gFalse, segLength);
  ------------------
  |  |   17|  6.64k|#define gTrue 1
  ------------------
                    readGenericRegionSeg(segNum, gTrue, gFalse, segLength);
  ------------------
  |  |   18|  6.64k|#define gFalse 0
  ------------------
 1433|  6.64k|      break;
 1434|  1.60k|    case 39:
  ------------------
  |  Branch (1434:5): [True: 1.60k, False: 182k]
  ------------------
 1435|  1.60k|      readGenericRegionSeg(segNum, gTrue, gTrue, segLength);
  ------------------
  |  |   17|  1.60k|#define gTrue 1
  ------------------
                    readGenericRegionSeg(segNum, gTrue, gTrue, segLength);
  ------------------
  |  |   17|  1.60k|#define gTrue 1
  ------------------
 1436|  1.60k|      break;
 1437|  1.35k|    case 40:
  ------------------
  |  Branch (1437:5): [True: 1.35k, False: 182k]
  ------------------
 1438|  1.35k|      readGenericRefinementRegionSeg(segNum, gFalse, gFalse, segLength,
  ------------------
  |  |   18|  1.35k|#define gFalse 0
  ------------------
                    readGenericRefinementRegionSeg(segNum, gFalse, gFalse, segLength,
  ------------------
  |  |   18|  1.35k|#define gFalse 0
  ------------------
 1439|  1.35k|				     refSegs, nRefSegs);
 1440|  1.35k|      break;
 1441|    391|    case 42:
  ------------------
  |  Branch (1441:5): [True: 391, False: 183k]
  ------------------
 1442|    391|      readGenericRefinementRegionSeg(segNum, gTrue, gFalse, segLength,
  ------------------
  |  |   17|    391|#define gTrue 1
  ------------------
                    readGenericRefinementRegionSeg(segNum, gTrue, gFalse, segLength,
  ------------------
  |  |   18|    391|#define gFalse 0
  ------------------
 1443|    391|				     refSegs, nRefSegs);
 1444|    391|      break;
 1445|  5.51k|    case 43:
  ------------------
  |  Branch (1445:5): [True: 5.51k, False: 178k]
  ------------------
 1446|  5.51k|      readGenericRefinementRegionSeg(segNum, gTrue, gTrue, segLength,
  ------------------
  |  |   17|  5.51k|#define gTrue 1
  ------------------
                    readGenericRefinementRegionSeg(segNum, gTrue, gTrue, segLength,
  ------------------
  |  |   17|  5.51k|#define gTrue 1
  ------------------
 1447|  5.51k|				     refSegs, nRefSegs);
 1448|  5.51k|      break;
 1449|   107k|    case 48:
  ------------------
  |  Branch (1449:5): [True: 107k, False: 76.7k]
  ------------------
 1450|   107k|      readPageInfoSeg(segLength);
 1451|   107k|      break;
 1452|    350|    case 50:
  ------------------
  |  Branch (1452:5): [True: 350, False: 183k]
  ------------------
 1453|    350|      readEndOfStripeSeg(segLength);
 1454|    350|      break;
 1455|    222|    case 51:
  ------------------
  |  Branch (1455:5): [True: 222, False: 183k]
  ------------------
 1456|       |      // end of file segment
 1457|    222|      done = gTrue;
  ------------------
  |  |   17|    222|#define gTrue 1
  ------------------
 1458|    222|      break;
 1459|    218|    case 52:
  ------------------
  |  Branch (1459:5): [True: 218, False: 183k]
  ------------------
 1460|    218|      readProfilesSeg(segLength);
 1461|    218|      break;
 1462|  7.57k|    case 53:
  ------------------
  |  Branch (1462:5): [True: 7.57k, False: 176k]
  ------------------
 1463|  7.57k|      readCodeTableSeg(segNum, segLength);
 1464|  7.57k|      break;
 1465|    625|    case 62:
  ------------------
  |  Branch (1465:5): [True: 625, False: 183k]
  ------------------
 1466|    625|      readExtensionSeg(segLength);
 1467|    625|      break;
 1468|  3.41k|    default:
  ------------------
  |  Branch (1468:5): [True: 3.41k, False: 180k]
  ------------------
 1469|  3.41k|      error(errSyntaxError, getPos(), "Unknown segment type in JBIG2 stream");
 1470|  3.41k|      if (curStr->discardChars(segLength) != segLength) {
  ------------------
  |  Branch (1470:11): [True: 1.92k, False: 1.48k]
  ------------------
 1471|  1.92k|	goto eofError2;
 1472|  1.92k|      }
 1473|  1.48k|      break;
 1474|   183k|    }
 1475|       |
 1476|       |    // skip any unused data at the end of the segment
 1477|       |    // (except for immediate generic region segments which have
 1478|       |    // 0xffffffff = unspecified length)
 1479|   168k|    if (!(segType == 38 && segLength == 0xffffffff)) {
  ------------------
  |  Branch (1479:11): [True: 6.64k, False: 161k]
  |  Branch (1479:28): [True: 244, False: 6.39k]
  ------------------
 1480|   167k|      byteCounter += arithDecoder->getByteCounter();
 1481|   167k|      byteCounter += huffDecoder->getByteCounter();
 1482|   167k|      byteCounter += mmrDecoder->getByteCounter();
 1483|       |      // do a sanity check on byteCounter vs segLength -- if there is
 1484|       |      // a problem, abort the decode
 1485|   167k|      if (byteCounter > segLength ||
  ------------------
  |  Branch (1485:11): [True: 4.14k, False: 163k]
  ------------------
 1486|   163k|	  segLength - byteCounter > 65536) {
  ------------------
  |  Branch (1486:4): [True: 46.1k, False: 117k]
  ------------------
 1487|  50.3k|	error(errSyntaxError, getPos(),
 1488|  50.3k|	      "Invalid segment length in JBIG2 stream");
 1489|  50.3k|	gfree(refSegs);
 1490|  50.3k|	break;
 1491|  50.3k|      }
 1492|   117k|      byteCounter += curStr->discardChars(segLength - byteCounter);
 1493|   117k|    }
 1494|       |
 1495|   117k|    gfree(refSegs);
 1496|   117k|  }
 1497|       |
 1498|  59.6k|  return;
 1499|       |
 1500|  59.6k| syntaxError:
 1501|  17.3k|  gfree(refSegs);
 1502|  17.3k|  return;
 1503|       |
 1504|  4.72k| eofError2:
 1505|  4.72k|  gfree(refSegs);
 1506|  7.45k| eofError1:
 1507|  7.45k|  error(errSyntaxError, getPos(), "Unexpected EOF in JBIG2 stream");
 1508|  7.45k|}
_ZN11JBIG2Stream17readSymbolDictSegEjjPjj:
 1511|  17.1k|				     Guint *refSegs, Guint nRefSegs) {
 1512|  17.1k|  JBIG2SymbolDict *symbolDict;
 1513|  17.1k|  JBIG2HuffmanTable *huffDHTable, *huffDWTable;
 1514|  17.1k|  JBIG2HuffmanTable *huffBMSizeTable, *huffAggInstTable;
 1515|  17.1k|  JBIG2Segment *seg;
 1516|  17.1k|  GList *codeTables;
 1517|  17.1k|  JBIG2SymbolDict *inputSymbolDict;
 1518|  17.1k|  Guint flags, sdTemplate, sdrTemplate, huff, refAgg;
 1519|  17.1k|  Guint huffDH, huffDW, huffBMSize, huffAggInst;
 1520|  17.1k|  Guint contextUsed, contextRetained;
 1521|  17.1k|  int sdATX[4], sdATY[4], sdrATX[2], sdrATY[2];
 1522|  17.1k|  Guint numExSyms, numNewSyms, numInputSyms, symCodeLen;
 1523|  17.1k|  JBIG2Bitmap **bitmaps;
 1524|  17.1k|  JBIG2Bitmap *collBitmap, *refBitmap;
 1525|  17.1k|  Guint *symWidths;
 1526|  17.1k|  Guint symHeight, symWidth, totalWidth, x, symID;
 1527|  17.1k|  int dh, dw, refAggNum, refDX, refDY, bmSize;
 1528|  17.1k|  GBool ex;
 1529|  17.1k|  int run, prevRun, cnt;
 1530|  17.1k|  Guint i, j, k;
 1531|       |
 1532|  17.1k|  symWidths = NULL;
 1533|       |
 1534|       |  // symbol dictionary flags
 1535|  17.1k|  if (!readUWord(&flags)) {
  ------------------
  |  Branch (1535:7): [True: 378, False: 16.7k]
  ------------------
 1536|    378|    goto eofError;
 1537|    378|  }
 1538|  16.7k|  sdTemplate = (flags >> 10) & 3;
 1539|  16.7k|  sdrTemplate = (flags >> 12) & 1;
 1540|  16.7k|  huff = flags & 1;
 1541|  16.7k|  refAgg = (flags >> 1) & 1;
 1542|  16.7k|  huffDH = (flags >> 2) & 3;
 1543|  16.7k|  huffDW = (flags >> 4) & 3;
 1544|  16.7k|  huffBMSize = (flags >> 6) & 1;
 1545|  16.7k|  huffAggInst = (flags >> 7) & 1;
 1546|  16.7k|  contextUsed = (flags >> 8) & 1;
 1547|  16.7k|  contextRetained = (flags >> 9) & 1;
 1548|       |
 1549|       |  // symbol dictionary AT flags
 1550|  16.7k|  if (!huff) {
  ------------------
  |  Branch (1550:7): [True: 9.81k, False: 6.94k]
  ------------------
 1551|  9.81k|    if (sdTemplate == 0) {
  ------------------
  |  Branch (1551:9): [True: 6.13k, False: 3.67k]
  ------------------
 1552|  6.13k|      if (!readByte(&sdATX[0]) ||
  ------------------
  |  Branch (1552:11): [True: 254, False: 5.87k]
  ------------------
 1553|  5.87k|	  !readByte(&sdATY[0]) ||
  ------------------
  |  Branch (1553:4): [True: 249, False: 5.63k]
  ------------------
 1554|  5.63k|	  !readByte(&sdATX[1]) ||
  ------------------
  |  Branch (1554:4): [True: 128, False: 5.50k]
  ------------------
 1555|  5.50k|	  !readByte(&sdATY[1]) ||
  ------------------
  |  Branch (1555:4): [True: 128, False: 5.37k]
  ------------------
 1556|  5.37k|	  !readByte(&sdATX[2]) ||
  ------------------
  |  Branch (1556:4): [True: 255, False: 5.11k]
  ------------------
 1557|  5.11k|	  !readByte(&sdATY[2]) ||
  ------------------
  |  Branch (1557:4): [True: 255, False: 4.86k]
  ------------------
 1558|  4.86k|	  !readByte(&sdATX[3]) ||
  ------------------
  |  Branch (1558:4): [True: 255, False: 4.60k]
  ------------------
 1559|  4.60k|	  !readByte(&sdATY[3])) {
  ------------------
  |  Branch (1559:4): [True: 245, False: 4.36k]
  ------------------
 1560|  1.76k|	goto eofError;
 1561|  1.76k|      }
 1562|  6.13k|    } else {
 1563|  3.67k|      if (!readByte(&sdATX[0]) ||
  ------------------
  |  Branch (1563:11): [True: 221, False: 3.45k]
  ------------------
 1564|  3.45k|	  !readByte(&sdATY[0])) {
  ------------------
  |  Branch (1564:4): [True: 257, False: 3.20k]
  ------------------
 1565|    478|	goto eofError;
 1566|    478|      }
 1567|  3.67k|    }
 1568|  9.81k|  }
 1569|       |
 1570|       |  // symbol dictionary refinement AT flags
 1571|  14.5k|  if (refAgg && !sdrTemplate) {
  ------------------
  |  Branch (1571:7): [True: 6.82k, False: 7.68k]
  |  Branch (1571:17): [True: 2.57k, False: 4.25k]
  ------------------
 1572|  2.57k|    if (!readByte(&sdrATX[0]) ||
  ------------------
  |  Branch (1572:9): [True: 128, False: 2.44k]
  ------------------
 1573|  2.44k|	!readByte(&sdrATY[0]) ||
  ------------------
  |  Branch (1573:2): [True: 128, False: 2.31k]
  ------------------
 1574|  2.31k|	!readByte(&sdrATX[1]) ||
  ------------------
  |  Branch (1574:2): [True: 132, False: 2.18k]
  ------------------
 1575|  2.18k|	!readByte(&sdrATY[1])) {
  ------------------
  |  Branch (1575:2): [True: 128, False: 2.05k]
  ------------------
 1576|    516|      goto eofError;
 1577|    516|    }
 1578|  2.57k|  }
 1579|       |
 1580|       |  // SDNUMEXSYMS and SDNUMNEWSYMS
 1581|  13.9k|  if (!readULong(&numExSyms) || !readULong(&numNewSyms)) {
  ------------------
  |  Branch (1581:7): [True: 882, False: 13.1k]
  |  Branch (1581:33): [True: 949, False: 12.1k]
  ------------------
 1582|  1.83k|    goto eofError;
 1583|  1.83k|  }
 1584|       |
 1585|       |  // get referenced segments: input symbol dictionaries and code tables
 1586|  12.1k|  codeTables = new GList();
 1587|  12.1k|  numInputSyms = 0;
 1588|  1.53M|  for (i = 0; i < nRefSegs; ++i) {
  ------------------
  |  Branch (1588:15): [True: 1.52M, False: 12.1k]
  ------------------
 1589|  1.52M|    if ((seg = findSegment(refSegs[i]))) {
  ------------------
  |  Branch (1589:9): [True: 6.87k, False: 1.51M]
  ------------------
 1590|  6.87k|      if (seg->getType() == jbig2SegSymbolDict) {
  ------------------
  |  Branch (1590:11): [True: 1.67k, False: 5.20k]
  ------------------
 1591|  1.67k|	j = ((JBIG2SymbolDict *)seg)->getSize();
 1592|  1.67k|	if (j > INT_MAX || numInputSyms > INT_MAX - j) {
  ------------------
  |  Branch (1592:6): [True: 0, False: 1.67k]
  |  Branch (1592:21): [True: 0, False: 1.67k]
  ------------------
 1593|      0|	  error(errSyntaxError, getPos(),
 1594|      0|		"Too many input symbols in JBIG2 symbol dictionary");
 1595|      0|	  delete codeTables;
 1596|      0|	  goto eofError;
 1597|      0|	}
 1598|  1.67k|	numInputSyms += j;
 1599|  5.20k|      } else if (seg->getType() == jbig2SegCodeTable) {
  ------------------
  |  Branch (1599:18): [True: 4.42k, False: 775]
  ------------------
 1600|  4.42k|	codeTables->append(seg);
 1601|  4.42k|      }
 1602|  6.87k|    }
 1603|  1.52M|  }
 1604|  12.1k|  if (numNewSyms > INT_MAX || numInputSyms > INT_MAX - numNewSyms) {
  ------------------
  |  Branch (1604:7): [True: 2.71k, False: 9.44k]
  |  Branch (1604:31): [True: 0, False: 9.44k]
  ------------------
 1605|  2.71k|    error(errSyntaxError, getPos(),
 1606|  2.71k|	  "Too many input symbols in JBIG2 symbol dictionary");
 1607|  2.71k|    delete codeTables;
 1608|  2.71k|    goto eofError;
 1609|  2.71k|  }
 1610|       |
 1611|       |  // compute symbol code length
 1612|  9.44k|  i = numInputSyms + numNewSyms;
 1613|  9.44k|  if (i <= 1) {
  ------------------
  |  Branch (1613:7): [True: 4.01k, False: 5.43k]
  ------------------
 1614|  4.01k|    symCodeLen = huff ? 1 : 0;
  ------------------
  |  Branch (1614:18): [True: 1.23k, False: 2.78k]
  ------------------
 1615|  5.43k|  } else {
 1616|  5.43k|    --i;
 1617|  5.43k|    symCodeLen = 0;
 1618|       |    // i = floor((numSyms-1) / 2^symCodeLen)
 1619|  53.5k|    while (i > 0) {
  ------------------
  |  Branch (1619:12): [True: 48.1k, False: 5.43k]
  ------------------
 1620|  48.1k|      ++symCodeLen;
 1621|  48.1k|      i >>= 1;
 1622|  48.1k|    }
 1623|  5.43k|  }
 1624|       |
 1625|       |  // get the input symbol bitmaps
 1626|  9.44k|  bitmaps = (JBIG2Bitmap **)gmallocn(numInputSyms + numNewSyms,
 1627|  9.44k|				     sizeof(JBIG2Bitmap *));
 1628|   461M|  for (i = 0; i < numInputSyms + numNewSyms; ++i) {
  ------------------
  |  Branch (1628:15): [True: 461M, False: 9.44k]
  ------------------
 1629|   461M|    bitmaps[i] = NULL;
 1630|   461M|  }
 1631|  9.44k|  k = 0;
 1632|  9.44k|  inputSymbolDict = NULL;
 1633|  1.29M|  for (i = 0; i < nRefSegs; ++i) {
  ------------------
  |  Branch (1633:15): [True: 1.28M, False: 9.44k]
  ------------------
 1634|  1.28M|    if ((seg = findSegment(refSegs[i]))) {
  ------------------
  |  Branch (1634:9): [True: 4.79k, False: 1.28M]
  ------------------
 1635|  4.79k|      if (seg->getType() == jbig2SegSymbolDict) {
  ------------------
  |  Branch (1635:11): [True: 745, False: 4.05k]
  ------------------
 1636|    745|	inputSymbolDict = (JBIG2SymbolDict *)seg;
 1637|    745|	for (j = 0; j < inputSymbolDict->getSize(); ++j) {
  ------------------
  |  Branch (1637:14): [True: 0, False: 745]
  ------------------
 1638|      0|	  bitmaps[k++] = inputSymbolDict->getBitmap(j);
 1639|      0|	}
 1640|    745|      }
 1641|  4.79k|    }
 1642|  1.28M|  }
 1643|       |
 1644|       |  // get the Huffman tables
 1645|  9.44k|  huffDHTable = huffDWTable = NULL; // make gcc happy
 1646|  9.44k|  huffBMSizeTable = huffAggInstTable = NULL; // make gcc happy
 1647|  9.44k|  i = 0;
 1648|  9.44k|  if (huff) {
  ------------------
  |  Branch (1648:7): [True: 4.10k, False: 5.34k]
  ------------------
 1649|  4.10k|    if (huffDH == 0) {
  ------------------
  |  Branch (1649:9): [True: 2.20k, False: 1.90k]
  ------------------
 1650|  2.20k|      huffDHTable = huffTableD;
 1651|  2.20k|    } else if (huffDH == 1) {
  ------------------
  |  Branch (1651:16): [True: 1.25k, False: 643]
  ------------------
 1652|  1.25k|      huffDHTable = huffTableE;
 1653|  1.25k|    } else {
 1654|    643|      if (i >= (Guint)codeTables->getLength()) {
  ------------------
  |  Branch (1654:11): [True: 284, False: 359]
  ------------------
 1655|    284|	goto codeTableError;
 1656|    284|      }
 1657|    359|      huffDHTable = ((JBIG2CodeTable *)codeTables->get(i++))->getHuffTable();
 1658|    359|    }
 1659|  3.81k|    if (huffDW == 0) {
  ------------------
  |  Branch (1659:9): [True: 2.45k, False: 1.36k]
  ------------------
 1660|  2.45k|      huffDWTable = huffTableB;
 1661|  2.45k|    } else if (huffDW == 1) {
  ------------------
  |  Branch (1661:16): [True: 256, False: 1.10k]
  ------------------
 1662|    256|      huffDWTable = huffTableC;
 1663|  1.10k|    } else {
 1664|  1.10k|      if (i >= (Guint)codeTables->getLength()) {
  ------------------
  |  Branch (1664:11): [True: 492, False: 612]
  ------------------
 1665|    492|	goto codeTableError;
 1666|    492|      }
 1667|    612|      huffDWTable = ((JBIG2CodeTable *)codeTables->get(i++))->getHuffTable();
 1668|    612|    }
 1669|  3.32k|    if (huffBMSize == 0) {
  ------------------
  |  Branch (1669:9): [True: 2.45k, False: 868]
  ------------------
 1670|  2.45k|      huffBMSizeTable = huffTableA;
 1671|  2.45k|    } else {
 1672|    868|      if (i >= (Guint)codeTables->getLength()) {
  ------------------
  |  Branch (1672:11): [True: 584, False: 284]
  ------------------
 1673|    584|	goto codeTableError;
 1674|    584|      }
 1675|    284|      huffBMSizeTable =
 1676|    284|	  ((JBIG2CodeTable *)codeTables->get(i++))->getHuffTable();
 1677|    284|    }
 1678|  2.74k|    if (huffAggInst == 0) {
  ------------------
  |  Branch (1678:9): [True: 2.20k, False: 535]
  ------------------
 1679|  2.20k|      huffAggInstTable = huffTableA;
 1680|  2.20k|    } else {
 1681|    535|      if (i >= (Guint)codeTables->getLength()) {
  ------------------
  |  Branch (1681:11): [True: 191, False: 344]
  ------------------
 1682|    191|	goto codeTableError;
 1683|    191|      }
 1684|    344|      huffAggInstTable =
 1685|    344|	  ((JBIG2CodeTable *)codeTables->get(i++))->getHuffTable();
 1686|    344|    }
 1687|  2.74k|  }
 1688|  7.89k|  delete codeTables;
 1689|       |
 1690|       |  // set up the Huffman decoder
 1691|  7.89k|  if (huff) {
  ------------------
  |  Branch (1691:7): [True: 2.54k, False: 5.34k]
  ------------------
 1692|  2.54k|    huffDecoder->reset();
 1693|       |
 1694|       |  // set up the arithmetic decoder
 1695|  5.34k|  } else {
 1696|  5.34k|    if (contextUsed && inputSymbolDict) {
  ------------------
  |  Branch (1696:9): [True: 1.91k, False: 3.43k]
  |  Branch (1696:24): [True: 185, False: 1.73k]
  ------------------
 1697|    185|      resetGenericStats(sdTemplate, inputSymbolDict->getGenericRegionStats());
 1698|  5.16k|    } else {
 1699|  5.16k|      resetGenericStats(sdTemplate, NULL);
 1700|  5.16k|    }
 1701|  5.34k|    resetIntStats(symCodeLen);
 1702|  5.34k|    arithDecoder->start();
 1703|  5.34k|  }
 1704|       |
 1705|       |  // set up the arithmetic decoder for refinement/aggregation
 1706|  7.89k|  if (refAgg) {
  ------------------
  |  Branch (1706:7): [True: 2.91k, False: 4.98k]
  ------------------
 1707|  2.91k|    if (contextUsed && inputSymbolDict) {
  ------------------
  |  Branch (1707:9): [True: 2.62k, False: 291]
  |  Branch (1707:24): [True: 401, False: 2.22k]
  ------------------
 1708|    401|      resetRefinementStats(sdrTemplate,
 1709|    401|			   inputSymbolDict->getRefinementRegionStats());
 1710|  2.51k|    } else {
 1711|  2.51k|      resetRefinementStats(sdrTemplate, NULL);
 1712|  2.51k|    }
 1713|  2.91k|  }
 1714|       |
 1715|       |  // allocate symbol widths storage
 1716|  7.89k|  if (huff && !refAgg) {
  ------------------
  |  Branch (1716:7): [True: 2.54k, False: 5.34k]
  |  Branch (1716:15): [True: 1.55k, False: 995]
  ------------------
 1717|  1.55k|    symWidths = (Guint *)gmallocn(numNewSyms, sizeof(Guint));
 1718|  1.55k|  }
 1719|       |
 1720|  7.89k|  symHeight = 0;
 1721|  7.89k|  i = 0;
 1722|  11.3k|  while (i < numNewSyms) {
  ------------------
  |  Branch (1722:10): [True: 7.03k, False: 4.29k]
  ------------------
 1723|       |
 1724|       |    // read the height class delta height
 1725|  7.03k|    if (!(huff ? huffDecoder->decodeInt(&dh, huffDHTable) :
  ------------------
  |  Branch (1725:9): [True: 276, False: 6.75k]
  |  Branch (1725:11): [True: 3.93k, False: 3.10k]
  ------------------
 1726|  7.03k|	         arithDecoder->decodeInt(&dh, iadhStats)) ||
 1727|  6.75k|	(dh <= 0 && (Guint)-dh >= symHeight) ||
  ------------------
  |  Branch (1727:3): [True: 338, False: 6.41k]
  |  Branch (1727:14): [True: 287, False: 51]
  ------------------
 1728|  6.46k|	(dh > 0 && (Guint)dh > UINT_MAX - symHeight)) {
  ------------------
  |  Branch (1728:3): [True: 6.41k, False: 51]
  |  Branch (1728:13): [True: 0, False: 6.41k]
  ------------------
 1729|    563|      error(errSyntaxError, getPos(),
 1730|    563|	    "Bad delta-height value in JBIG2 symbol dictionary");
 1731|    563|      goto syntaxError;
 1732|    563|    }
 1733|  6.46k|    symHeight += dh;
 1734|  6.46k|    symWidth = 0;
 1735|  6.46k|    totalWidth = 0;
 1736|  6.46k|    j = i;
 1737|       |
 1738|       |    // sanity check to avoid extremely long run-times with damaged streams
 1739|  6.46k|    if (symHeight > 100000) {
  ------------------
  |  Branch (1739:9): [True: 497, False: 5.97k]
  ------------------
 1740|    497|      error(errSyntaxError, getPos(),
 1741|    497|	    "Bogus symbol height value in JBIG2 symbol dictionary");
 1742|    497|      goto syntaxError;
 1743|    497|    }
 1744|       |
 1745|       |    // read the symbols in this height class
 1746|  80.2k|    while (1) {
  ------------------
  |  Branch (1746:12): [True: 80.1k, Folded]
  ------------------
 1747|       |
 1748|       |      // read the delta width
 1749|  80.1k|      if (huff) {
  ------------------
  |  Branch (1749:11): [True: 55.8k, False: 24.3k]
  ------------------
 1750|  55.8k|	if (!huffDecoder->decodeInt(&dw, huffDWTable)) {
  ------------------
  |  Branch (1750:6): [True: 2.40k, False: 53.4k]
  ------------------
 1751|  2.40k|	  break;
 1752|  2.40k|	}
 1753|  55.8k|      } else {
 1754|  24.3k|	if (!arithDecoder->decodeInt(&dw, iadwStats)) {
  ------------------
  |  Branch (1754:6): [True: 1.43k, False: 22.8k]
  ------------------
 1755|  1.43k|	  break;
 1756|  1.43k|	}
 1757|  24.3k|      }
 1758|  76.3k|      if ((dw <= 0 && (Guint)-dw >= symWidth) ||
  ------------------
  |  Branch (1758:12): [True: 31.4k, False: 44.9k]
  |  Branch (1758:23): [True: 758, False: 30.6k]
  ------------------
 1759|  75.5k|	  (dw > 0 && (Guint)dw > UINT_MAX - symWidth)) {
  ------------------
  |  Branch (1759:5): [True: 44.9k, False: 30.6k]
  |  Branch (1759:15): [True: 0, False: 44.9k]
  ------------------
 1760|    758|	error(errSyntaxError, getPos(),
 1761|    758|	      "Bad delta-height value in JBIG2 symbol dictionary");
 1762|    758|	goto syntaxError;
 1763|    758|      }
 1764|  75.5k|      symWidth += dw;
 1765|  75.5k|      if (i >= numNewSyms) {
  ------------------
  |  Branch (1765:11): [True: 160, False: 75.4k]
  ------------------
 1766|    160|	error(errSyntaxError, getPos(),
 1767|    160|	      "Too many symbols in JBIG2 symbol dictionary");
 1768|    160|	goto syntaxError;
 1769|    160|      }
 1770|       |
 1771|       |      // sanity check to avoid extremely long run-times with damaged streams
 1772|  75.4k|      if (symWidth > 100000) {
  ------------------
  |  Branch (1772:11): [True: 136, False: 75.2k]
  ------------------
 1773|    136|	error(errSyntaxError, getPos(),
 1774|    136|	      "Bogus symbol width value in JBIG2 symbol dictionary");
 1775|    136|	goto syntaxError;
 1776|    136|      }
 1777|       |
 1778|       |      // using a collective bitmap, so don't read a bitmap here
 1779|  75.2k|      if (huff && !refAgg) {
  ------------------
  |  Branch (1779:11): [True: 53.0k, False: 22.2k]
  |  Branch (1779:19): [True: 49.0k, False: 4.02k]
  ------------------
 1780|  49.0k|	symWidths[i] = symWidth;
 1781|  49.0k|	totalWidth += symWidth;
 1782|       |
 1783|       |      // refinement/aggregate coding
 1784|  49.0k|      } else if (refAgg) {
  ------------------
  |  Branch (1784:18): [True: 4.88k, False: 21.3k]
  ------------------
 1785|  4.88k|	if (huff) {
  ------------------
  |  Branch (1785:6): [True: 4.02k, False: 855]
  ------------------
 1786|  4.02k|	  if (!huffDecoder->decodeInt(&refAggNum, huffAggInstTable)) {
  ------------------
  |  Branch (1786:8): [True: 192, False: 3.83k]
  ------------------
 1787|    192|	    break;
 1788|    192|	  }
 1789|  4.02k|	} else {
 1790|    855|	  if (!arithDecoder->decodeInt(&refAggNum, iaaiStats)) {
  ------------------
  |  Branch (1790:8): [True: 39, False: 816]
  ------------------
 1791|     39|	    break;
 1792|     39|	  }
 1793|    855|	}
 1794|  4.64k|	if (refAggNum <= 0 || refAggNum > 10000) {
  ------------------
  |  Branch (1794:6): [True: 288, False: 4.36k]
  |  Branch (1794:24): [True: 195, False: 4.16k]
  ------------------
 1795|    483|	  error(errSyntaxError, getPos(),
 1796|    483|		"Invalid refinement/aggregation instance count in JBIG2 symbol dictionary");
 1797|    483|	  goto syntaxError;
 1798|    483|	}
 1799|       |#if 0 //~ This special case was added about a year before the final draft
 1800|       |      //~ of the JBIG2 spec was released.  I have encountered some old
 1801|       |      //~ JBIG2 images that predate it.
 1802|       |	if (0) {
 1803|       |#else
 1804|  4.16k|	if (refAggNum == 1) {
  ------------------
  |  Branch (1804:6): [True: 356, False: 3.81k]
  ------------------
 1805|    356|#endif
 1806|    356|	  if (huff) {
  ------------------
  |  Branch (1806:8): [True: 355, False: 1]
  ------------------
 1807|    355|	    symID = huffDecoder->readBits(symCodeLen);
 1808|    355|	    huffDecoder->decodeInt(&refDX, huffTableO);
 1809|    355|	    huffDecoder->decodeInt(&refDY, huffTableO);
 1810|    355|	    huffDecoder->decodeInt(&bmSize, huffTableA);
 1811|    355|	    huffDecoder->reset();
 1812|    355|	    arithDecoder->start();
 1813|    355|	  } else {
 1814|      1|	    symID = arithDecoder->decodeIAID(symCodeLen, iaidStats);
 1815|      1|	    arithDecoder->decodeInt(&refDX, iardxStats);
 1816|      1|	    arithDecoder->decodeInt(&refDY, iardyStats);
 1817|      1|	  }
 1818|    356|	  if (symID >= numInputSyms + i) {
  ------------------
  |  Branch (1818:8): [True: 356, False: 0]
  ------------------
 1819|    356|	    error(errSyntaxError, getPos(),
 1820|    356|		  "Invalid symbol ID in JBIG2 symbol dictionary");
 1821|    356|	    goto syntaxError;
 1822|    356|	  }
 1823|      0|	  refBitmap = bitmaps[symID];
 1824|      0|	  bitmaps[numInputSyms + i] =
 1825|      0|	      readGenericRefinementRegion(symWidth, symHeight,
 1826|      0|					  sdrTemplate, gFalse,
  ------------------
  |  |   18|      0|#define gFalse 0
  ------------------
 1827|      0|					  refBitmap, refDX, refDY,
 1828|      0|					  sdrATX, sdrATY);
 1829|       |	  //~ do we need to use the bmSize value here (in Huffman mode)?
 1830|  3.81k|	} else {
 1831|  3.81k|	  bitmaps[numInputSyms + i] =
 1832|  3.81k|	      readTextRegion(huff, gTrue, symWidth, symHeight,
  ------------------
  |  |   17|  3.81k|#define gTrue 1
  ------------------
 1833|  3.81k|			     refAggNum, 0, numInputSyms + i, NULL,
 1834|  3.81k|			     symCodeLen, bitmaps, 0, 0, 0, 1, 0,
 1835|  3.81k|			     huffTableF, huffTableH, huffTableK, huffTableO,
 1836|  3.81k|			     huffTableO, huffTableO, huffTableO, huffTableA,
 1837|  3.81k|			     sdrTemplate, sdrATX, sdrATY);
 1838|  3.81k|	}
 1839|       |
 1840|       |      // non-ref/agg coding
 1841|  21.3k|      } else {
 1842|  21.3k|	bitmaps[numInputSyms + i] =
 1843|  21.3k|	    readGenericBitmap(gFalse, symWidth, symHeight,
  ------------------
  |  |   18|  21.3k|#define gFalse 0
  ------------------
 1844|  21.3k|			      sdTemplate, gFalse, gFalse, NULL,
  ------------------
  |  |   18|  21.3k|#define gFalse 0
  ------------------
              			      sdTemplate, gFalse, gFalse, NULL,
  ------------------
  |  |   18|  21.3k|#define gFalse 0
  ------------------
 1845|  21.3k|			      sdATX, sdATY, 0);
 1846|  21.3k|      }
 1847|       |
 1848|  74.2k|      ++i;
 1849|  74.2k|    }
 1850|       |
 1851|       |    // read the collective bitmap
 1852|  4.07k|    if (huff && !refAgg) {
  ------------------
  |  Branch (1852:9): [True: 2.59k, False: 1.47k]
  |  Branch (1852:17): [True: 2.17k, False: 423]
  ------------------
 1853|  2.17k|      if (totalWidth == 0) {
  ------------------
  |  Branch (1853:11): [True: 652, False: 1.52k]
  ------------------
 1854|    652|	error(errSyntaxError, getPos(),
 1855|    652|	      "Invalid height class width in JBIG2 symbol dictionary");
 1856|    652|	goto syntaxError;
 1857|    652|      }
 1858|  1.52k|      huffDecoder->decodeInt(&bmSize, huffBMSizeTable);
 1859|  1.52k|      huffDecoder->reset();
 1860|  1.52k|      if (bmSize == 0) {
  ------------------
  |  Branch (1860:11): [True: 3, False: 1.52k]
  ------------------
 1861|      3|	collBitmap = new JBIG2Bitmap(0, totalWidth, symHeight);
 1862|      3|	bmSize = symHeight * ((totalWidth + 7) >> 3);
 1863|      3|	byteCounter += curStr->getBlock((char *)collBitmap->getDataPtr(),
 1864|      3|					bmSize);
 1865|  1.52k|      } else {
 1866|  1.52k|	collBitmap = readGenericBitmap(gTrue, totalWidth, symHeight,
  ------------------
  |  |   17|  1.52k|#define gTrue 1
  ------------------
 1867|  1.52k|				       0, gFalse, gFalse, NULL, NULL, NULL,
  ------------------
  |  |   18|  1.52k|#define gFalse 0
  ------------------
              				       0, gFalse, gFalse, NULL, NULL, NULL,
  ------------------
  |  |   18|  1.52k|#define gFalse 0
  ------------------
 1868|  1.52k|				       bmSize);
 1869|  1.52k|      }
 1870|  1.52k|      x = 0;
 1871|  50.5k|      for (; j < i; ++j) {
  ------------------
  |  Branch (1871:14): [True: 48.9k, False: 1.52k]
  ------------------
 1872|  48.9k|	bitmaps[numInputSyms + j] =
 1873|  48.9k|	    collBitmap->getSlice(x, 0, symWidths[j], symHeight);
 1874|  48.9k|	x += symWidths[j];
 1875|  48.9k|      }
 1876|  1.52k|      delete collBitmap;
 1877|  1.52k|    }
 1878|  4.07k|  }
 1879|       |
 1880|       |  // create the symbol dict object
 1881|  4.29k|  symbolDict = new JBIG2SymbolDict(segNum, numExSyms);
 1882|       |
 1883|       |  // exported symbol list
 1884|  4.29k|  i = j = 0;
 1885|  4.29k|  ex = gFalse;
  ------------------
  |  |   18|  4.29k|#define gFalse 0
  ------------------
 1886|  4.29k|  prevRun = 1;
 1887|  6.58k|  while (i < numInputSyms + numNewSyms) {
  ------------------
  |  Branch (1887:10): [True: 2.84k, False: 3.74k]
  ------------------
 1888|  2.84k|    if (huff) {
  ------------------
  |  Branch (1888:9): [True: 166, False: 2.67k]
  ------------------
 1889|    166|      huffDecoder->decodeInt(&run, huffTableA);
 1890|  2.67k|    } else {
 1891|  2.67k|      arithDecoder->decodeInt(&run, iaexStats);
 1892|  2.67k|    }
 1893|  2.84k|    if (run == 0 && prevRun == 0) {
  ------------------
  |  Branch (1893:9): [True: 432, False: 2.41k]
  |  Branch (1893:21): [True: 158, False: 274]
  ------------------
 1894|       |      // this avoids infinite loops with damaged files (consecutive
 1895|       |      // zero runs are never useful)
 1896|    158|      error(errSyntaxError, getPos(),
 1897|    158|	    "Invalid exported symbol list in JBIG2 symbol dictionary");
 1898|    158|      delete symbolDict;
 1899|    158|      goto syntaxError;
 1900|    158|    }
 1901|  2.68k|    if (i + run > numInputSyms + numNewSyms ||
  ------------------
  |  Branch (1901:9): [True: 356, False: 2.33k]
  ------------------
 1902|  2.33k|	(ex && j + run > numExSyms)) {
  ------------------
  |  Branch (1902:3): [True: 940, False: 1.39k]
  |  Branch (1902:9): [True: 37, False: 903]
  ------------------
 1903|    393|      error(errSyntaxError, getPos(),
 1904|    393|	    "Too many exported symbols in JBIG2 symbol dictionary");
 1905|    393|      delete symbolDict;
 1906|    393|      goto syntaxError;
 1907|    393|    }
 1908|  2.29k|    if (ex) {
  ------------------
  |  Branch (1908:9): [True: 903, False: 1.39k]
  ------------------
 1909|  2.42k|      for (cnt = 0; cnt < run; ++cnt) {
  ------------------
  |  Branch (1909:21): [True: 1.52k, False: 903]
  ------------------
 1910|  1.52k|	symbolDict->setBitmap(j++, bitmaps[i++]->copy());
 1911|  1.52k|      }
 1912|  1.39k|    } else {
 1913|  1.39k|      i += run;
 1914|  1.39k|    }
 1915|  2.29k|    ex = !ex;
 1916|  2.29k|    prevRun = run;
 1917|  2.29k|  }
 1918|  3.74k|  if (j != numExSyms) {
  ------------------
  |  Branch (1918:7): [True: 447, False: 3.29k]
  ------------------
 1919|    447|    error(errSyntaxError, getPos(), "Too few symbols in JBIG2 symbol dictionary");
 1920|    447|    delete symbolDict;
 1921|    447|    goto syntaxError;
 1922|    447|  }
 1923|       |
 1924|  4.40k|  for (i = 0; i < numNewSyms; ++i) {
  ------------------
  |  Branch (1924:15): [True: 1.10k, False: 3.29k]
  ------------------
 1925|  1.10k|    delete bitmaps[numInputSyms + i];
 1926|  1.10k|  }
 1927|  3.29k|  gfree(bitmaps);
 1928|  3.29k|  if (symWidths) {
  ------------------
  |  Branch (1928:7): [True: 0, False: 3.29k]
  ------------------
 1929|      0|    gfree(symWidths);
 1930|      0|  }
 1931|       |
 1932|       |  // save the arithmetic decoder stats
 1933|  3.29k|  if (!huff && contextRetained) {
  ------------------
  |  Branch (1933:7): [True: 3.02k, False: 274]
  |  Branch (1933:16): [True: 1.83k, False: 1.18k]
  ------------------
 1934|  1.83k|    symbolDict->setGenericRegionStats(genericRegionStats->copy());
 1935|  1.83k|    if (refAgg) {
  ------------------
  |  Branch (1935:9): [True: 1.35k, False: 476]
  ------------------
 1936|  1.35k|      symbolDict->setRefinementRegionStats(refinementRegionStats->copy());
 1937|  1.35k|    }
 1938|  1.83k|  }
 1939|       |
 1940|       |  // store the new symbol dict
 1941|  3.29k|  segments->append(symbolDict);
 1942|       |
 1943|  3.29k|  return gTrue;
  ------------------
  |  |   17|  3.29k|#define gTrue 1
  ------------------
 1944|       |
 1945|  1.55k| codeTableError:
 1946|  1.55k|  error(errSyntaxError, getPos(), "Missing code table in JBIG2 symbol dictionary");
 1947|  1.55k|  delete codeTables;
 1948|       |
 1949|  6.15k| syntaxError:
 1950|   461M|  for (i = 0; i < numNewSyms; ++i) {
  ------------------
  |  Branch (1950:15): [True: 461M, False: 6.15k]
  ------------------
 1951|   461M|    if (bitmaps[numInputSyms + i]) {
  ------------------
  |  Branch (1951:9): [True: 73.0k, False: 461M]
  ------------------
 1952|  73.0k|      delete bitmaps[numInputSyms + i];
 1953|  73.0k|    }
 1954|   461M|  }
 1955|  6.15k|  gfree(bitmaps);
 1956|  6.15k|  if (symWidths) {
  ------------------
  |  Branch (1956:7): [True: 1.17k, False: 4.98k]
  ------------------
 1957|  1.17k|    gfree(symWidths);
 1958|  1.17k|  }
 1959|  6.15k|  return gFalse;
  ------------------
  |  |   18|  6.15k|#define gFalse 0
  ------------------
 1960|       |
 1961|  7.68k| eofError:
 1962|  7.68k|  error(errSyntaxError, getPos(), "Unexpected EOF in JBIG2 stream");
 1963|  7.68k|  return gFalse;
  ------------------
  |  |   18|  7.68k|#define gFalse 0
  ------------------
 1964|  1.55k|}
_ZN11JBIG2Stream17readTextRegionSegEjiijPjj:
 1968|  20.9k|				    Guint *refSegs, Guint nRefSegs) {
 1969|  20.9k|  JBIG2Bitmap *bitmap;
 1970|  20.9k|  JBIG2HuffmanTable runLengthTab[36];
 1971|  20.9k|  JBIG2HuffmanTable *symCodeTab;
 1972|  20.9k|  JBIG2HuffmanTable *huffFSTable, *huffDSTable, *huffDTTable;
 1973|  20.9k|  JBIG2HuffmanTable *huffRDWTable, *huffRDHTable;
 1974|  20.9k|  JBIG2HuffmanTable *huffRDXTable, *huffRDYTable, *huffRSizeTable;
 1975|  20.9k|  JBIG2Segment *seg;
 1976|  20.9k|  GList *codeTables;
 1977|  20.9k|  JBIG2SymbolDict *symbolDict;
 1978|  20.9k|  JBIG2Bitmap **syms;
 1979|  20.9k|  Guint w, h, x, y, segInfoFlags, extCombOp;
 1980|  20.9k|  Guint flags, huff, refine, logStrips, refCorner, transposed;
 1981|  20.9k|  Guint combOp, defPixel, templ;
 1982|  20.9k|  int sOffset;
 1983|  20.9k|  Guint huffFlags, huffFS, huffDS, huffDT;
 1984|  20.9k|  Guint huffRDW, huffRDH, huffRDX, huffRDY, huffRSize;
 1985|  20.9k|  Guint numInstances, numSyms, symCodeLen;
 1986|  20.9k|  int atx[2], aty[2];
 1987|  20.9k|  Guint i, k, kk;
 1988|  20.9k|  int j;
 1989|       |
 1990|       |  // region segment info field
 1991|  20.9k|  if (!readULong(&w) || !readULong(&h) ||
  ------------------
  |  Branch (1991:7): [True: 10.3k, False: 10.6k]
  |  Branch (1991:25): [True: 735, False: 9.92k]
  ------------------
 1992|  9.92k|      !readULong(&x) || !readULong(&y) ||
  ------------------
  |  Branch (1992:7): [True: 862, False: 9.05k]
  |  Branch (1992:25): [True: 901, False: 8.15k]
  ------------------
 1993|  12.9k|      !readUByte(&segInfoFlags)) {
  ------------------
  |  Branch (1993:7): [True: 131, False: 8.02k]
  ------------------
 1994|  12.9k|    goto eofError;
 1995|  12.9k|  }
 1996|  8.02k|  if (w == 0 || h == 0) {
  ------------------
  |  Branch (1996:7): [True: 4, False: 8.02k]
  |  Branch (1996:17): [True: 279, False: 7.74k]
  ------------------
 1997|    283|    error(errSyntaxError, getPos(), "Bad size in JBIG2 text region segment");
 1998|    283|    return;
 1999|    283|  }
 2000|       |  // sanity check: if the w/h/x/y values are way out of range, it likely
 2001|       |  // indicates a damaged JBIG2 stream
 2002|  7.74k|  if (w / 10 > pageW || h / 10 > pageH ||
  ------------------
  |  Branch (2002:7): [True: 222, False: 7.52k]
  |  Branch (2002:25): [True: 170, False: 7.35k]
  ------------------
 2003|  7.35k|      x / 10 > pageW || y / 10 > pageH) {
  ------------------
  |  Branch (2003:7): [True: 207, False: 7.14k]
  |  Branch (2003:25): [True: 255, False: 6.89k]
  ------------------
 2004|    854|    error(errSyntaxError, getPos(),
 2005|    854|	  "Bad size or position in JBIG2 text region segment");
 2006|    854|    done = gTrue;
  ------------------
  |  |   17|    854|#define gTrue 1
  ------------------
 2007|    854|    return;
 2008|    854|  }
 2009|  6.89k|  extCombOp = segInfoFlags & 7;
 2010|       |
 2011|       |  // rest of the text region header
 2012|  6.89k|  if (!readUWord(&flags)) {
  ------------------
  |  Branch (2012:7): [True: 228, False: 6.66k]
  ------------------
 2013|    228|    goto eofError;
 2014|    228|  }
 2015|  6.66k|  huff = flags & 1;
 2016|  6.66k|  refine = (flags >> 1) & 1;
 2017|  6.66k|  logStrips = (flags >> 2) & 3;
 2018|  6.66k|  refCorner = (flags >> 4) & 3;
 2019|  6.66k|  transposed = (flags >> 6) & 1;
 2020|  6.66k|  combOp = (flags >> 7) & 3;
 2021|  6.66k|  defPixel = (flags >> 9) & 1;
 2022|  6.66k|  sOffset = (flags >> 10) & 0x1f;
 2023|  6.66k|  if (sOffset & 0x10) {
  ------------------
  |  Branch (2023:7): [True: 4.32k, False: 2.33k]
  ------------------
 2024|  4.32k|    sOffset |= -1 - 0x0f;
 2025|  4.32k|  }
 2026|  6.66k|  templ = (flags >> 15) & 1;
 2027|  6.66k|  huffFS = huffDS = huffDT = 0; // make gcc happy
 2028|  6.66k|  huffRDW = huffRDH = huffRDX = huffRDY = huffRSize = 0; // make gcc happy
 2029|  6.66k|  if (huff) {
  ------------------
  |  Branch (2029:7): [True: 5.22k, False: 1.43k]
  ------------------
 2030|  5.22k|    if (!readUWord(&huffFlags)) {
  ------------------
  |  Branch (2030:9): [True: 148, False: 5.08k]
  ------------------
 2031|    148|      goto eofError;
 2032|    148|    }
 2033|  5.08k|    huffFS = huffFlags & 3;
 2034|  5.08k|    huffDS = (huffFlags >> 2) & 3;
 2035|  5.08k|    huffDT = (huffFlags >> 4) & 3;
 2036|  5.08k|    huffRDW = (huffFlags >> 6) & 3;
 2037|  5.08k|    huffRDH = (huffFlags >> 8) & 3;
 2038|  5.08k|    huffRDX = (huffFlags >> 10) & 3;
 2039|  5.08k|    huffRDY = (huffFlags >> 12) & 3;
 2040|  5.08k|    huffRSize = (huffFlags >> 14) & 1;
 2041|  5.08k|  }
 2042|  6.51k|  if (refine && templ == 0) {
  ------------------
  |  Branch (2042:7): [True: 2.44k, False: 4.07k]
  |  Branch (2042:17): [True: 2.16k, False: 280]
  ------------------
 2043|  2.16k|    if (!readByte(&atx[0]) || !readByte(&aty[0]) ||
  ------------------
  |  Branch (2043:9): [True: 131, False: 2.03k]
  |  Branch (2043:31): [True: 308, False: 1.72k]
  ------------------
 2044|  1.72k|	!readByte(&atx[1]) || !readByte(&aty[1])) {
  ------------------
  |  Branch (2044:2): [True: 128, False: 1.59k]
  |  Branch (2044:24): [True: 259, False: 1.33k]
  ------------------
 2045|    826|      goto eofError;
 2046|    826|    }
 2047|  2.16k|  }
 2048|  5.68k|  if (!readULong(&numInstances)) {
  ------------------
  |  Branch (2048:7): [True: 141, False: 5.54k]
  ------------------
 2049|    141|    goto eofError;
 2050|    141|  }
 2051|       |
 2052|       |  // get symbol dictionaries and tables
 2053|  5.54k|  codeTables = new GList();
 2054|  5.54k|  numSyms = 0;
 2055|  15.0k|  for (i = 0; i < nRefSegs; ++i) {
  ------------------
  |  Branch (2055:15): [True: 10.4k, False: 4.67k]
  ------------------
 2056|  10.4k|    if ((seg = findSegment(refSegs[i]))) {
  ------------------
  |  Branch (2056:9): [True: 9.54k, False: 872]
  ------------------
 2057|  9.54k|      if (seg->getType() == jbig2SegSymbolDict) {
  ------------------
  |  Branch (2057:11): [True: 1.96k, False: 7.58k]
  ------------------
 2058|  1.96k|	Guint segSize = ((JBIG2SymbolDict *)seg)->getSize();
 2059|  1.96k|	if (segSize > INT_MAX || numSyms > INT_MAX - segSize) {
  ------------------
  |  Branch (2059:6): [True: 0, False: 1.96k]
  |  Branch (2059:27): [True: 0, False: 1.96k]
  ------------------
 2060|      0|	  error(errSyntaxError, getPos(),
 2061|      0|		"Too many symbols in JBIG2 text region");
 2062|      0|	  delete codeTables;
 2063|      0|	  return;
 2064|      0|	}
 2065|  1.96k|	numSyms += segSize;
 2066|  7.58k|      } else if (seg->getType() == jbig2SegCodeTable) {
  ------------------
  |  Branch (2066:18): [True: 7.35k, False: 227]
  ------------------
 2067|  7.35k|	codeTables->append(seg);
 2068|  7.35k|      }
 2069|  9.54k|    } else {
 2070|    872|      error(errSyntaxError, getPos(),
 2071|    872|	    "Invalid segment reference in JBIG2 text region");
 2072|    872|      delete codeTables;
 2073|    872|      return;
 2074|    872|    }
 2075|  10.4k|  }
 2076|  4.67k|  i = numSyms;
 2077|  4.67k|  if (i <= 1) {
  ------------------
  |  Branch (2077:7): [True: 4.67k, False: 0]
  ------------------
 2078|  4.67k|    symCodeLen = huff ? 1 : 0;
  ------------------
  |  Branch (2078:18): [True: 4.12k, False: 548]
  ------------------
 2079|  4.67k|  } else {
 2080|      0|    --i;
 2081|      0|    symCodeLen = 0;
 2082|       |    // i = floor((numSyms-1) / 2^symCodeLen)
 2083|      0|    while (i > 0) {
  ------------------
  |  Branch (2083:12): [True: 0, False: 0]
  ------------------
 2084|      0|      ++symCodeLen;
 2085|      0|      i >>= 1;
 2086|      0|    }
 2087|      0|  }
 2088|       |
 2089|       |  // get the symbol bitmaps
 2090|  4.67k|  syms = (JBIG2Bitmap **)gmallocn(numSyms, sizeof(JBIG2Bitmap *));
 2091|  4.67k|  kk = 0;
 2092|  13.8k|  for (i = 0; i < nRefSegs; ++i) {
  ------------------
  |  Branch (2092:15): [True: 9.20k, False: 4.67k]
  ------------------
 2093|  9.20k|    if ((seg = findSegment(refSegs[i]))) {
  ------------------
  |  Branch (2093:9): [True: 9.20k, False: 0]
  ------------------
 2094|  9.20k|      if (seg->getType() == jbig2SegSymbolDict) {
  ------------------
  |  Branch (2094:11): [True: 1.96k, False: 7.24k]
  ------------------
 2095|  1.96k|	symbolDict = (JBIG2SymbolDict *)seg;
 2096|  1.96k|	for (k = 0; k < symbolDict->getSize(); ++k) {
  ------------------
  |  Branch (2096:14): [True: 0, False: 1.96k]
  ------------------
 2097|      0|	  syms[kk++] = symbolDict->getBitmap(k);
 2098|      0|	}
 2099|  1.96k|      }
 2100|  9.20k|    }
 2101|  9.20k|  }
 2102|       |
 2103|       |  // get the Huffman tables
 2104|  4.67k|  huffFSTable = huffDSTable = huffDTTable = NULL; // make gcc happy
 2105|  4.67k|  huffRDWTable = huffRDHTable = NULL; // make gcc happy
 2106|  4.67k|  huffRDXTable = huffRDYTable = huffRSizeTable = NULL; // make gcc happy
 2107|  4.67k|  i = 0;
 2108|  4.67k|  if (huff) {
  ------------------
  |  Branch (2108:7): [True: 4.12k, False: 548]
  ------------------
 2109|  4.12k|    if (huffFS == 0) {
  ------------------
  |  Branch (2109:9): [True: 2.13k, False: 1.99k]
  ------------------
 2110|  2.13k|      huffFSTable = huffTableF;
 2111|  2.13k|    } else if (huffFS == 1) {
  ------------------
  |  Branch (2111:16): [True: 1.15k, False: 846]
  ------------------
 2112|  1.15k|      huffFSTable = huffTableG;
 2113|  1.15k|    } else {
 2114|    846|      if (i >= (Guint)codeTables->getLength()) {
  ------------------
  |  Branch (2114:11): [True: 136, False: 710]
  ------------------
 2115|    136|	goto codeTableError;
 2116|    136|      }
 2117|    710|      huffFSTable = ((JBIG2CodeTable *)codeTables->get(i++))->getHuffTable();
 2118|    710|    }
 2119|  3.99k|    if (huffDS == 0) {
  ------------------
  |  Branch (2119:9): [True: 1.22k, False: 2.76k]
  ------------------
 2120|  1.22k|      huffDSTable = huffTableH;
 2121|  2.76k|    } else if (huffDS == 1) {
  ------------------
  |  Branch (2121:16): [True: 1.47k, False: 1.29k]
  ------------------
 2122|  1.47k|      huffDSTable = huffTableI;
 2123|  1.47k|    } else if (huffDS == 2) {
  ------------------
  |  Branch (2123:16): [True: 460, False: 834]
  ------------------
 2124|    460|      huffDSTable = huffTableJ;
 2125|    834|    } else {
 2126|    834|      if (i >= (Guint)codeTables->getLength()) {
  ------------------
  |  Branch (2126:11): [True: 238, False: 596]
  ------------------
 2127|    238|	goto codeTableError;
 2128|    238|      }
 2129|    596|      huffDSTable = ((JBIG2CodeTable *)codeTables->get(i++))->getHuffTable();
 2130|    596|    }
 2131|  3.75k|    if (huffDT == 0) {
  ------------------
  |  Branch (2131:9): [True: 583, False: 3.17k]
  ------------------
 2132|    583|      huffDTTable = huffTableK;
 2133|  3.17k|    } else if (huffDT == 1) {
  ------------------
  |  Branch (2133:16): [True: 529, False: 2.64k]
  ------------------
 2134|    529|      huffDTTable = huffTableL;
 2135|  2.64k|    } else if (huffDT == 2) {
  ------------------
  |  Branch (2135:16): [True: 1.19k, False: 1.44k]
  ------------------
 2136|  1.19k|      huffDTTable = huffTableM;
 2137|  1.44k|    } else {
 2138|  1.44k|      if (i >= (Guint)codeTables->getLength()) {
  ------------------
  |  Branch (2138:11): [True: 895, False: 547]
  ------------------
 2139|    895|	goto codeTableError;
 2140|    895|      }
 2141|    547|      huffDTTable = ((JBIG2CodeTable *)codeTables->get(i++))->getHuffTable();
 2142|    547|    }
 2143|  2.85k|    if (huffRDW == 0) {
  ------------------
  |  Branch (2143:9): [True: 702, False: 2.15k]
  ------------------
 2144|    702|      huffRDWTable = huffTableN;
 2145|  2.15k|    } else if (huffRDW == 1) {
  ------------------
  |  Branch (2145:16): [True: 1.27k, False: 879]
  ------------------
 2146|  1.27k|      huffRDWTable = huffTableO;
 2147|  1.27k|    } else {
 2148|    879|      if (i >= (Guint)codeTables->getLength()) {
  ------------------
  |  Branch (2148:11): [True: 203, False: 676]
  ------------------
 2149|    203|	goto codeTableError;
 2150|    203|      }
 2151|    676|      huffRDWTable = ((JBIG2CodeTable *)codeTables->get(i++))->getHuffTable();
 2152|    676|    }
 2153|  2.65k|    if (huffRDH == 0) {
  ------------------
  |  Branch (2153:9): [True: 700, False: 1.95k]
  ------------------
 2154|    700|      huffRDHTable = huffTableN;
 2155|  1.95k|    } else if (huffRDH == 1) {
  ------------------
  |  Branch (2155:16): [True: 1.21k, False: 739]
  ------------------
 2156|  1.21k|      huffRDHTable = huffTableO;
 2157|  1.21k|    } else {
 2158|    739|      if (i >= (Guint)codeTables->getLength()) {
  ------------------
  |  Branch (2158:11): [True: 325, False: 414]
  ------------------
 2159|    325|	goto codeTableError;
 2160|    325|      }
 2161|    414|      huffRDHTable = ((JBIG2CodeTable *)codeTables->get(i++))->getHuffTable();
 2162|    414|    }
 2163|  2.33k|    if (huffRDX == 0) {
  ------------------
  |  Branch (2163:9): [True: 495, False: 1.83k]
  ------------------
 2164|    495|      huffRDXTable = huffTableN;
 2165|  1.83k|    } else if (huffRDX == 1) {
  ------------------
  |  Branch (2165:16): [True: 868, False: 967]
  ------------------
 2166|    868|      huffRDXTable = huffTableO;
 2167|    967|    } else {
 2168|    967|      if (i >= (Guint)codeTables->getLength()) {
  ------------------
  |  Branch (2168:11): [True: 383, False: 584]
  ------------------
 2169|    383|	goto codeTableError;
 2170|    383|      }
 2171|    584|      huffRDXTable = ((JBIG2CodeTable *)codeTables->get(i++))->getHuffTable();
 2172|    584|    }
 2173|  1.94k|    if (huffRDY == 0) {
  ------------------
  |  Branch (2173:9): [True: 583, False: 1.36k]
  ------------------
 2174|    583|      huffRDYTable = huffTableN;
 2175|  1.36k|    } else if (huffRDY == 1) {
  ------------------
  |  Branch (2175:16): [True: 451, False: 913]
  ------------------
 2176|    451|      huffRDYTable = huffTableO;
 2177|    913|    } else {
 2178|    913|      if (i >= (Guint)codeTables->getLength()) {
  ------------------
  |  Branch (2178:11): [True: 422, False: 491]
  ------------------
 2179|    422|	goto codeTableError;
 2180|    422|      }
 2181|    491|      huffRDYTable = ((JBIG2CodeTable *)codeTables->get(i++))->getHuffTable();
 2182|    491|    }
 2183|  1.52k|    if (huffRSize == 0) {
  ------------------
  |  Branch (2183:9): [True: 644, False: 881]
  ------------------
 2184|    644|      huffRSizeTable = huffTableA;
 2185|    881|    } else {
 2186|    881|      if (i >= (Guint)codeTables->getLength()) {
  ------------------
  |  Branch (2186:11): [True: 572, False: 309]
  ------------------
 2187|    572|	goto codeTableError;
 2188|    572|      }
 2189|    309|      huffRSizeTable =
 2190|    309|	  ((JBIG2CodeTable *)codeTables->get(i++))->getHuffTable();
 2191|    309|    }
 2192|  1.52k|  }
 2193|  1.50k|  delete codeTables;
 2194|       |
 2195|       |  // symbol ID Huffman decoding table
 2196|  1.50k|  if (huff) {
  ------------------
  |  Branch (2196:7): [True: 953, False: 548]
  ------------------
 2197|    953|    huffDecoder->reset();
 2198|  31.4k|    for (i = 0; i < 32; ++i) {
  ------------------
  |  Branch (2198:17): [True: 30.4k, False: 953]
  ------------------
 2199|  30.4k|      runLengthTab[i].val = i;
 2200|  30.4k|      runLengthTab[i].prefixLen = huffDecoder->readBits(4);
 2201|  30.4k|      runLengthTab[i].rangeLen = 0;
 2202|  30.4k|      runLengthTab[i].prefix = 0;
 2203|  30.4k|    }
 2204|    953|    runLengthTab[32].val = 0x103;
 2205|    953|    runLengthTab[32].prefixLen = huffDecoder->readBits(4);
 2206|    953|    runLengthTab[32].rangeLen = 2;
 2207|    953|    runLengthTab[32].prefix = 0;
 2208|    953|    runLengthTab[33].val = 0x203;
 2209|    953|    runLengthTab[33].prefixLen = huffDecoder->readBits(4);
 2210|    953|    runLengthTab[33].rangeLen = 3;
 2211|    953|    runLengthTab[33].prefix = 0;
 2212|    953|    runLengthTab[34].val = 0x20b;
 2213|    953|    runLengthTab[34].prefixLen = huffDecoder->readBits(4);
 2214|    953|    runLengthTab[34].rangeLen = 7;
 2215|    953|    runLengthTab[34].prefix = 0;
 2216|    953|    runLengthTab[35].prefixLen = 0;
 2217|    953|    runLengthTab[35].rangeLen = jbig2HuffmanEOT;
  ------------------
  |  |   33|    953|#define jbig2HuffmanEOT 0xffffffff
  ------------------
 2218|    953|    runLengthTab[35].prefix = 0;
 2219|    953|    huffDecoder->buildTable(runLengthTab, 35);
 2220|    953|    symCodeTab = (JBIG2HuffmanTable *)gmallocn(numSyms + 1,
 2221|    953|					       sizeof(JBIG2HuffmanTable));
 2222|    953|    for (i = 0; i < numSyms; ++i) {
  ------------------
  |  Branch (2222:17): [True: 0, False: 953]
  ------------------
 2223|      0|      symCodeTab[i].val = i;
 2224|      0|      symCodeTab[i].rangeLen = 0;
 2225|      0|    }
 2226|    953|    i = 0;
 2227|    953|    while (i < numSyms) {
  ------------------
  |  Branch (2227:12): [True: 0, False: 953]
  ------------------
 2228|      0|      huffDecoder->decodeInt(&j, runLengthTab);
 2229|      0|      if (j > 0x200) {
  ------------------
  |  Branch (2229:11): [True: 0, False: 0]
  ------------------
 2230|      0|	for (j -= 0x200; j && i < numSyms; --j) {
  ------------------
  |  Branch (2230:19): [True: 0, False: 0]
  |  Branch (2230:24): [True: 0, False: 0]
  ------------------
 2231|      0|	  symCodeTab[i++].prefixLen = 0;
 2232|      0|	}
 2233|      0|      } else if (j > 0x100) {
  ------------------
  |  Branch (2233:18): [True: 0, False: 0]
  ------------------
 2234|      0|	if (i == 0) {
  ------------------
  |  Branch (2234:6): [True: 0, False: 0]
  ------------------
 2235|      0|	  error(errSyntaxError, getPos(), "Invalid code in JBIG2 text region");
 2236|      0|	  gfree(syms);
 2237|      0|	  gfree(symCodeTab);
 2238|      0|	  return;
 2239|      0|	}
 2240|      0|	for (j -= 0x100; j && i < numSyms; --j) {
  ------------------
  |  Branch (2240:19): [True: 0, False: 0]
  |  Branch (2240:24): [True: 0, False: 0]
  ------------------
 2241|      0|	  symCodeTab[i].prefixLen = symCodeTab[i-1].prefixLen;
 2242|      0|	  ++i;
 2243|      0|	}
 2244|      0|      } else {
 2245|      0|	symCodeTab[i++].prefixLen = j;
 2246|      0|      }
 2247|      0|    }
 2248|    953|    symCodeTab[numSyms].prefixLen = 0;
 2249|    953|    symCodeTab[numSyms].rangeLen = jbig2HuffmanEOT;
  ------------------
  |  |   33|    953|#define jbig2HuffmanEOT 0xffffffff
  ------------------
 2250|    953|    huffDecoder->buildTable(symCodeTab, numSyms);
 2251|    953|    huffDecoder->reset();
 2252|       |
 2253|       |  // set up the arithmetic decoder
 2254|    953|  } else {
 2255|    548|    symCodeTab = NULL;
 2256|    548|    resetIntStats(symCodeLen);
 2257|    548|    arithDecoder->start();
 2258|    548|  }
 2259|  1.50k|  if (refine) {
  ------------------
  |  Branch (2259:7): [True: 751, False: 750]
  ------------------
 2260|    751|    resetRefinementStats(templ, NULL);
 2261|    751|  }
 2262|       |
 2263|  1.50k|  bitmap = readTextRegion(huff, refine, w, h, numInstances,
 2264|  1.50k|			  logStrips, numSyms, symCodeTab, symCodeLen, syms,
 2265|  1.50k|			  defPixel, combOp, transposed, refCorner, sOffset,
 2266|  1.50k|			  huffFSTable, huffDSTable, huffDTTable,
 2267|  1.50k|			  huffRDWTable, huffRDHTable,
 2268|  1.50k|			  huffRDXTable, huffRDYTable, huffRSizeTable,
 2269|  1.50k|			  templ, atx, aty);
 2270|       |
 2271|  1.50k|  gfree(syms);
 2272|       |
 2273|       |  // combine the region bitmap into the page bitmap
 2274|  1.50k|  if (imm) {
  ------------------
  |  Branch (2274:7): [True: 1.07k, False: 423]
  ------------------
 2275|  1.07k|    if (pageH == 0xffffffff && y + h > curPageH) {
  ------------------
  |  Branch (2275:9): [True: 114, False: 964]
  |  Branch (2275:32): [True: 55, False: 59]
  ------------------
 2276|     55|      pageBitmap->expand(y + h, pageDefPixel);
 2277|     55|    }
 2278|  1.07k|    pageBitmap->combine(bitmap, x, y, extCombOp);
 2279|  1.07k|    delete bitmap;
 2280|       |
 2281|       |  // store the region bitmap
 2282|  1.07k|  } else {
 2283|    423|    bitmap->setSegNum(segNum);
 2284|    423|    segments->append(bitmap);
 2285|    423|  }
 2286|       |
 2287|       |  // clean up the Huffman decoder
 2288|  1.50k|  if (huff) {
  ------------------
  |  Branch (2288:7): [True: 950, False: 551]
  ------------------
 2289|    950|    gfree(symCodeTab);
 2290|    950|  }
 2291|       |
 2292|  1.50k|  return;
 2293|       |
 2294|  3.17k| codeTableError:
 2295|  3.17k|  error(errSyntaxError, getPos(), "Missing code table in JBIG2 text region");
 2296|  3.17k|  delete codeTables;
 2297|  3.17k|  gfree(syms);
 2298|  3.17k|  return;
 2299|       |
 2300|  14.2k| eofError:
 2301|  14.2k|  error(errSyntaxError, getPos(), "Unexpected EOF in JBIG2 stream");
 2302|  14.2k|  return;
 2303|  1.50k|}
_ZN11JBIG2Stream14readTextRegionEiiiijjiP17JBIG2HuffmanTablejPP11JBIG2BitmapjjjjiS1_S1_S1_S1_S1_S1_S1_S1_jPiS5_:
 2325|  5.31k|					 int *atx, int *aty) {
 2326|  5.31k|  JBIG2Bitmap *bitmap;
 2327|  5.31k|  JBIG2Bitmap *symbolBitmap;
 2328|  5.31k|  Guint strips;
 2329|  5.31k|  int t, dt, tt, s, ds, sFirst, j;
 2330|  5.31k|  int rdw, rdh, rdx, rdy, ri, refDX, refDY, bmSize;
 2331|  5.31k|  Guint symID, inst, bw, bh;
 2332|       |
 2333|  5.31k|  strips = 1 << logStrips;
 2334|       |
 2335|       |  // allocate the bitmap
 2336|  5.31k|  bitmap = new JBIG2Bitmap(0, w, h);
 2337|  5.31k|  if (defPixel) {
  ------------------
  |  Branch (2337:7): [True: 720, False: 4.59k]
  ------------------
 2338|    720|    bitmap->clearToOne();
 2339|  4.59k|  } else {
 2340|  4.59k|    bitmap->clearToZero();
 2341|  4.59k|  }
 2342|       |
 2343|       |  // decode initial T value
 2344|  5.31k|  if (huff) {
  ------------------
  |  Branch (2344:7): [True: 4.14k, False: 1.16k]
  ------------------
 2345|  4.14k|    huffDecoder->decodeInt(&t, huffDTTable);
 2346|  4.14k|  } else {
 2347|  1.16k|    arithDecoder->decodeInt(&t, iadtStats);
 2348|  1.16k|  }
 2349|  5.31k|  t *= -(int)strips;
 2350|       |
 2351|  5.31k|  inst = 0;
 2352|  5.31k|  sFirst = 0;
 2353|  34.7k|  while (inst < numInstances) {
  ------------------
  |  Branch (2353:10): [True: 30.2k, False: 4.55k]
  ------------------
 2354|       |
 2355|       |    // decode delta-T
 2356|  30.2k|    if (huff) {
  ------------------
  |  Branch (2356:9): [True: 27.8k, False: 2.42k]
  ------------------
 2357|  27.8k|      if (!huffDecoder->decodeInt(&dt, huffDTTable)) {
  ------------------
  |  Branch (2357:11): [True: 318, False: 27.5k]
  ------------------
 2358|    318|	break;
 2359|    318|      }
 2360|  27.8k|    } else {
 2361|  2.42k|      if (!arithDecoder->decodeInt(&dt, iadtStats)) {
  ------------------
  |  Branch (2361:11): [True: 2, False: 2.41k]
  ------------------
 2362|      2|	break;
 2363|      2|      }
 2364|  2.42k|    }
 2365|  29.9k|    t += dt * strips;
 2366|       |
 2367|       |    // first S value
 2368|  29.9k|    if (huff) {
  ------------------
  |  Branch (2368:9): [True: 27.5k, False: 2.41k]
  ------------------
 2369|  27.5k|      if (!huffDecoder->decodeInt(&ds, huffFSTable)) {
  ------------------
  |  Branch (2369:11): [True: 299, False: 27.2k]
  ------------------
 2370|    299|	break;
 2371|    299|      }
 2372|  27.5k|    } else {
 2373|  2.41k|      if (!arithDecoder->decodeInt(&ds, iafsStats)) {
  ------------------
  |  Branch (2373:11): [True: 138, False: 2.28k]
  ------------------
 2374|    138|	break;
 2375|    138|      }
 2376|  2.41k|    }
 2377|  29.4k|    sFirst += ds;
 2378|  29.4k|    s = sFirst;
 2379|       |
 2380|       |    // read the instances
 2381|       |    // (this loop test is here to avoid an infinite loop with damaged
 2382|       |    // JBIG2 streams where the normal loop exit doesn't get triggered)
 2383|   188k|    while (inst < numInstances) {
  ------------------
  |  Branch (2383:12): [True: 184k, False: 3.45k]
  ------------------
 2384|       |
 2385|       |      // T value
 2386|   184k|      if (strips == 1) {
  ------------------
  |  Branch (2386:11): [True: 183k, False: 1.44k]
  ------------------
 2387|   183k|	dt = 0;
 2388|   183k|      } else if (huff) {
  ------------------
  |  Branch (2388:18): [True: 1.44k, False: 0]
  ------------------
 2389|  1.44k|	dt = huffDecoder->readBits(logStrips);
 2390|  1.44k|      } else {
 2391|      0|	arithDecoder->decodeInt(&dt, iaitStats);
 2392|      0|      }
 2393|   184k|      tt = t + dt;
 2394|       |
 2395|       |      // symbol ID
 2396|   184k|      if (huff) {
  ------------------
  |  Branch (2396:11): [True: 137k, False: 46.9k]
  ------------------
 2397|   137k|	if (symCodeTab) {
  ------------------
  |  Branch (2397:6): [True: 1.83k, False: 136k]
  ------------------
 2398|  1.83k|	  huffDecoder->decodeInt(&j, symCodeTab);
 2399|  1.83k|	  symID = (Guint)j;
 2400|   136k|	} else {
 2401|   136k|	  symID = huffDecoder->readBits(symCodeLen);
 2402|   136k|	}
 2403|   137k|      } else {
 2404|  46.9k|	symID = arithDecoder->decodeIAID(symCodeLen, iaidStats);
 2405|  46.9k|      }
 2406|       |
 2407|   184k|      if (symID >= (Guint)numSyms) {
  ------------------
  |  Branch (2407:11): [True: 155k, False: 29.8k]
  ------------------
 2408|   155k|	error(errSyntaxError, getPos(),
 2409|   155k|	      "Invalid symbol number in JBIG2 text region");
 2410|   155k|      } else {
 2411|       |
 2412|       |	// get the symbol bitmap
 2413|  29.8k|	symbolBitmap = NULL;
 2414|  29.8k|	if (refine) {
  ------------------
  |  Branch (2414:6): [True: 29.8k, False: 0]
  ------------------
 2415|  29.8k|	  if (huff) {
  ------------------
  |  Branch (2415:8): [True: 29.6k, False: 145]
  ------------------
 2416|  29.6k|	    ri = (int)huffDecoder->readBit();
 2417|  29.6k|	  } else {
 2418|    145|	    arithDecoder->decodeInt(&ri, iariStats);
 2419|    145|	  }
 2420|  29.8k|	} else {
 2421|      0|	  ri = 0;
 2422|      0|	}
 2423|  29.8k|	if (ri) {
  ------------------
  |  Branch (2423:6): [True: 3.43k, False: 26.3k]
  ------------------
 2424|  3.43k|	  if (huff) {
  ------------------
  |  Branch (2424:8): [True: 3.29k, False: 145]
  ------------------
 2425|  3.29k|	    huffDecoder->decodeInt(&rdw, huffRDWTable);
 2426|  3.29k|	    huffDecoder->decodeInt(&rdh, huffRDHTable);
 2427|  3.29k|	    huffDecoder->decodeInt(&rdx, huffRDXTable);
 2428|  3.29k|	    huffDecoder->decodeInt(&rdy, huffRDYTable);
 2429|  3.29k|	    huffDecoder->decodeInt(&bmSize, huffRSizeTable);
 2430|  3.29k|	    huffDecoder->reset();
 2431|  3.29k|	    arithDecoder->start();
 2432|  3.29k|	  } else {
 2433|    145|	    arithDecoder->decodeInt(&rdw, iardwStats);
 2434|    145|	    arithDecoder->decodeInt(&rdh, iardhStats);
 2435|    145|	    arithDecoder->decodeInt(&rdx, iardxStats);
 2436|    145|	    arithDecoder->decodeInt(&rdy, iardyStats);
 2437|    145|	  }
 2438|  3.43k|	  refDX = ((rdw >= 0) ? rdw : rdw - 1) / 2 + rdx;
  ------------------
  |  Branch (2438:13): [True: 2.90k, False: 533]
  ------------------
 2439|  3.43k|	  refDY = ((rdh >= 0) ? rdh : rdh - 1) / 2 + rdy;
  ------------------
  |  Branch (2439:13): [True: 3.21k, False: 218]
  ------------------
 2440|       |
 2441|  3.43k|	  if (rdw > INT_MAX - syms[symID]->getWidth() ||
  ------------------
  |  Branch (2441:8): [True: 233, False: 3.20k]
  ------------------
 2442|  3.20k|	      rdh > INT_MAX - syms[symID]->getHeight()) {
  ------------------
  |  Branch (2442:8): [True: 1, False: 3.20k]
  ------------------
 2443|    234|	    error(errSyntaxError, getPos(),
 2444|    234|		  "Invalid refinement size in JBIG2 text region");
 2445|    234|	    continue;
 2446|    234|	  }
 2447|       |	  // sanity check
 2448|  3.20k|	  if (rdw > 1000 || rdh > 1000) {
  ------------------
  |  Branch (2448:8): [True: 489, False: 2.71k]
  |  Branch (2448:22): [True: 0, False: 2.71k]
  ------------------
 2449|    489|	    error(errSyntaxError, getPos(),
 2450|    489|		  "Invalid refinement size in JBIG2 text region");
 2451|    489|	    continue;
 2452|    489|	  }
 2453|  2.71k|	  symbolBitmap =
 2454|  2.71k|	    readGenericRefinementRegion(rdw + syms[symID]->getWidth(),
 2455|  2.71k|					rdh + syms[symID]->getHeight(),
 2456|  2.71k|					templ, gFalse, syms[symID],
  ------------------
  |  |   18|  2.71k|#define gFalse 0
  ------------------
 2457|  2.71k|					refDX, refDY, atx, aty);
 2458|       |	  //~ do we need to use the bmSize value here (in Huffman mode)?
 2459|  26.3k|	} else {
 2460|  26.3k|	  symbolBitmap = syms[symID];
 2461|  26.3k|	}
 2462|       |
 2463|       |	// combine the symbol bitmap into the region bitmap
 2464|       |	//~ something is wrong here - refCorner shouldn't degenerate into
 2465|       |	//~   two cases
 2466|  29.0k|	bw = symbolBitmap->getWidth() - 1;
 2467|  29.0k|	bh = symbolBitmap->getHeight() - 1;
 2468|  29.0k|	if (transposed) {
  ------------------
  |  Branch (2468:6): [True: 0, False: 29.0k]
  ------------------
 2469|      0|	  switch (refCorner) {
  ------------------
  |  Branch (2469:12): [True: 0, False: 0]
  ------------------
 2470|      0|	  case 0: // bottom left
  ------------------
  |  Branch (2470:4): [True: 0, False: 0]
  ------------------
 2471|      0|	    bitmap->combine(symbolBitmap, tt, s, combOp);
 2472|      0|	    break;
 2473|      0|	  case 1: // top left
  ------------------
  |  Branch (2473:4): [True: 0, False: 0]
  ------------------
 2474|      0|	    bitmap->combine(symbolBitmap, tt, s, combOp);
 2475|      0|	    break;
 2476|      0|	  case 2: // bottom right
  ------------------
  |  Branch (2476:4): [True: 0, False: 0]
  ------------------
 2477|      0|	    bitmap->combine(symbolBitmap, tt - bw, s, combOp);
 2478|      0|	    break;
 2479|      0|	  case 3: // top right
  ------------------
  |  Branch (2479:4): [True: 0, False: 0]
  ------------------
 2480|      0|	    bitmap->combine(symbolBitmap, tt - bw, s, combOp);
 2481|      0|	    break;
 2482|      0|	  }
 2483|      0|	  s += bh;
 2484|  29.0k|	} else {
 2485|  29.0k|	  switch (refCorner) {
  ------------------
  |  Branch (2485:12): [True: 29.0k, False: 1]
  ------------------
 2486|      0|	  case 0: // bottom left
  ------------------
  |  Branch (2486:4): [True: 0, False: 29.0k]
  ------------------
 2487|      0|	    bitmap->combine(symbolBitmap, s, tt - bh, combOp);
 2488|      0|	    break;
 2489|  29.0k|	  case 1: // top left
  ------------------
  |  Branch (2489:4): [True: 29.0k, False: 1]
  ------------------
 2490|  29.0k|	    bitmap->combine(symbolBitmap, s, tt, combOp);
 2491|  29.0k|	    break;
 2492|      0|	  case 2: // bottom right
  ------------------
  |  Branch (2492:4): [True: 0, False: 29.0k]
  ------------------
 2493|      0|	    bitmap->combine(symbolBitmap, s, tt - bh, combOp);
 2494|      0|	    break;
 2495|      0|	  case 3: // top right
  ------------------
  |  Branch (2495:4): [True: 0, False: 29.0k]
  ------------------
 2496|      0|	    bitmap->combine(symbolBitmap, s, tt, combOp);
 2497|      0|	    break;
 2498|  29.0k|	  }
 2499|  29.0k|	  s += bw;
 2500|  29.0k|	}
 2501|  29.0k|	if (ri) {
  ------------------
  |  Branch (2501:6): [True: 2.71k, False: 26.3k]
  ------------------
 2502|  2.71k|	  delete symbolBitmap;
 2503|  2.71k|	}
 2504|  29.0k|      }
 2505|       |
 2506|       |      // next instance
 2507|   184k|      ++inst;
 2508|       |
 2509|       |      // next S value
 2510|   184k|      if (huff) {
  ------------------
  |  Branch (2510:11): [True: 137k, False: 46.8k]
  ------------------
 2511|   137k|	if (!huffDecoder->decodeInt(&ds, huffDSTable)) {
  ------------------
  |  Branch (2511:6): [True: 24.3k, False: 112k]
  ------------------
 2512|  24.3k|	  break;
 2513|  24.3k|	}
 2514|   137k|      } else {
 2515|  46.8k|	if (!arithDecoder->decodeInt(&ds, iadsStats)) {
  ------------------
  |  Branch (2515:6): [True: 1.67k, False: 45.2k]
  ------------------
 2516|  1.67k|	  break;
 2517|  1.67k|	}
 2518|  46.8k|      }
 2519|   158k|      s += sOffset + ds;
 2520|   158k|    }
 2521|  29.4k|  }
 2522|       |
 2523|  5.31k|  return bitmap;
 2524|  5.31k|}
_ZN11JBIG2Stream18readPatternDictSegEjj:
 2526|  2.48k|void JBIG2Stream::readPatternDictSeg(Guint segNum, Guint length) {
 2527|  2.48k|  JBIG2PatternDict *patternDict;
 2528|  2.48k|  JBIG2Bitmap *bitmap;
 2529|  2.48k|  Guint flags, patternW, patternH, grayMax, templ, mmr;
 2530|  2.48k|  int atx[4], aty[4];
 2531|  2.48k|  Guint i, x;
 2532|       |
 2533|       |  // halftone dictionary flags, pattern width and height, max gray value
 2534|  2.48k|  if (!readUByte(&flags) ||
  ------------------
  |  Branch (2534:7): [True: 214, False: 2.27k]
  ------------------
 2535|  2.27k|      !readUByte(&patternW) ||
  ------------------
  |  Branch (2535:7): [True: 33, False: 2.23k]
  ------------------
 2536|  2.23k|      !readUByte(&patternH) ||
  ------------------
  |  Branch (2536:7): [True: 33, False: 2.20k]
  ------------------
 2537|  2.20k|      !readULong(&grayMax)) {
  ------------------
  |  Branch (2537:7): [True: 494, False: 1.71k]
  ------------------
 2538|    774|    goto eofError;
 2539|    774|  }
 2540|  1.71k|  if (patternW == 0 || patternH == 0 ||
  ------------------
  |  Branch (2540:7): [True: 239, False: 1.47k]
  |  Branch (2540:24): [True: 10, False: 1.46k]
  ------------------
 2541|  1.46k|      grayMax > UINT_MAX / patternW - 1) {
  ------------------
  |  Branch (2541:7): [True: 190, False: 1.27k]
  ------------------
 2542|    439|    error(errSyntaxError, getPos(),
 2543|    439|	  "Bad size in JBIG2 pattern dictionary segment");
 2544|    439|    return;
 2545|    439|  }
 2546|  1.27k|  templ = (flags >> 1) & 3;
 2547|  1.27k|  mmr = flags & 1;
 2548|       |
 2549|       |  // set up the arithmetic decoder
 2550|  1.27k|  if (!mmr) {
  ------------------
  |  Branch (2550:7): [True: 253, False: 1.01k]
  ------------------
 2551|    253|    resetGenericStats(templ, NULL);
 2552|    253|    arithDecoder->start();
 2553|    253|  }
 2554|       |
 2555|       |  // read the bitmap
 2556|  1.27k|  atx[0] = -(int)patternW; aty[0] =  0;
 2557|  1.27k|  atx[1] = -3;             aty[1] = -1;
 2558|  1.27k|  atx[2] =  2;             aty[2] = -2;
 2559|  1.27k|  atx[3] = -2;             aty[3] = -2;
 2560|  1.27k|  bitmap = readGenericBitmap(mmr, (grayMax + 1) * patternW, patternH,
 2561|  1.27k|			     templ, gFalse, gFalse, NULL,
  ------------------
  |  |   18|  1.27k|#define gFalse 0
  ------------------
              			     templ, gFalse, gFalse, NULL,
  ------------------
  |  |   18|  1.27k|#define gFalse 0
  ------------------
 2562|  1.27k|			     atx, aty, length - 7);
 2563|       |
 2564|       |  // create the pattern dict object
 2565|  1.27k|  patternDict = new JBIG2PatternDict(segNum, grayMax + 1);
 2566|       |
 2567|       |  // split up the bitmap
 2568|  1.27k|  x = 0;
 2569|  4.70k|  for (i = 0; i <= grayMax; ++i) {
  ------------------
  |  Branch (2569:15): [True: 3.42k, False: 1.27k]
  ------------------
 2570|  3.42k|    patternDict->setBitmap(i, bitmap->getSlice(x, 0, patternW, patternH));
 2571|  3.42k|    x += patternW;
 2572|  3.42k|  }
 2573|       |
 2574|       |  // free memory
 2575|  1.27k|  delete bitmap;
 2576|       |
 2577|       |  // store the new pattern dict
 2578|  1.27k|  segments->append(patternDict);
 2579|       |
 2580|  1.27k|  return;
 2581|       |
 2582|    774| eofError:
 2583|    774|  error(errSyntaxError, getPos(), "Unexpected EOF in JBIG2 stream");
 2584|    774|}
_ZN11JBIG2Stream21readHalftoneRegionSegEjiijPjj:
 2588|  7.37k|					Guint *refSegs, Guint nRefSegs) {
 2589|  7.37k|  JBIG2Bitmap *bitmap;
 2590|  7.37k|  JBIG2Segment *seg;
 2591|  7.37k|  JBIG2PatternDict *patternDict;
 2592|  7.37k|  JBIG2Bitmap *skipBitmap;
 2593|  7.37k|  Guint *grayImg;
 2594|  7.37k|  JBIG2Bitmap *grayBitmap;
 2595|  7.37k|  JBIG2Bitmap *patternBitmap;
 2596|  7.37k|  Guint w, h, x, y, segInfoFlags, extCombOp;
 2597|  7.37k|  Guint flags, mmr, templ, enableSkip, combOp;
 2598|  7.37k|  Guint gridW, gridH, stepX, stepY, patW, patH;
 2599|  7.37k|  int atx[4], aty[4];
 2600|  7.37k|  int gridX, gridY, xx, yy, bit, j;
 2601|  7.37k|  Guint bpp, m, n, i;
 2602|       |
 2603|       |  // region segment info field
 2604|  7.37k|  if (!readULong(&w) || !readULong(&h) ||
  ------------------
  |  Branch (2604:7): [True: 597, False: 6.77k]
  |  Branch (2604:25): [True: 952, False: 5.82k]
  ------------------
 2605|  5.82k|      !readULong(&x) || !readULong(&y) ||
  ------------------
  |  Branch (2605:7): [True: 736, False: 5.08k]
  |  Branch (2605:25): [True: 668, False: 4.41k]
  ------------------
 2606|  4.41k|      !readUByte(&segInfoFlags)) {
  ------------------
  |  Branch (2606:7): [True: 220, False: 4.19k]
  ------------------
 2607|  3.17k|    goto eofError;
 2608|  3.17k|  }
 2609|       |  // sanity check: if the w/h/x/y values are way out of range, it likely
 2610|       |  // indicates a damaged JBIG2 stream
 2611|  4.19k|  if (w / 10 > pageW || h / 10 > pageH ||
  ------------------
  |  Branch (2611:7): [True: 309, False: 3.88k]
  |  Branch (2611:25): [True: 240, False: 3.64k]
  ------------------
 2612|  3.64k|      x / 10 > pageW || y / 10 > pageH) {
  ------------------
  |  Branch (2612:7): [True: 312, False: 3.33k]
  |  Branch (2612:25): [True: 355, False: 2.98k]
  ------------------
 2613|  1.21k|    error(errSyntaxError, getPos(),
 2614|  1.21k|	  "Bad size or position in JBIG2 halftone region segment");
 2615|  1.21k|    done = gTrue;
  ------------------
  |  |   17|  1.21k|#define gTrue 1
  ------------------
 2616|  1.21k|    return;
 2617|  1.21k|  }
 2618|  2.98k|  extCombOp = segInfoFlags & 7;
 2619|       |
 2620|       |  // rest of the halftone region header
 2621|  2.98k|  if (!readUByte(&flags)) {
  ------------------
  |  Branch (2621:7): [True: 129, False: 2.85k]
  ------------------
 2622|    129|    goto eofError;
 2623|    129|  }
 2624|  2.85k|  mmr = flags & 1;
 2625|  2.85k|  templ = (flags >> 1) & 3;
 2626|  2.85k|  enableSkip = (flags >> 3) & 1;
 2627|  2.85k|  combOp = (flags >> 4) & 7;
 2628|  2.85k|  if (!readULong(&gridW) || !readULong(&gridH) ||
  ------------------
  |  Branch (2628:7): [True: 256, False: 2.59k]
  |  Branch (2628:29): [True: 256, False: 2.34k]
  ------------------
 2629|  2.34k|      !readLong(&gridX) || !readLong(&gridY) ||
  ------------------
  |  Branch (2629:7): [True: 513, False: 1.82k]
  |  Branch (2629:28): [True: 239, False: 1.58k]
  ------------------
 2630|  1.61k|      !readUWord(&stepX) || !readUWord(&stepY)) {
  ------------------
  |  Branch (2630:7): [True: 128, False: 1.46k]
  |  Branch (2630:29): [True: 224, False: 1.23k]
  ------------------
 2631|  1.61k|    goto eofError;
 2632|  1.61k|  }
 2633|  1.23k|  if (w == 0 || h == 0 || w >= INT_MAX / h) {
  ------------------
  |  Branch (2633:7): [True: 192, False: 1.04k]
  |  Branch (2633:17): [True: 0, False: 1.04k]
  |  Branch (2633:27): [True: 148, False: 896]
  ------------------
 2634|    340|    error(errSyntaxError, getPos(),
 2635|    340|	  "Bad bitmap size in JBIG2 halftone segment");
 2636|    340|    return;
 2637|    340|  }
 2638|    896|  if (gridW == 0 || gridH == 0 || gridW >= INT_MAX / gridH) {
  ------------------
  |  Branch (2638:7): [True: 210, False: 686]
  |  Branch (2638:21): [True: 214, False: 472]
  |  Branch (2638:35): [True: 145, False: 327]
  ------------------
 2639|    569|    error(errSyntaxError, getPos(), "Bad grid size in JBIG2 halftone segment");
 2640|    569|    return;
 2641|    569|  }
 2642|       |
 2643|       |  // get pattern dictionary
 2644|    327|  if (nRefSegs != 1) {
  ------------------
  |  Branch (2644:7): [True: 133, False: 194]
  ------------------
 2645|    133|    error(errSyntaxError, getPos(),
 2646|    133|	  "Bad symbol dictionary reference in JBIG2 halftone segment");
 2647|    133|    return;
 2648|    133|  }
 2649|    194|  if (!(seg = findSegment(refSegs[0])) ||
  ------------------
  |  Branch (2649:7): [True: 194, False: 0]
  ------------------
 2650|    194|      seg->getType() != jbig2SegPatternDict) {
  ------------------
  |  Branch (2650:7): [True: 0, False: 0]
  ------------------
 2651|    194|    error(errSyntaxError, getPos(),
 2652|    194|	  "Bad symbol dictionary reference in JBIG2 halftone segment");
 2653|    194|    return;
 2654|    194|  }
 2655|      0|  patternDict = (JBIG2PatternDict *)seg;
 2656|      0|  i = patternDict->getSize();
 2657|      0|  if (i <= 1) {
  ------------------
  |  Branch (2657:7): [True: 0, False: 0]
  ------------------
 2658|      0|    bpp = 0;
 2659|      0|  } else {
 2660|      0|    --i;
 2661|      0|    bpp = 0;
 2662|       |    // i = floor((size-1) / 2^bpp)
 2663|      0|    while (i > 0) {
  ------------------
  |  Branch (2663:12): [True: 0, False: 0]
  ------------------
 2664|      0|      ++bpp;
 2665|      0|      i >>= 1;
 2666|      0|    }
 2667|      0|  }
 2668|      0|  patW = patternDict->getBitmap(0)->getWidth();
 2669|      0|  patH = patternDict->getBitmap(0)->getHeight();
 2670|       |
 2671|       |  // set up the arithmetic decoder
 2672|      0|  if (!mmr) {
  ------------------
  |  Branch (2672:7): [True: 0, False: 0]
  ------------------
 2673|      0|    resetGenericStats(templ, NULL);
 2674|      0|    arithDecoder->start();
 2675|      0|  }
 2676|       |
 2677|       |  // allocate the bitmap
 2678|      0|  bitmap = new JBIG2Bitmap(segNum, w, h);
 2679|      0|  if (flags & 0x80) { // HDEFPIXEL
  ------------------
  |  Branch (2679:7): [True: 0, False: 0]
  ------------------
 2680|      0|    bitmap->clearToOne();
 2681|      0|  } else {
 2682|      0|    bitmap->clearToZero();
 2683|      0|  }
 2684|       |
 2685|       |  // compute the skip bitmap
 2686|      0|  skipBitmap = NULL;
 2687|      0|  if (enableSkip) {
  ------------------
  |  Branch (2687:7): [True: 0, False: 0]
  ------------------
 2688|      0|    skipBitmap = new JBIG2Bitmap(0, gridW, gridH);
 2689|      0|    skipBitmap->clearToZero();
 2690|      0|    for (m = 0; m < gridH; ++m) {
  ------------------
  |  Branch (2690:17): [True: 0, False: 0]
  ------------------
 2691|      0|      for (n = 0; n < gridW; ++n) {
  ------------------
  |  Branch (2691:19): [True: 0, False: 0]
  ------------------
 2692|      0|	xx = gridX + m * stepY + n * stepX;
 2693|      0|	yy = gridY + m * stepX - n * stepY;
 2694|      0|	if (((xx + (int)patW) >> 8) <= 0 || (xx >> 8) >= (int)w ||
  ------------------
  |  Branch (2694:6): [True: 0, False: 0]
  |  Branch (2694:38): [True: 0, False: 0]
  ------------------
 2695|      0|	    ((yy + (int)patH) >> 8) <= 0 || (yy >> 8) >= (int)h) {
  ------------------
  |  Branch (2695:6): [True: 0, False: 0]
  |  Branch (2695:38): [True: 0, False: 0]
  ------------------
 2696|      0|	  skipBitmap->setPixel(n, m);
 2697|      0|	}
 2698|      0|      }
 2699|      0|    }
 2700|      0|  }
 2701|       |
 2702|       |  // read the gray-scale image
 2703|      0|  grayImg = (Guint *)gmallocn(gridW * gridH, sizeof(Guint));
 2704|      0|  memset(grayImg, 0, gridW * gridH * sizeof(Guint));
 2705|      0|  atx[0] = templ <= 1 ? 3 : 2;  aty[0] = -1;
  ------------------
  |  Branch (2705:12): [True: 0, False: 0]
  ------------------
 2706|      0|  atx[1] = -3;                  aty[1] = -1;
 2707|      0|  atx[2] =  2;                  aty[2] = -2;
 2708|      0|  atx[3] = -2;                  aty[3] = -2;
 2709|      0|  for (j = bpp - 1; j >= 0; --j) {
  ------------------
  |  Branch (2709:21): [True: 0, False: 0]
  ------------------
 2710|      0|    grayBitmap = readGenericBitmap(mmr, gridW, gridH, templ, gFalse,
  ------------------
  |  |   18|      0|#define gFalse 0
  ------------------
 2711|      0|				   enableSkip, skipBitmap, atx, aty, -1);
 2712|      0|    i = 0;
 2713|      0|    for (m = 0; m < gridH; ++m) {
  ------------------
  |  Branch (2713:17): [True: 0, False: 0]
  ------------------
 2714|      0|      for (n = 0; n < gridW; ++n) {
  ------------------
  |  Branch (2714:19): [True: 0, False: 0]
  ------------------
 2715|      0|	bit = grayBitmap->getPixel(n, m) ^ (grayImg[i] & 1);
 2716|      0|	grayImg[i] = (grayImg[i] << 1) | bit;
 2717|      0|	++i;
 2718|      0|      }
 2719|      0|    }
 2720|      0|    delete grayBitmap;
 2721|      0|  }
 2722|       |
 2723|       |  // decode the image
 2724|      0|  i = 0;
 2725|      0|  for (m = 0; m < gridH; ++m) {
  ------------------
  |  Branch (2725:15): [True: 0, False: 0]
  ------------------
 2726|      0|    xx = gridX + m * stepY;
 2727|      0|    yy = gridY + m * stepX;
 2728|      0|    for (n = 0; n < gridW; ++n) {
  ------------------
  |  Branch (2728:17): [True: 0, False: 0]
  ------------------
 2729|      0|      if (!(enableSkip && skipBitmap->getPixel(n, m))) {
  ------------------
  |  Branch (2729:13): [True: 0, False: 0]
  |  Branch (2729:27): [True: 0, False: 0]
  ------------------
 2730|      0|	Guint gray = grayImg[i];
 2731|      0|	if (gray >= patternDict->getSize()) {
  ------------------
  |  Branch (2731:6): [True: 0, False: 0]
  ------------------
 2732|      0|	  error(errSyntaxError, getPos(),
 2733|      0|		"Invalid gray value in JBIG2 halftone segment");
 2734|      0|	  gfree(grayImg);
 2735|      0|	  if (skipBitmap) {
  ------------------
  |  Branch (2735:8): [True: 0, False: 0]
  ------------------
 2736|      0|	    delete skipBitmap;
 2737|      0|	  }
 2738|      0|	  delete bitmap;
 2739|      0|	  return;
 2740|      0|	}
 2741|      0|	patternBitmap = patternDict->getBitmap(gray);
 2742|      0|	bitmap->combine(patternBitmap, xx >> 8, yy >> 8, combOp);
 2743|      0|      }
 2744|      0|      xx += stepX;
 2745|      0|      yy -= stepY;
 2746|      0|      ++i;
 2747|      0|    }
 2748|      0|  }
 2749|       |
 2750|      0|  gfree(grayImg);
 2751|      0|  if (skipBitmap) {
  ------------------
  |  Branch (2751:7): [True: 0, False: 0]
  ------------------
 2752|      0|    delete skipBitmap;
 2753|      0|  }
 2754|       |
 2755|       |  // combine the region bitmap into the page bitmap
 2756|      0|  if (imm) {
  ------------------
  |  Branch (2756:7): [True: 0, False: 0]
  ------------------
 2757|      0|    if (pageH == 0xffffffff && y + h > curPageH) {
  ------------------
  |  Branch (2757:9): [True: 0, False: 0]
  |  Branch (2757:32): [True: 0, False: 0]
  ------------------
 2758|      0|      pageBitmap->expand(y + h, pageDefPixel);
 2759|      0|    }
 2760|      0|    pageBitmap->combine(bitmap, x, y, extCombOp);
 2761|      0|    delete bitmap;
 2762|       |
 2763|       |  // store the region bitmap
 2764|      0|  } else {
 2765|      0|    segments->append(bitmap);
 2766|      0|  }
 2767|       |
 2768|      0|  return;
 2769|       |
 2770|  4.91k| eofError:
 2771|  4.91k|  error(errSyntaxError, getPos(), "Unexpected EOF in JBIG2 stream");
 2772|  4.91k|}
_ZN11JBIG2Stream20readGenericRegionSegEjiij:
 2775|  9.08k|				       GBool lossless, Guint length) {
 2776|  9.08k|  JBIG2Bitmap *bitmap;
 2777|  9.08k|  Guint w, h, x, y, segInfoFlags, extCombOp, rowCount;
 2778|  9.08k|  Guint flags, mmr, templ, tpgdOn;
 2779|  9.08k|  int atx[4], aty[4];
 2780|       |
 2781|       |  // region segment info field
 2782|  9.08k|  if (!readULong(&w) || !readULong(&h) ||
  ------------------
  |  Branch (2782:7): [True: 447, False: 8.63k]
  |  Branch (2782:25): [True: 753, False: 7.88k]
  ------------------
 2783|  7.88k|      !readULong(&x) || !readULong(&y) ||
  ------------------
  |  Branch (2783:7): [True: 618, False: 7.26k]
  |  Branch (2783:25): [True: 816, False: 6.45k]
  ------------------
 2784|  6.45k|      !readUByte(&segInfoFlags)) {
  ------------------
  |  Branch (2784:7): [True: 135, False: 6.31k]
  ------------------
 2785|  2.76k|    goto eofError;
 2786|  2.76k|  }
 2787|  6.31k|  if (w == 0 || h == 0) {
  ------------------
  |  Branch (2787:7): [True: 287, False: 6.02k]
  |  Branch (2787:17): [True: 130, False: 5.89k]
  ------------------
 2788|    417|    error(errSyntaxError, getPos(),
 2789|    417|	  "Bad bitmap size in JBIG2 generic region segment");
 2790|    417|    return;
 2791|    417|  }
 2792|       |  // sanity check: if the w/h/x/y values are way out of range, it likely
 2793|       |  // indicates a damaged JBIG2 stream
 2794|  5.89k|  if (w / 10 > pageW || h / 10 > pageH ||
  ------------------
  |  Branch (2794:7): [True: 137, False: 5.76k]
  |  Branch (2794:25): [True: 232, False: 5.53k]
  ------------------
 2795|  5.53k|      x / 10 > pageW || y / 10 > pageH) {
  ------------------
  |  Branch (2795:7): [True: 445, False: 5.08k]
  |  Branch (2795:25): [True: 229, False: 4.85k]
  ------------------
 2796|  1.04k|    error(errSyntaxError, getPos(),
 2797|  1.04k|	  "Bad size or position in JBIG2 generic region segment");
 2798|  1.04k|    done = gTrue;
  ------------------
  |  |   17|  1.04k|#define gTrue 1
  ------------------
 2799|  1.04k|    return;
 2800|  1.04k|  }
 2801|  4.85k|  extCombOp = segInfoFlags & 7;
 2802|       |
 2803|       |  // rest of the generic region segment header
 2804|  4.85k|  if (!readUByte(&flags)) {
  ------------------
  |  Branch (2804:7): [True: 128, False: 4.72k]
  ------------------
 2805|    128|    goto eofError;
 2806|    128|  }
 2807|  4.72k|  mmr = flags & 1;
 2808|  4.72k|  templ = (flags >> 1) & 3;
 2809|  4.72k|  tpgdOn = (flags >> 3) & 1;
 2810|       |
 2811|       |  // AT flags
 2812|  4.72k|  if (!mmr) {
  ------------------
  |  Branch (2812:7): [True: 4.10k, False: 619]
  ------------------
 2813|  4.10k|    if (templ == 0) {
  ------------------
  |  Branch (2813:9): [True: 2.56k, False: 1.54k]
  ------------------
 2814|  2.56k|      if (!readByte(&atx[0]) ||
  ------------------
  |  Branch (2814:11): [True: 210, False: 2.35k]
  ------------------
 2815|  2.35k|	  !readByte(&aty[0]) ||
  ------------------
  |  Branch (2815:4): [True: 250, False: 2.10k]
  ------------------
 2816|  2.10k|	  !readByte(&atx[1]) ||
  ------------------
  |  Branch (2816:4): [True: 286, False: 1.81k]
  ------------------
 2817|  1.81k|	  !readByte(&aty[1]) ||
  ------------------
  |  Branch (2817:4): [True: 206, False: 1.61k]
  ------------------
 2818|  1.61k|	  !readByte(&atx[2]) ||
  ------------------
  |  Branch (2818:4): [True: 128, False: 1.48k]
  ------------------
 2819|  1.48k|	  !readByte(&aty[2]) ||
  ------------------
  |  Branch (2819:4): [True: 128, False: 1.35k]
  ------------------
 2820|  1.35k|	  !readByte(&atx[3]) ||
  ------------------
  |  Branch (2820:4): [True: 259, False: 1.09k]
  ------------------
 2821|  1.63k|	  !readByte(&aty[3])) {
  ------------------
  |  Branch (2821:4): [True: 165, False: 933]
  ------------------
 2822|  1.63k|	goto eofError;
 2823|  1.63k|      }
 2824|  2.56k|    } else {
 2825|  1.54k|      if (!readByte(&atx[0]) ||
  ------------------
  |  Branch (2825:11): [True: 188, False: 1.35k]
  ------------------
 2826|  1.35k|	  !readByte(&aty[0])) {
  ------------------
  |  Branch (2826:4): [True: 281, False: 1.07k]
  ------------------
 2827|    469|	goto eofError;
 2828|    469|      }
 2829|  1.54k|    }
 2830|  4.10k|  }
 2831|       |
 2832|       |  // set up the arithmetic decoder
 2833|  2.62k|  if (!mmr) {
  ------------------
  |  Branch (2833:7): [True: 2.00k, False: 619]
  ------------------
 2834|  2.00k|    resetGenericStats(templ, NULL);
 2835|  2.00k|    arithDecoder->start();
 2836|  2.00k|  }
 2837|       |
 2838|       |  // read the bitmap
 2839|  2.62k|  bitmap = readGenericBitmap(mmr, w, h, templ, tpgdOn, gFalse,
  ------------------
  |  |   18|  2.62k|#define gFalse 0
  ------------------
 2840|  2.62k|			     NULL, atx, aty, mmr ? length - 18 : 0);
  ------------------
  |  Branch (2840:25): [True: 619, False: 2.00k]
  ------------------
 2841|       |
 2842|       |  // combine the region bitmap into the page bitmap
 2843|  2.62k|  if (imm) {
  ------------------
  |  Branch (2843:7): [True: 2.29k, False: 333]
  ------------------
 2844|  2.29k|    if (pageH == 0xffffffff && y + h > curPageH) {
  ------------------
  |  Branch (2844:9): [True: 1.02k, False: 1.27k]
  |  Branch (2844:32): [True: 1.02k, False: 0]
  ------------------
 2845|  1.02k|      pageBitmap->expand(y + h, pageDefPixel);
 2846|  1.02k|    }
 2847|  2.29k|    pageBitmap->combine(bitmap, x, y, extCombOp);
 2848|  2.29k|    delete bitmap;
 2849|       |
 2850|       |  // store the region bitmap
 2851|  2.29k|  } else {
 2852|    333|    bitmap->setSegNum(segNum);
 2853|    333|    segments->append(bitmap);
 2854|    333|  }
 2855|       |
 2856|       |  // immediate generic segments can have an unspecified length, in
 2857|       |  // which case, a row count is stored at the end of the segment
 2858|  2.62k|  if (imm && length == 0xffffffff) {
  ------------------
  |  Branch (2858:7): [True: 2.29k, False: 333]
  |  Branch (2858:14): [True: 632, False: 1.66k]
  ------------------
 2859|    632|    readULong(&rowCount);
 2860|    632|  }
 2861|       |
 2862|  2.62k|  return;
 2863|       |
 2864|  4.99k| eofError:
 2865|  4.99k|  error(errSyntaxError, getPos(), "Unexpected EOF in JBIG2 stream");
 2866|  4.99k|}
_ZN11JBIG2Stream17readGenericBitmapEiiiiiiP11JBIG2BitmapPiS2_i:
 2911|  26.8k|					    int mmrDataLength) {
 2912|  26.8k|  JBIG2Bitmap *bitmap;
 2913|  26.8k|  GBool ltp;
 2914|  26.8k|  Guint ltpCX, cx, cx0, cx1, cx2;
 2915|  26.8k|  int *refLine, *codingLine;
 2916|  26.8k|  int code1, code2, code3;
 2917|  26.8k|  Guchar *p0, *p1, *p2, *pp;
 2918|  26.8k|  Guchar *atP0, *atP1, *atP2, *atP3;
 2919|  26.8k|  Guint buf0, buf1, buf2;
 2920|  26.8k|  Guint atBuf0, atBuf1, atBuf2, atBuf3;
 2921|  26.8k|  int atShift0, atShift1, atShift2, atShift3;
 2922|  26.8k|  Guchar mask;
 2923|  26.8k|  int x, y, x0, x1, a0i, b1i, blackPixels, pix, i;
 2924|       |
 2925|  26.8k|  bitmap = new JBIG2Bitmap(0, w, h);
 2926|  26.8k|  bitmap->clearToZero();
 2927|       |
 2928|       |  //----- MMR decode
 2929|       |
 2930|  26.8k|  if (mmr) {
  ------------------
  |  Branch (2930:7): [True: 3.15k, False: 23.6k]
  ------------------
 2931|       |
 2932|  3.15k|    mmrDecoder->reset();
 2933|  3.15k|    if (w > INT_MAX - 3) {
  ------------------
  |  Branch (2933:9): [True: 0, False: 3.15k]
  ------------------
 2934|      0|      error(errSyntaxError, getPos(), "Bad width in JBIG2 generic bitmap");
 2935|       |      // force a call to gmalloc(-1), which will throw an exception
 2936|      0|      w = -4;
 2937|      0|    }
 2938|       |    // 0 <= codingLine[0] < codingLine[1] < ... < codingLine[n] = w
 2939|       |    // ---> max codingLine size = w + 1
 2940|       |    // refLine has two extra guard entries at the end
 2941|       |    // ---> max refLine size = w + 3
 2942|  3.15k|    codingLine = (int *)gmallocn(w + 1, sizeof(int));
 2943|  3.15k|    refLine = (int *)gmallocn(w + 3, sizeof(int));
 2944|  3.15k|    codingLine[0] = w;
 2945|       |
 2946|   389k|    for (y = 0; y < h; ++y) {
  ------------------
  |  Branch (2946:17): [True: 385k, False: 3.15k]
  ------------------
 2947|       |
 2948|       |      // copy coding line to ref line
 2949|   714k|      for (i = 0; codingLine[i] < w; ++i) {
  ------------------
  |  Branch (2949:19): [True: 328k, False: 385k]
  ------------------
 2950|   328k|	refLine[i] = codingLine[i];
 2951|   328k|      }
 2952|   385k|      refLine[i++] = w;
 2953|   385k|      refLine[i++] = w;
 2954|   385k|      refLine[i] = w;
 2955|       |
 2956|       |      // decode a line
 2957|   385k|      codingLine[0] = 0;
 2958|   385k|      a0i = 0;
 2959|   385k|      b1i = 0;
 2960|   385k|      blackPixels = 0;
 2961|       |      // invariant:
 2962|       |      // refLine[b1i-1] <= codingLine[a0i] < refLine[b1i] < refLine[b1i+1] <= w
 2963|       |      // exception at left edge:
 2964|       |      //   codingLine[a0i = 0] = refLine[b1i = 0] = 0 is possible
 2965|       |      // exception at right edge:
 2966|       |      //   refLine[b1i] = refLine[b1i+1] = w is possible
 2967|  1.10M|      while (codingLine[a0i] < w) {
  ------------------
  |  Branch (2967:14): [True: 717k, False: 385k]
  ------------------
 2968|   717k|	code1 = mmrDecoder->get2DCode();
 2969|   717k|	switch (code1) {
 2970|  32.6k|	case twoDimPass:
  ------------------
  |  |   25|  32.6k|#define twoDimPass   0
  ------------------
  |  Branch (2970:2): [True: 32.6k, False: 684k]
  ------------------
 2971|  32.6k|          mmrAddPixels(refLine[b1i + 1], blackPixels, codingLine, &a0i, w);
 2972|  32.6k|          if (refLine[b1i + 1] < w) {
  ------------------
  |  Branch (2972:15): [True: 18.0k, False: 14.5k]
  ------------------
 2973|  18.0k|            b1i += 2;
 2974|  18.0k|          }
 2975|  32.6k|          break;
 2976|  60.8k|	case twoDimHoriz:
  ------------------
  |  |   26|  60.8k|#define twoDimHoriz  1
  ------------------
  |  Branch (2976:2): [True: 60.8k, False: 656k]
  ------------------
 2977|  60.8k|          code1 = code2 = 0;
 2978|  60.8k|          if (blackPixels) {
  ------------------
  |  Branch (2978:15): [True: 25.0k, False: 35.8k]
  ------------------
 2979|  25.6k|            do {
 2980|  25.6k|              code1 += code3 = mmrDecoder->getBlackCode();
 2981|  25.6k|            } while (code3 >= 64);
  ------------------
  |  Branch (2981:22): [True: 619, False: 25.0k]
  ------------------
 2982|  28.9k|            do {
 2983|  28.9k|              code2 += code3 = mmrDecoder->getWhiteCode();
 2984|  28.9k|            } while (code3 >= 64);
  ------------------
  |  Branch (2984:22): [True: 3.92k, False: 25.0k]
  ------------------
 2985|  35.8k|          } else {
 2986|  37.9k|            do {
 2987|  37.9k|              code1 += code3 = mmrDecoder->getWhiteCode();
 2988|  37.9k|            } while (code3 >= 64);
  ------------------
  |  Branch (2988:22): [True: 2.08k, False: 35.8k]
  ------------------
 2989|  35.9k|            do {
 2990|  35.9k|              code2 += code3 = mmrDecoder->getBlackCode();
 2991|  35.9k|            } while (code3 >= 64);
  ------------------
  |  Branch (2991:22): [True: 130, False: 35.8k]
  ------------------
 2992|  35.8k|          }
 2993|  60.8k|          mmrAddPixels(codingLine[a0i] + code1, blackPixels,
 2994|  60.8k|		       codingLine, &a0i, w);
 2995|  60.8k|          if (codingLine[a0i] < w) {
  ------------------
  |  Branch (2995:15): [True: 50.3k, False: 10.5k]
  ------------------
 2996|  50.3k|            mmrAddPixels(codingLine[a0i] + code2, blackPixels ^ 1,
 2997|  50.3k|			 codingLine, &a0i, w);
 2998|  50.3k|          }
 2999|  88.2k|          while (refLine[b1i] <= codingLine[a0i] && refLine[b1i] < w) {
  ------------------
  |  Branch (2999:18): [True: 41.4k, False: 46.7k]
  |  Branch (2999:53): [True: 27.3k, False: 14.0k]
  ------------------
 3000|  27.3k|            b1i += 2;
 3001|  27.3k|          }
 3002|  60.8k|          break;
 3003|  9.46k|	case twoDimVertR3:
  ------------------
  |  |   32|  9.46k|#define twoDimVertR3 7
  ------------------
  |  Branch (3003:2): [True: 9.46k, False: 708k]
  ------------------
 3004|  9.46k|          mmrAddPixels(refLine[b1i] + 3, blackPixels, codingLine, &a0i, w);
 3005|  9.46k|          blackPixels ^= 1;
 3006|  9.46k|          if (codingLine[a0i] < w) {
  ------------------
  |  Branch (3006:15): [True: 5.15k, False: 4.31k]
  ------------------
 3007|  5.15k|            ++b1i;
 3008|  5.36k|            while (refLine[b1i] <= codingLine[a0i] && refLine[b1i] < w) {
  ------------------
  |  Branch (3008:20): [True: 206, False: 5.15k]
  |  Branch (3008:55): [True: 206, False: 0]
  ------------------
 3009|    206|              b1i += 2;
 3010|    206|            }
 3011|  5.15k|          }
 3012|  9.46k|          break;
 3013|  5.62k|	case twoDimVertR2:
  ------------------
  |  |   30|  5.62k|#define twoDimVertR2 5
  ------------------
  |  Branch (3013:2): [True: 5.62k, False: 711k]
  ------------------
 3014|  5.62k|          mmrAddPixels(refLine[b1i] + 2, blackPixels, codingLine, &a0i, w);
 3015|  5.62k|          blackPixels ^= 1;
 3016|  5.62k|          if (codingLine[a0i] < w) {
  ------------------
  |  Branch (3016:15): [True: 4.41k, False: 1.21k]
  ------------------
 3017|  4.41k|            ++b1i;
 3018|  4.99k|            while (refLine[b1i] <= codingLine[a0i] && refLine[b1i] < w) {
  ------------------
  |  Branch (3018:20): [True: 581, False: 4.41k]
  |  Branch (3018:55): [True: 581, False: 0]
  ------------------
 3019|    581|              b1i += 2;
 3020|    581|            }
 3021|  4.41k|          }
 3022|  5.62k|          break;
 3023|  27.4k|	case twoDimVertR1:
  ------------------
  |  |   28|  27.4k|#define twoDimVertR1 3
  ------------------
  |  Branch (3023:2): [True: 27.4k, False: 690k]
  ------------------
 3024|  27.4k|          mmrAddPixels(refLine[b1i] + 1, blackPixels, codingLine, &a0i, w);
 3025|  27.4k|          blackPixels ^= 1;
 3026|  27.4k|          if (codingLine[a0i] < w) {
  ------------------
  |  Branch (3026:15): [True: 15.6k, False: 11.7k]
  ------------------
 3027|  15.6k|            ++b1i;
 3028|  16.2k|            while (refLine[b1i] <= codingLine[a0i] && refLine[b1i] < w) {
  ------------------
  |  Branch (3028:20): [True: 634, False: 15.6k]
  |  Branch (3028:55): [True: 634, False: 0]
  ------------------
 3029|    634|              b1i += 2;
 3030|    634|            }
 3031|  15.6k|          }
 3032|  27.4k|          break;
 3033|   251k|	case twoDimVert0:
  ------------------
  |  |   27|   251k|#define twoDimVert0  2
  ------------------
  |  Branch (3033:2): [True: 251k, False: 466k]
  ------------------
 3034|   251k|          mmrAddPixels(refLine[b1i], blackPixels, codingLine, &a0i, w);
 3035|   251k|          blackPixels ^= 1;
 3036|   251k|          if (codingLine[a0i] < w) {
  ------------------
  |  Branch (3036:15): [True: 171k, False: 80.1k]
  ------------------
 3037|   171k|            ++b1i;
 3038|   171k|            while (refLine[b1i] <= codingLine[a0i] && refLine[b1i] < w) {
  ------------------
  |  Branch (3038:20): [True: 0, False: 171k]
  |  Branch (3038:55): [True: 0, False: 0]
  ------------------
 3039|      0|              b1i += 2;
 3040|      0|            }
 3041|   171k|          }
 3042|   251k|          break;
 3043|  7.26k|	case twoDimVertL3:
  ------------------
  |  |   33|  7.26k|#define twoDimVertL3 8
  ------------------
  |  Branch (3043:2): [True: 7.26k, False: 710k]
  ------------------
 3044|  7.26k|          mmrAddPixelsNeg(refLine[b1i] - 3, blackPixels, codingLine, &a0i, w);
 3045|  7.26k|          blackPixels ^= 1;
 3046|  7.26k|          if (codingLine[a0i] < w) {
  ------------------
  |  Branch (3046:15): [True: 7.26k, False: 0]
  ------------------
 3047|  7.26k|            if (b1i > 0) {
  ------------------
  |  Branch (3047:17): [True: 6.15k, False: 1.11k]
  ------------------
 3048|  6.15k|              --b1i;
 3049|  6.15k|            } else {
 3050|  1.11k|              ++b1i;
 3051|  1.11k|            }
 3052|  9.73k|            while (refLine[b1i] <= codingLine[a0i] && refLine[b1i] < w) {
  ------------------
  |  Branch (3052:20): [True: 2.46k, False: 7.26k]
  |  Branch (3052:55): [True: 2.46k, False: 0]
  ------------------
 3053|  2.46k|              b1i += 2;
 3054|  2.46k|            }
 3055|  7.26k|          }
 3056|  7.26k|          break;
 3057|  36.2k|	case twoDimVertL2:
  ------------------
  |  |   31|  36.2k|#define twoDimVertL2 6
  ------------------
  |  Branch (3057:2): [True: 36.2k, False: 681k]
  ------------------
 3058|  36.2k|          mmrAddPixelsNeg(refLine[b1i] - 2, blackPixels, codingLine, &a0i, w);
 3059|  36.2k|          blackPixels ^= 1;
 3060|  36.2k|          if (codingLine[a0i] < w) {
  ------------------
  |  Branch (3060:15): [True: 36.2k, False: 0]
  ------------------
 3061|  36.2k|            if (b1i > 0) {
  ------------------
  |  Branch (3061:17): [True: 32.6k, False: 3.63k]
  ------------------
 3062|  32.6k|              --b1i;
 3063|  32.6k|            } else {
 3064|  3.63k|              ++b1i;
 3065|  3.63k|            }
 3066|  62.0k|            while (refLine[b1i] <= codingLine[a0i] && refLine[b1i] < w) {
  ------------------
  |  Branch (3066:20): [True: 25.7k, False: 36.2k]
  |  Branch (3066:55): [True: 25.7k, False: 0]
  ------------------
 3067|  25.7k|              b1i += 2;
 3068|  25.7k|            }
 3069|  36.2k|          }
 3070|  36.2k|          break;
 3071|  26.8k|	case twoDimVertL1:
  ------------------
  |  |   29|  26.8k|#define twoDimVertL1 4
  ------------------
  |  Branch (3071:2): [True: 26.8k, False: 690k]
  ------------------
 3072|  26.8k|          mmrAddPixelsNeg(refLine[b1i] - 1, blackPixels, codingLine, &a0i, w);
 3073|  26.8k|          blackPixels ^= 1;
 3074|  26.8k|          if (codingLine[a0i] < w) {
  ------------------
  |  Branch (3074:15): [True: 26.8k, False: 0]
  ------------------
 3075|  26.8k|            if (b1i > 0) {
  ------------------
  |  Branch (3075:17): [True: 18.9k, False: 7.91k]
  ------------------
 3076|  18.9k|              --b1i;
 3077|  18.9k|            } else {
 3078|  7.91k|              ++b1i;
 3079|  7.91k|            }
 3080|  44.7k|            while (refLine[b1i] <= codingLine[a0i] && refLine[b1i] < w) {
  ------------------
  |  Branch (3080:20): [True: 17.9k, False: 26.8k]
  |  Branch (3080:55): [True: 17.9k, False: 0]
  ------------------
 3081|  17.9k|              b1i += 2;
 3082|  17.9k|            }
 3083|  26.8k|          }
 3084|  26.8k|          break;
 3085|   259k|	case EOF:
  ------------------
  |  Branch (3085:2): [True: 259k, False: 457k]
  ------------------
 3086|   259k|          mmrAddPixels(w, 0, codingLine, &a0i, w);
 3087|   259k|          break;
 3088|      0|	default:
  ------------------
  |  Branch (3088:2): [True: 0, False: 717k]
  ------------------
 3089|      0|	  error(errSyntaxError, getPos(),
 3090|      0|		"Illegal code in JBIG2 MMR bitmap data");
 3091|      0|          mmrAddPixels(w, 0, codingLine, &a0i, w);
 3092|      0|	  break;
 3093|   717k|	}
 3094|   717k|      }
 3095|       |
 3096|       |      // convert the run lengths to a bitmap line
 3097|   385k|      i = 0;
 3098|   527k|      while (1) {
  ------------------
  |  Branch (3098:14): [True: 527k, Folded]
  ------------------
 3099|   527k|	if (codingLine[i] >= w) {
  ------------------
  |  Branch (3099:6): [True: 337k, False: 190k]
  ------------------
 3100|   337k|	  break;
 3101|   337k|	}
 3102|  12.0M|	for (x = codingLine[i]; x < codingLine[i+1]; ++x) {
  ------------------
  |  Branch (3102:26): [True: 11.9M, False: 190k]
  ------------------
 3103|  11.9M|	  bitmap->setPixel(x, y);
 3104|  11.9M|	}
 3105|   190k|	if (codingLine[i+1] >= w) {
  ------------------
  |  Branch (3105:6): [True: 48.5k, False: 141k]
  ------------------
 3106|  48.5k|	  break;
 3107|  48.5k|	}
 3108|   141k|	i += 2;
 3109|   141k|      }
 3110|   385k|    }
 3111|       |
 3112|  3.15k|    if (mmrDataLength >= 0) {
  ------------------
  |  Branch (3112:9): [True: 1.83k, False: 1.32k]
  ------------------
 3113|  1.83k|      mmrDecoder->skipTo(mmrDataLength);
 3114|  1.83k|    } else {
 3115|  1.32k|      if (mmrDecoder->get24Bits() != 0x001001) {
  ------------------
  |  Branch (3115:11): [True: 1.08k, False: 232]
  ------------------
 3116|  1.08k|	error(errSyntaxError, getPos(),
 3117|  1.08k|	      "Missing EOFB in JBIG2 MMR bitmap data");
 3118|  1.08k|      }
 3119|  1.32k|    }
 3120|       |
 3121|  3.15k|    gfree(refLine);
 3122|  3.15k|    gfree(codingLine);
 3123|       |
 3124|       |  //----- arithmetic decode
 3125|       |
 3126|  23.6k|  } else {
 3127|       |    // set up the typical row context
 3128|  23.6k|    ltpCX = 0; // make gcc happy
 3129|  23.6k|    if (tpgdOn) {
  ------------------
  |  Branch (3129:9): [True: 1.12k, False: 22.5k]
  ------------------
 3130|  1.12k|      switch (templ) {
  ------------------
  |  Branch (3130:15): [True: 1.12k, False: 0]
  ------------------
 3131|     57|      case 0:
  ------------------
  |  Branch (3131:7): [True: 57, False: 1.06k]
  ------------------
 3132|     57|	ltpCX = 0x3953; // 001 11001 0101 0011
 3133|     57|	break;
 3134|    176|      case 1:
  ------------------
  |  Branch (3134:7): [True: 176, False: 949]
  ------------------
 3135|    176|	ltpCX = 0x079a; // 0011 11001 101 0
 3136|    176|	break;
 3137|    105|      case 2:
  ------------------
  |  Branch (3137:7): [True: 105, False: 1.02k]
  ------------------
 3138|    105|	ltpCX = 0x0e3; // 001 1100 01 1
 3139|    105|	break;
 3140|    787|      case 3:
  ------------------
  |  Branch (3140:7): [True: 787, False: 338]
  ------------------
 3141|    787|	ltpCX = 0x18b; // 01100 0101 1
 3142|    787|	break;
 3143|  1.12k|      }
 3144|  1.12k|    }
 3145|       |
 3146|  23.6k|    ltp = 0;
 3147|  23.6k|    cx = cx0 = cx1 = cx2 = 0; // make gcc happy
 3148|   676k|    for (y = 0; y < h; ++y) {
  ------------------
  |  Branch (3148:17): [True: 652k, False: 23.6k]
  ------------------
 3149|       |
 3150|       |      // check for a "typical" (duplicate) row
 3151|   652k|      if (tpgdOn) {
  ------------------
  |  Branch (3151:11): [True: 357k, False: 294k]
  ------------------
 3152|   357k|	if (arithDecoder->decodeBit(ltpCX, genericRegionStats)) {
  ------------------
  |  Branch (3152:6): [True: 5.08k, False: 352k]
  ------------------
 3153|  5.08k|	  ltp = !ltp;
 3154|  5.08k|	}
 3155|   357k|	if (ltp) {
  ------------------
  |  Branch (3155:6): [True: 11.2k, False: 346k]
  ------------------
 3156|  11.2k|	  if (y > 0) {
  ------------------
  |  Branch (3156:8): [True: 10.9k, False: 346]
  ------------------
 3157|  10.9k|	    bitmap->duplicateRow(y, y-1);
 3158|  10.9k|	  }
 3159|  11.2k|	  continue;
 3160|  11.2k|	}
 3161|   357k|      }
 3162|       |
 3163|   641k|      switch (templ) {
  ------------------
  |  Branch (3163:15): [True: 641k, False: 0]
  ------------------
 3164|   293k|      case 0:
  ------------------
  |  Branch (3164:7): [True: 293k, False: 347k]
  ------------------
 3165|       |
 3166|       |	// set up the context
 3167|   293k|	p2 = pp = bitmap->getDataPtr() + y * bitmap->getLineSize();
 3168|   293k|	buf2 = *p2++ << 8;
 3169|   293k|	if (y >= 1) {
  ------------------
  |  Branch (3169:6): [True: 271k, False: 22.1k]
  ------------------
 3170|   271k|	  p1 = bitmap->getDataPtr() + (y - 1) * bitmap->getLineSize();
 3171|   271k|	  buf1 = *p1++ << 8;
 3172|   271k|	  if (y >= 2) {
  ------------------
  |  Branch (3172:8): [True: 261k, False: 9.58k]
  ------------------
 3173|   261k|	    p0 = bitmap->getDataPtr() + (y - 2) * bitmap->getLineSize();
 3174|   261k|	    buf0 = *p0++ << 8;
 3175|   261k|	  } else {
 3176|  9.58k|	    p0 = NULL;
 3177|  9.58k|	    buf0 = 0;
 3178|  9.58k|	  }
 3179|   271k|	} else {
 3180|  22.1k|	  p1 = p0 = NULL;
 3181|  22.1k|	  buf1 = buf0 = 0;
 3182|  22.1k|	}
 3183|       |
 3184|   293k|	if (atx[0] >= -8 && atx[0] <= 8 &&
  ------------------
  |  Branch (3184:6): [True: 291k, False: 2.59k]
  |  Branch (3184:22): [True: 60.5k, False: 230k]
  ------------------
 3185|  60.5k|	    atx[1] >= -8 && atx[1] <= 8 &&
  ------------------
  |  Branch (3185:6): [True: 50.4k, False: 10.0k]
  |  Branch (3185:22): [True: 49.4k, False: 990]
  ------------------
 3186|  49.4k|	    atx[2] >= -8 && atx[2] <= 8 &&
  ------------------
  |  Branch (3186:6): [True: 47.6k, False: 1.80k]
  |  Branch (3186:22): [True: 30.2k, False: 17.4k]
  ------------------
 3187|  30.2k|	    atx[3] >= -8 && atx[3] <= 8) {
  ------------------
  |  Branch (3187:6): [True: 30.2k, False: 0]
  |  Branch (3187:22): [True: 18.5k, False: 11.6k]
  ------------------
 3188|       |	  // set up the adaptive context
 3189|  18.5k|	  if (aty[0] <= 0 && y + aty[0] >= 0) {
  ------------------
  |  Branch (3189:8): [True: 963, False: 17.6k]
  |  Branch (3189:23): [True: 186, False: 777]
  ------------------
 3190|    186|	    atP0 = bitmap->getDataPtr() + (y + aty[0]) * bitmap->getLineSize();
 3191|    186|	    atBuf0 = *atP0++ << 8;
 3192|  18.3k|	  } else {
 3193|  18.3k|	    atP0 = NULL;
 3194|  18.3k|	    atBuf0 = 0;
 3195|  18.3k|	  }
 3196|  18.5k|	  atShift0 = 15 - atx[0];
 3197|  18.5k|	  if (aty[1] <= 0 && y + aty[1] >= 0) {
  ------------------
  |  Branch (3197:8): [True: 17.7k, False: 783]
  |  Branch (3197:23): [True: 0, False: 17.7k]
  ------------------
 3198|      0|	    atP1 = bitmap->getDataPtr() + (y + aty[1]) * bitmap->getLineSize();
 3199|      0|	    atBuf1 = *atP1++ << 8;
 3200|  18.5k|	  } else {
 3201|  18.5k|	    atP1 = NULL;
 3202|  18.5k|	    atBuf1 = 0;
 3203|  18.5k|	  }
 3204|  18.5k|	  atShift1 = 15 - atx[1];
 3205|  18.5k|	  if (aty[2] <= 0 && y + aty[2] >= 0) {
  ------------------
  |  Branch (3205:8): [True: 18.5k, False: 0]
  |  Branch (3205:23): [True: 18.3k, False: 180]
  ------------------
 3206|  18.3k|	    atP2 = bitmap->getDataPtr() + (y + aty[2]) * bitmap->getLineSize();
 3207|  18.3k|	    atBuf2 = *atP2++ << 8;
 3208|  18.3k|	  } else {
 3209|    180|	    atP2 = NULL;
 3210|    180|	    atBuf2 = 0;
 3211|    180|	  }
 3212|  18.5k|	  atShift2 = 15 - atx[2];
 3213|  18.5k|	  if (aty[3] <= 0 && y + aty[3] >= 0) {
  ------------------
  |  Branch (3213:8): [True: 18.5k, False: 0]
  |  Branch (3213:23): [True: 18.3k, False: 180]
  ------------------
 3214|  18.3k|	    atP3 = bitmap->getDataPtr() + (y + aty[3]) * bitmap->getLineSize();
 3215|  18.3k|	    atBuf3 = *atP3++ << 8;
 3216|  18.3k|	  } else {
 3217|    180|	    atP3 = NULL;
 3218|    180|	    atBuf3 = 0;
 3219|    180|	  }
 3220|  18.5k|	  atShift3 = 15 - atx[3];
 3221|       |
 3222|       |	  // decode the row
 3223|   105k|	  for (x0 = 0, x = 0; x0 < w; x0 += 8, ++pp) {
  ------------------
  |  Branch (3223:24): [True: 87.0k, False: 18.5k]
  ------------------
 3224|  87.0k|	    if (x0 + 8 < w) {
  ------------------
  |  Branch (3224:10): [True: 68.4k, False: 18.5k]
  ------------------
 3225|  68.4k|	      if (p0) {
  ------------------
  |  Branch (3225:12): [True: 23.1k, False: 45.3k]
  ------------------
 3226|  23.1k|		buf0 |= *p0++;
 3227|  23.1k|	      }
 3228|  68.4k|	      if (p1) {
  ------------------
  |  Branch (3228:12): [True: 24.7k, False: 43.7k]
  ------------------
 3229|  24.7k|		buf1 |= *p1++;
 3230|  24.7k|	      }
 3231|  68.4k|	      buf2 |= *p2++;
 3232|  68.4k|	      if (atP0) {
  ------------------
  |  Branch (3232:12): [True: 180, False: 68.2k]
  ------------------
 3233|    180|		atBuf0 |= *atP0++;
 3234|    180|	      }
 3235|  68.4k|	      if (atP1) {
  ------------------
  |  Branch (3235:12): [True: 0, False: 68.4k]
  ------------------
 3236|      0|		atBuf1 |= *atP1++;
 3237|      0|	      }
 3238|  68.4k|	      if (atP2) {
  ------------------
  |  Branch (3238:12): [True: 68.2k, False: 180]
  ------------------
 3239|  68.2k|		atBuf2 |= *atP2++;
 3240|  68.2k|	      }
 3241|  68.4k|	      if (atP3) {
  ------------------
  |  Branch (3241:12): [True: 68.2k, False: 180]
  ------------------
 3242|  68.2k|		atBuf3 |= *atP3++;
 3243|  68.2k|	      }
 3244|  68.4k|	    }
 3245|  87.0k|	    for (x1 = 0, mask = 0x80;
 3246|   709k|		 x1 < 8 && x < w;
  ------------------
  |  Branch (3246:4): [True: 641k, False: 68.5k]
  |  Branch (3246:14): [True: 622k, False: 18.4k]
  ------------------
 3247|   622k|		 ++x1, ++x, mask = (Guchar)(mask >> 1)) {
 3248|       |
 3249|       |	      // build the context
 3250|   622k|	      cx0 = (buf0 >> 14) & 0x07;
 3251|   622k|	      cx1 = (buf1 >> 13) & 0x1f;
 3252|   622k|	      cx2 = (buf2 >> 16) & 0x0f;
 3253|   622k|	      cx = (cx0 << 13) | (cx1 << 8) | (cx2 << 4) |
 3254|   622k|		   (((atBuf0 >> atShift0) & 1) << 3) |
 3255|   622k|		   (((atBuf1 >> atShift1) & 1) << 2) |
 3256|   622k|		   (((atBuf2 >> atShift2) & 1) << 1) |
 3257|   622k|		   ((atBuf3 >> atShift3) & 1);
 3258|       |
 3259|       |	      // check for a skipped pixel
 3260|   622k|	      if (!(useSkip && skip->getPixel(x, y))) {
  ------------------
  |  Branch (3260:14): [True: 0, False: 622k]
  |  Branch (3260:25): [True: 0, False: 0]
  ------------------
 3261|       |
 3262|       |		// decode the pixel
 3263|   622k|		if ((pix = arithDecoder->decodeBit(cx, genericRegionStats))) {
  ------------------
  |  Branch (3263:7): [True: 339k, False: 283k]
  ------------------
 3264|   339k|		  *pp |= mask;
 3265|   339k|		  buf2 |= 0x8000;
 3266|   339k|		  if (aty[0] == 0) {
  ------------------
  |  Branch (3266:9): [True: 2.16k, False: 336k]
  ------------------
 3267|  2.16k|		    atBuf0 |= 0x8000;
 3268|  2.16k|		  }
 3269|   339k|		  if (aty[1] == 0) {
  ------------------
  |  Branch (3269:9): [True: 0, False: 339k]
  ------------------
 3270|      0|		    atBuf1 |= 0x8000;
 3271|      0|		  }
 3272|   339k|		  if (aty[2] == 0) {
  ------------------
  |  Branch (3272:9): [True: 336k, False: 2.16k]
  ------------------
 3273|   336k|		    atBuf2 |= 0x8000;
 3274|   336k|		  }
 3275|   339k|		  if (aty[3] == 0) {
  ------------------
  |  Branch (3275:9): [True: 336k, False: 2.16k]
  ------------------
 3276|   336k|		    atBuf3 |= 0x8000;
 3277|   336k|		  }
 3278|   339k|		}
 3279|   622k|	      }
 3280|       |
 3281|       |	      // update the context
 3282|   622k|	      buf0 <<= 1;
 3283|   622k|	      buf1 <<= 1;
 3284|   622k|	      buf2 <<= 1;
 3285|   622k|	      atBuf0 <<= 1;
 3286|   622k|	      atBuf1 <<= 1;
 3287|   622k|	      atBuf2 <<= 1;
 3288|   622k|	      atBuf3 <<= 1;
 3289|   622k|	    }
 3290|  87.0k|	  }
 3291|       |
 3292|   275k|	} else {
 3293|       |	  // decode the row
 3294|  1.92M|	  for (x0 = 0, x = 0; x0 < w; x0 += 8, ++pp) {
  ------------------
  |  Branch (3294:24): [True: 1.65M, False: 275k]
  ------------------
 3295|  1.65M|	    if (x0 + 8 < w) {
  ------------------
  |  Branch (3295:10): [True: 1.37M, False: 275k]
  ------------------
 3296|  1.37M|	      if (p0) {
  ------------------
  |  Branch (3296:12): [True: 856k, False: 518k]
  ------------------
 3297|   856k|		buf0 |= *p0++;
 3298|   856k|	      }
 3299|  1.37M|	      if (p1) {
  ------------------
  |  Branch (3299:12): [True: 937k, False: 437k]
  ------------------
 3300|   937k|		buf1 |= *p1++;
 3301|   937k|	      }
 3302|  1.37M|	      buf2 |= *p2++;
 3303|  1.37M|	    }
 3304|  1.65M|	    for (x1 = 0, mask = 0x80;
 3305|  13.7M|		 x1 < 8 && x < w;
  ------------------
  |  Branch (3305:4): [True: 12.4M, False: 1.38M]
  |  Branch (3305:14): [True: 12.1M, False: 268k]
  ------------------
 3306|  12.1M|		 ++x1, ++x, mask = (Guchar)(mask >> 1)) {
 3307|       |
 3308|       |	      // build the context
 3309|  12.1M|	      cx0 = (buf0 >> 14) & 0x07;
 3310|  12.1M|	      cx1 = (buf1 >> 13) & 0x1f;
 3311|  12.1M|	      cx2 = (buf2 >> 16) & 0x0f;
 3312|  12.1M|	      cx = (cx0 << 13) | (cx1 << 8) | (cx2 << 4) |
 3313|  12.1M|		   (bitmap->getPixel(x + atx[0], y + aty[0]) << 3) |
 3314|  12.1M|		   (bitmap->getPixel(x + atx[1], y + aty[1]) << 2) |
 3315|  12.1M|		   (bitmap->getPixel(x + atx[2], y + aty[2]) << 1) |
 3316|  12.1M|		   bitmap->getPixel(x + atx[3], y + aty[3]);
 3317|       |
 3318|       |	      // check for a skipped pixel
 3319|  12.1M|	      if (!(useSkip && skip->getPixel(x, y))) {
  ------------------
  |  Branch (3319:14): [True: 0, False: 12.1M]
  |  Branch (3319:25): [True: 0, False: 0]
  ------------------
 3320|       |
 3321|       |		// decode the pixel
 3322|  12.1M|		if ((pix = arithDecoder->decodeBit(cx, genericRegionStats))) {
  ------------------
  |  Branch (3322:7): [True: 5.99M, False: 6.15M]
  ------------------
 3323|  5.99M|		  *pp |= mask;
 3324|  5.99M|		  buf2 |= 0x8000;
 3325|  5.99M|		}
 3326|  12.1M|	      }
 3327|       |
 3328|       |	      // update the context
 3329|  12.1M|	      buf0 <<= 1;
 3330|  12.1M|	      buf1 <<= 1;
 3331|  12.1M|	      buf2 <<= 1;
 3332|  12.1M|	    }
 3333|  1.65M|	  }
 3334|   275k|	}
 3335|   293k|	break;
 3336|       |
 3337|    849|      case 1:
  ------------------
  |  Branch (3337:7): [True: 849, False: 640k]
  ------------------
 3338|       |
 3339|       |	// set up the context
 3340|    849|	p2 = pp = bitmap->getDataPtr() + y * bitmap->getLineSize();
 3341|    849|	buf2 = *p2++ << 8;
 3342|    849|	if (y >= 1) {
  ------------------
  |  Branch (3342:6): [True: 705, False: 144]
  ------------------
 3343|    705|	  p1 = bitmap->getDataPtr() + (y - 1) * bitmap->getLineSize();
 3344|    705|	  buf1 = *p1++ << 8;
 3345|    705|	  if (y >= 2) {
  ------------------
  |  Branch (3345:8): [True: 531, False: 174]
  ------------------
 3346|    531|	    p0 = bitmap->getDataPtr() + (y - 2) * bitmap->getLineSize();
 3347|    531|	    buf0 = *p0++ << 8;
 3348|    531|	  } else {
 3349|    174|	    p0 = NULL;
 3350|    174|	    buf0 = 0;
 3351|    174|	  }
 3352|    705|	} else {
 3353|    144|	  p1 = p0 = NULL;
 3354|    144|	  buf1 = buf0 = 0;
 3355|    144|	}
 3356|       |
 3357|    849|	if (atx[0] >= -8 && atx[0] <= 8) {
  ------------------
  |  Branch (3357:6): [True: 594, False: 255]
  |  Branch (3357:22): [True: 279, False: 315]
  ------------------
 3358|       |	  // set up the adaptive context
 3359|    279|	  if (aty[0] <= 0 && y + aty[0] >= 0) {
  ------------------
  |  Branch (3359:8): [True: 278, False: 1]
  |  Branch (3359:23): [True: 0, False: 278]
  ------------------
 3360|      0|	    atP0 = bitmap->getDataPtr() + (y + aty[0]) * bitmap->getLineSize();
 3361|      0|	    atBuf0 = *atP0++ << 8;
 3362|    279|	  } else {
 3363|    279|	    atP0 = NULL;
 3364|    279|	    atBuf0 = 0;
 3365|    279|	  }
 3366|    279|	  atShift0 = 15 - atx[0];
 3367|       |
 3368|       |	  // decode the row
 3369|  18.3k|	  for (x0 = 0, x = 0; x0 < w; x0 += 8, ++pp) {
  ------------------
  |  Branch (3369:24): [True: 18.0k, False: 279]
  ------------------
 3370|  18.0k|	    if (x0 + 8 < w) {
  ------------------
  |  Branch (3370:10): [True: 17.7k, False: 279]
  ------------------
 3371|  17.7k|	      if (p0) {
  ------------------
  |  Branch (3371:12): [True: 0, False: 17.7k]
  ------------------
 3372|      0|		buf0 |= *p0++;
 3373|      0|	      }
 3374|  17.7k|	      if (p1) {
  ------------------
  |  Branch (3374:12): [True: 8.89k, False: 8.89k]
  ------------------
 3375|  8.89k|		buf1 |= *p1++;
 3376|  8.89k|	      }
 3377|  17.7k|	      buf2 |= *p2++;
 3378|  17.7k|	      if (atP0) {
  ------------------
  |  Branch (3378:12): [True: 0, False: 17.7k]
  ------------------
 3379|      0|		atBuf0 |= *atP0++;
 3380|      0|	      }
 3381|  17.7k|	    }
 3382|  18.0k|	    for (x1 = 0, mask = 0x80;
 3383|   161k|		 x1 < 8 && x < w;
  ------------------
  |  Branch (3383:4): [True: 143k, False: 17.7k]
  |  Branch (3383:14): [True: 143k, False: 279]
  ------------------
 3384|   143k|		 ++x1, ++x, mask = (Guchar)(mask >> 1)) {
 3385|       |
 3386|       |	      // build the context
 3387|   143k|	      cx0 = (buf0 >> 13) & 0x0f;
 3388|   143k|	      cx1 = (buf1 >> 13) & 0x1f;
 3389|   143k|	      cx2 = (buf2 >> 16) & 0x07;
 3390|   143k|	      cx = (cx0 << 9) | (cx1 << 4) | (cx2 << 1) |
 3391|   143k|		   ((atBuf0 >> atShift0) & 1);
 3392|       |
 3393|       |	      // check for a skipped pixel
 3394|   143k|	      if (!(useSkip && skip->getPixel(x, y))) {
  ------------------
  |  Branch (3394:14): [True: 0, False: 143k]
  |  Branch (3394:25): [True: 0, False: 0]
  ------------------
 3395|       |
 3396|       |		// decode the pixel
 3397|   143k|		if ((pix = arithDecoder->decodeBit(cx, genericRegionStats))) {
  ------------------
  |  Branch (3397:7): [True: 75.4k, False: 67.9k]
  ------------------
 3398|  75.4k|		  *pp |= mask;
 3399|  75.4k|		  buf2 |= 0x8000;
 3400|  75.4k|		  if (aty[0] == 0) {
  ------------------
  |  Branch (3400:9): [True: 0, False: 75.4k]
  ------------------
 3401|      0|		    atBuf0 |= 0x8000;
 3402|      0|		  }
 3403|  75.4k|		}
 3404|   143k|	      }
 3405|       |
 3406|       |	      // update the context
 3407|   143k|	      buf0 <<= 1;
 3408|   143k|	      buf1 <<= 1;
 3409|   143k|	      buf2 <<= 1;
 3410|   143k|	      atBuf0 <<= 1;
 3411|   143k|	    }
 3412|  18.0k|	  }
 3413|       |
 3414|    570|	} else {
 3415|       |	  // decode the row
 3416|  30.0k|	  for (x0 = 0, x = 0; x0 < w; x0 += 8, ++pp) {
  ------------------
  |  Branch (3416:24): [True: 29.4k, False: 570]
  ------------------
 3417|  29.4k|	    if (x0 + 8 < w) {
  ------------------
  |  Branch (3417:10): [True: 28.9k, False: 570]
  ------------------
 3418|  28.9k|	      if (p0) {
  ------------------
  |  Branch (3418:12): [True: 26.2k, False: 2.71k]
  ------------------
 3419|  26.2k|		buf0 |= *p0++;
 3420|  26.2k|	      }
 3421|  28.9k|	      if (p1) {
  ------------------
  |  Branch (3421:12): [True: 28.4k, False: 508]
  ------------------
 3422|  28.4k|		buf1 |= *p1++;
 3423|  28.4k|	      }
 3424|  28.9k|	      buf2 |= *p2++;
 3425|  28.9k|	    }
 3426|  29.4k|	    for (x1 = 0, mask = 0x80;
 3427|   263k|		 x1 < 8 && x < w;
  ------------------
  |  Branch (3427:4): [True: 235k, False: 28.9k]
  |  Branch (3427:14): [True: 234k, False: 570]
  ------------------
 3428|   234k|		 ++x1, ++x, mask = (Guchar)(mask >> 1)) {
 3429|       |
 3430|       |	      // build the context
 3431|   234k|	      cx0 = (buf0 >> 13) & 0x0f;
 3432|   234k|	      cx1 = (buf1 >> 13) & 0x1f;
 3433|   234k|	      cx2 = (buf2 >> 16) & 0x07;
 3434|   234k|	      cx = (cx0 << 9) | (cx1 << 4) | (cx2 << 1) |
 3435|   234k|		   bitmap->getPixel(x + atx[0], y + aty[0]);
 3436|       |
 3437|       |	      // check for a skipped pixel
 3438|   234k|	      if (!(useSkip && skip->getPixel(x, y))) {
  ------------------
  |  Branch (3438:14): [True: 0, False: 234k]
  |  Branch (3438:25): [True: 0, False: 0]
  ------------------
 3439|       |
 3440|       |		// decode the pixel
 3441|   234k|		if ((pix = arithDecoder->decodeBit(cx, genericRegionStats))) {
  ------------------
  |  Branch (3441:7): [True: 109k, False: 125k]
  ------------------
 3442|   109k|		  *pp |= mask;
 3443|   109k|		  buf2 |= 0x8000;
 3444|   109k|		}
 3445|   234k|	      }
 3446|       |
 3447|       |	      // update the context
 3448|   234k|	      buf0 <<= 1;
 3449|   234k|	      buf1 <<= 1;
 3450|   234k|	      buf2 <<= 1;
 3451|   234k|	    }
 3452|  29.4k|	  }
 3453|    570|	}
 3454|    849|	break;
 3455|       |
 3456|    559|      case 2:
  ------------------
  |  Branch (3456:7): [True: 559, False: 640k]
  ------------------
 3457|       |
 3458|       |	// set up the context
 3459|    559|	p2 = pp = bitmap->getDataPtr() + y * bitmap->getLineSize();
 3460|    559|	buf2 = *p2++ << 8;
 3461|    559|	if (y >= 1) {
  ------------------
  |  Branch (3461:6): [True: 322, False: 237]
  ------------------
 3462|    322|	  p1 = bitmap->getDataPtr() + (y - 1) * bitmap->getLineSize();
 3463|    322|	  buf1 = *p1++ << 8;
 3464|    322|	  if (y >= 2) {
  ------------------
  |  Branch (3464:8): [True: 229, False: 93]
  ------------------
 3465|    229|	    p0 = bitmap->getDataPtr() + (y - 2) * bitmap->getLineSize();
 3466|    229|	    buf0 = *p0++ << 8;
 3467|    229|	  } else {
 3468|     93|	    p0 = NULL;
 3469|     93|	    buf0 = 0;
 3470|     93|	  }
 3471|    322|	} else {
 3472|    237|	  p1 = p0 = NULL;
 3473|    237|	  buf1 = buf0 = 0;
 3474|    237|	}
 3475|       |
 3476|    559|	if (atx[0] >= -8 && atx[0] <= 8) {
  ------------------
  |  Branch (3476:6): [True: 333, False: 226]
  |  Branch (3476:22): [True: 137, False: 196]
  ------------------
 3477|       |	  // set up the adaptive context
 3478|    137|	  if (aty[0] <= 0 && y + aty[0] >= 0) {
  ------------------
  |  Branch (3478:8): [True: 137, False: 0]
  |  Branch (3478:23): [True: 137, False: 0]
  ------------------
 3479|    137|	    atP0 = bitmap->getDataPtr() + (y + aty[0]) * bitmap->getLineSize();
 3480|    137|	    atBuf0 = *atP0++ << 8;
 3481|    137|	  } else {
 3482|      0|	    atP0 = NULL;
 3483|      0|	    atBuf0 = 0;
 3484|      0|	  }
 3485|    137|	  atShift0 = 15 - atx[0];
 3486|       |
 3487|       |	  // decode the row
 3488|  2.62M|	  for (x0 = 0, x = 0; x0 < w; x0 += 8, ++pp) {
  ------------------
  |  Branch (3488:24): [True: 2.62M, False: 137]
  ------------------
 3489|  2.62M|	    if (x0 + 8 < w) {
  ------------------
  |  Branch (3489:10): [True: 2.62M, False: 137]
  ------------------
 3490|  2.62M|	      if (p0) {
  ------------------
  |  Branch (3490:12): [True: 648, False: 2.62M]
  ------------------
 3491|    648|		buf0 |= *p0++;
 3492|    648|	      }
 3493|  2.62M|	      if (p1) {
  ------------------
  |  Branch (3493:12): [True: 2.62M, False: 60]
  ------------------
 3494|  2.62M|		buf1 |= *p1++;
 3495|  2.62M|	      }
 3496|  2.62M|	      buf2 |= *p2++;
 3497|  2.62M|	      if (atP0) {
  ------------------
  |  Branch (3497:12): [True: 2.62M, False: 0]
  ------------------
 3498|  2.62M|		atBuf0 |= *atP0++;
 3499|  2.62M|	      }
 3500|  2.62M|	    }
 3501|  2.62M|	    for (x1 = 0, mask = 0x80;
 3502|  23.6M|		 x1 < 8 && x < w;
  ------------------
  |  Branch (3502:4): [True: 20.9M, False: 2.62M]
  |  Branch (3502:14): [True: 20.9M, False: 137]
  ------------------
 3503|  20.9M|		 ++x1, ++x, mask = (Guchar)(mask >> 1)) {
 3504|       |
 3505|       |	      // build the context
 3506|  20.9M|	      cx0 = (buf0 >> 14) & 0x07;
 3507|  20.9M|	      cx1 = (buf1 >> 14) & 0x0f;
 3508|  20.9M|	      cx2 = (buf2 >> 16) & 0x03;
 3509|  20.9M|	      cx = (cx0 << 7) | (cx1 << 3) | (cx2 << 1) |
 3510|  20.9M|		   ((atBuf0 >> atShift0) & 1);
 3511|       |
 3512|       |	      // check for a skipped pixel
 3513|  20.9M|	      if (!(useSkip && skip->getPixel(x, y))) {
  ------------------
  |  Branch (3513:14): [True: 0, False: 20.9M]
  |  Branch (3513:25): [True: 0, False: 0]
  ------------------
 3514|       |
 3515|       |		// decode the pixel
 3516|  20.9M|		if ((pix = arithDecoder->decodeBit(cx, genericRegionStats))) {
  ------------------
  |  Branch (3516:7): [True: 10.5M, False: 10.4M]
  ------------------
 3517|  10.5M|		  *pp |= mask;
 3518|  10.5M|		  buf2 |= 0x8000;
 3519|  10.5M|		  if (aty[0] == 0) {
  ------------------
  |  Branch (3519:9): [True: 3.28k, False: 10.5M]
  ------------------
 3520|  3.28k|		    atBuf0 |= 0x8000;
 3521|  3.28k|		  }
 3522|  10.5M|		}
 3523|  20.9M|	      }
 3524|       |
 3525|       |	      // update the context
 3526|  20.9M|	      buf0 <<= 1;
 3527|  20.9M|	      buf1 <<= 1;
 3528|  20.9M|	      buf2 <<= 1;
 3529|  20.9M|	      atBuf0 <<= 1;
 3530|  20.9M|	    }
 3531|  2.62M|	  }
 3532|       |
 3533|    422|	} else {
 3534|       |	  // decode the row
 3535|  3.15k|	  for (x0 = 0, x = 0; x0 < w; x0 += 8, ++pp) {
  ------------------
  |  Branch (3535:24): [True: 2.73k, False: 422]
  ------------------
 3536|  2.73k|	    if (x0 + 8 < w) {
  ------------------
  |  Branch (3536:10): [True: 2.31k, False: 422]
  ------------------
 3537|  2.31k|	      if (p0) {
  ------------------
  |  Branch (3537:12): [True: 121, False: 2.19k]
  ------------------
 3538|    121|		buf0 |= *p0++;
 3539|    121|	      }
 3540|  2.31k|	      if (p1) {
  ------------------
  |  Branch (3540:12): [True: 206, False: 2.10k]
  ------------------
 3541|    206|		buf1 |= *p1++;
 3542|    206|	      }
 3543|  2.31k|	      buf2 |= *p2++;
 3544|  2.31k|	    }
 3545|  2.73k|	    for (x1 = 0, mask = 0x80;
 3546|  22.6k|		 x1 < 8 && x < w;
  ------------------
  |  Branch (3546:4): [True: 20.3k, False: 2.35k]
  |  Branch (3546:14): [True: 19.9k, False: 375]
  ------------------
 3547|  19.9k|		 ++x1, ++x, mask = (Guchar)(mask >> 1)) {
 3548|       |
 3549|       |	      // build the context
 3550|  19.9k|	      cx0 = (buf0 >> 14) & 0x07;
 3551|  19.9k|	      cx1 = (buf1 >> 14) & 0x0f;
 3552|  19.9k|	      cx2 = (buf2 >> 16) & 0x03;
 3553|  19.9k|	      cx = (cx0 << 7) | (cx1 << 3) | (cx2 << 1) |
 3554|  19.9k|		   bitmap->getPixel(x + atx[0], y + aty[0]);
 3555|       |
 3556|       |	      // check for a skipped pixel
 3557|  19.9k|	      if (!(useSkip && skip->getPixel(x, y))) {
  ------------------
  |  Branch (3557:14): [True: 0, False: 19.9k]
  |  Branch (3557:25): [True: 0, False: 0]
  ------------------
 3558|       |
 3559|       |		// decode the pixel
 3560|  19.9k|		if ((pix = arithDecoder->decodeBit(cx, genericRegionStats))) {
  ------------------
  |  Branch (3560:7): [True: 13.8k, False: 6.14k]
  ------------------
 3561|  13.8k|		  *pp |= mask;
 3562|  13.8k|		  buf2 |= 0x8000;
 3563|  13.8k|		}
 3564|  19.9k|	      }
 3565|       |
 3566|       |	      // update the context
 3567|  19.9k|	      buf0 <<= 1;
 3568|  19.9k|	      buf1 <<= 1;
 3569|  19.9k|	      buf2 <<= 1;
 3570|  19.9k|	    }
 3571|  2.73k|	  }
 3572|    422|	}
 3573|    559|	break;
 3574|       |
 3575|   346k|      case 3:
  ------------------
  |  Branch (3575:7): [True: 346k, False: 295k]
  ------------------
 3576|       |
 3577|       |	// set up the context
 3578|   346k|	p2 = pp = bitmap->getDataPtr() + y * bitmap->getLineSize();
 3579|   346k|	buf2 = *p2++ << 8;
 3580|   346k|	if (y >= 1) {
  ------------------
  |  Branch (3580:6): [True: 345k, False: 779]
  ------------------
 3581|   345k|	  p1 = bitmap->getDataPtr() + (y - 1) * bitmap->getLineSize();
 3582|   345k|	  buf1 = *p1++ << 8;
 3583|   345k|	} else {
 3584|    779|	  p1 = NULL;
 3585|    779|	  buf1 = 0;
 3586|    779|	}
 3587|       |
 3588|   346k|	if (atx[0] >= -8 && atx[0] <= 8) {
  ------------------
  |  Branch (3588:6): [True: 4.04k, False: 342k]
  |  Branch (3588:22): [True: 477, False: 3.57k]
  ------------------
 3589|       |	  // set up the adaptive context
 3590|    477|	  if (aty[0] <= 0 && y + aty[0] >= 0) {
  ------------------
  |  Branch (3590:8): [True: 346, False: 131]
  |  Branch (3590:23): [True: 346, False: 0]
  ------------------
 3591|    346|	    atP0 = bitmap->getDataPtr() + (y + aty[0]) * bitmap->getLineSize();
 3592|    346|	    atBuf0 = *atP0++ << 8;
 3593|    346|	  } else {
 3594|    131|	    atP0 = NULL;
 3595|    131|	    atBuf0 = 0;
 3596|    131|	  }
 3597|    477|	  atShift0 = 15 - atx[0];
 3598|       |
 3599|       |	  // decode the row
 3600|  6.64k|	  for (x0 = 0, x = 0; x0 < w; x0 += 8, ++pp) {
  ------------------
  |  Branch (3600:24): [True: 6.17k, False: 477]
  ------------------
 3601|  6.17k|	    if (x0 + 8 < w) {
  ------------------
  |  Branch (3601:10): [True: 5.69k, False: 477]
  ------------------
 3602|  5.69k|	      if (p1) {
  ------------------
  |  Branch (3602:12): [True: 3.90k, False: 1.79k]
  ------------------
 3603|  3.90k|		buf1 |= *p1++;
 3604|  3.90k|	      }
 3605|  5.69k|	      buf2 |= *p2++;
 3606|  5.69k|	      if (atP0) {
  ------------------
  |  Branch (3606:12): [True: 936, False: 4.75k]
  ------------------
 3607|    936|		atBuf0 |= *atP0++;
 3608|    936|	      }
 3609|  5.69k|	    }
 3610|  6.17k|	    for (x1 = 0, mask = 0x80;
 3611|  53.8k|		 x1 < 8 && x < w;
  ------------------
  |  Branch (3611:4): [True: 48.1k, False: 5.73k]
  |  Branch (3611:14): [True: 47.6k, False: 432]
  ------------------
 3612|  47.6k|		 ++x1, ++x, mask = (Guchar)(mask >> 1)) {
 3613|       |
 3614|       |	      // build the context
 3615|  47.6k|	      cx1 = (buf1 >> 14) & 0x1f;
 3616|  47.6k|	      cx2 = (buf2 >> 16) & 0x0f;
 3617|  47.6k|	      cx = (cx1 << 5) | (cx2 << 1) |
 3618|  47.6k|		   ((atBuf0 >> atShift0) & 1);
 3619|       |
 3620|       |	      // check for a skipped pixel
 3621|  47.6k|	      if (!(useSkip && skip->getPixel(x, y))) {
  ------------------
  |  Branch (3621:14): [True: 0, False: 47.6k]
  |  Branch (3621:25): [True: 0, False: 0]
  ------------------
 3622|       |
 3623|       |		// decode the pixel
 3624|  47.6k|		if ((pix = arithDecoder->decodeBit(cx, genericRegionStats))) {
  ------------------
  |  Branch (3624:7): [True: 22.9k, False: 24.7k]
  ------------------
 3625|  22.9k|		  *pp |= mask;
 3626|  22.9k|		  buf2 |= 0x8000;
 3627|  22.9k|		  if (aty[0] == 0) {
  ------------------
  |  Branch (3627:9): [True: 4.46k, False: 18.5k]
  ------------------
 3628|  4.46k|		    atBuf0 |= 0x8000;
 3629|  4.46k|		  }
 3630|  22.9k|		}
 3631|  47.6k|	      }
 3632|       |
 3633|       |	      // update the context
 3634|  47.6k|	      buf1 <<= 1;
 3635|  47.6k|	      buf2 <<= 1;
 3636|  47.6k|	      atBuf0 <<= 1;
 3637|  47.6k|	    }
 3638|  6.17k|	  }
 3639|       |
 3640|   345k|	} else {
 3641|       |	  // decode the row
 3642|  10.6M|	  for (x0 = 0, x = 0; x0 < w; x0 += 8, ++pp) {
  ------------------
  |  Branch (3642:24): [True: 10.3M, False: 345k]
  ------------------
 3643|  10.3M|	    if (x0 + 8 < w) {
  ------------------
  |  Branch (3643:10): [True: 10.0M, False: 345k]
  ------------------
 3644|  10.0M|	      if (p1) {
  ------------------
  |  Branch (3644:12): [True: 9.96M, False: 48.2k]
  ------------------
 3645|  9.96M|		buf1 |= *p1++;
 3646|  9.96M|	      }
 3647|  10.0M|	      buf2 |= *p2++;
 3648|  10.0M|	    }
 3649|  10.3M|	    for (x1 = 0, mask = 0x80;
 3650|  90.7M|		 x1 < 8 && x < w;
  ------------------
  |  Branch (3650:4): [True: 80.7M, False: 10.0M]
  |  Branch (3650:14): [True: 80.4M, False: 345k]
  ------------------
 3651|  80.4M|		 ++x1, ++x, mask = (Guchar)(mask >> 1)) {
 3652|       |
 3653|       |	      // build the context
 3654|  80.4M|	      cx1 = (buf1 >> 14) & 0x1f;
 3655|  80.4M|	      cx2 = (buf2 >> 16) & 0x0f;
 3656|  80.4M|	      cx = (cx1 << 5) | (cx2 << 1) |
 3657|  80.4M|		   bitmap->getPixel(x + atx[0], y + aty[0]);
 3658|       |
 3659|       |	      // check for a skipped pixel
 3660|  80.4M|	      if (!(useSkip && skip->getPixel(x, y))) {
  ------------------
  |  Branch (3660:14): [True: 0, False: 80.4M]
  |  Branch (3660:25): [True: 0, False: 0]
  ------------------
 3661|       |
 3662|       |		// decode the pixel
 3663|  80.4M|		if ((pix = arithDecoder->decodeBit(cx, genericRegionStats))) {
  ------------------
  |  Branch (3663:7): [True: 38.0M, False: 42.4M]
  ------------------
 3664|  38.0M|		  *pp |= mask;
 3665|  38.0M|		  buf2 |= 0x8000;
 3666|  38.0M|		}
 3667|  80.4M|	      }
 3668|       |
 3669|       |	      // update the context
 3670|  80.4M|	      buf1 <<= 1;
 3671|  80.4M|	      buf2 <<= 1;
 3672|  80.4M|	    }
 3673|  10.3M|	  }
 3674|   345k|	}
 3675|   346k|	break;
 3676|   641k|      }
 3677|   641k|    }
 3678|  23.6k|  }
 3679|       |
 3680|  26.8k|  return bitmap;
 3681|  26.8k|}
_ZN11JBIG2Stream30readGenericRefinementRegionSegEjiijPjj:
 3686|  7.26k|						 Guint nRefSegs) {
 3687|  7.26k|  JBIG2Bitmap *bitmap, *refBitmap;
 3688|  7.26k|  Guint w, h, x, y, segInfoFlags, extCombOp;
 3689|  7.26k|  Guint flags, templ, tpgrOn;
 3690|  7.26k|  int atx[2], aty[2];
 3691|  7.26k|  JBIG2Segment *seg;
 3692|       |
 3693|       |  // region segment info field
 3694|  7.26k|  if (!readULong(&w) || !readULong(&h) ||
  ------------------
  |  Branch (3694:7): [True: 548, False: 6.71k]
  |  Branch (3694:25): [True: 741, False: 5.97k]
  ------------------
 3695|  5.97k|      !readULong(&x) || !readULong(&y) ||
  ------------------
  |  Branch (3695:7): [True: 746, False: 5.22k]
  |  Branch (3695:25): [True: 571, False: 4.65k]
  ------------------
 3696|  4.65k|      !readUByte(&segInfoFlags)) {
  ------------------
  |  Branch (3696:7): [True: 225, False: 4.43k]
  ------------------
 3697|  2.83k|    goto eofError;
 3698|  2.83k|  }
 3699|  4.43k|  if (w == 0 || h == 0) {
  ------------------
  |  Branch (3699:7): [True: 264, False: 4.16k]
  |  Branch (3699:17): [True: 261, False: 3.90k]
  ------------------
 3700|    525|    error(errSyntaxError, getPos(),
 3701|    525|	  "Bad size in JBIG2 generic refinement region segment");
 3702|    525|    return;
 3703|    525|  }
 3704|       |  // sanity check: if the w/h/x/y values are way out of range, it likely
 3705|       |  // indicates a damaged JBIG2 stream
 3706|  3.90k|  if (w / 10 > pageW || h / 10 > pageH ||
  ------------------
  |  Branch (3706:7): [True: 313, False: 3.59k]
  |  Branch (3706:25): [True: 194, False: 3.39k]
  ------------------
 3707|  3.39k|      x / 10 > pageW || y / 10 > pageH) {
  ------------------
  |  Branch (3707:7): [True: 155, False: 3.24k]
  |  Branch (3707:25): [True: 45, False: 3.19k]
  ------------------
 3708|    707|    error(errSyntaxError, getPos(),
 3709|    707|	  "Bad size or position in JBIG2 generic refinement region segment");
 3710|    707|    done = gTrue;
  ------------------
  |  |   17|    707|#define gTrue 1
  ------------------
 3711|    707|    return;
 3712|    707|  }
 3713|  3.19k|  extCombOp = segInfoFlags & 7;
 3714|       |
 3715|       |  // rest of the generic refinement region segment header
 3716|  3.19k|  if (!readUByte(&flags)) {
  ------------------
  |  Branch (3716:7): [True: 162, False: 3.03k]
  ------------------
 3717|    162|    goto eofError;
 3718|    162|  }
 3719|  3.03k|  templ = flags & 1;
 3720|  3.03k|  tpgrOn = (flags >> 1) & 1;
 3721|       |
 3722|       |  // AT flags
 3723|  3.03k|  if (!templ) {
  ------------------
  |  Branch (3723:7): [True: 2.37k, False: 660]
  ------------------
 3724|  2.37k|    if (!readByte(&atx[0]) || !readByte(&aty[0]) ||
  ------------------
  |  Branch (3724:9): [True: 375, False: 2.00k]
  |  Branch (3724:31): [True: 308, False: 1.69k]
  ------------------
 3725|  1.69k|	!readByte(&atx[1]) || !readByte(&aty[1])) {
  ------------------
  |  Branch (3725:2): [True: 214, False: 1.47k]
  |  Branch (3725:24): [True: 177, False: 1.30k]
  ------------------
 3726|  1.07k|      goto eofError;
 3727|  1.07k|    }
 3728|  2.37k|  }
 3729|       |
 3730|       |  // resize the page bitmap if needed
 3731|  1.96k|  if (nRefSegs == 0 || imm) {
  ------------------
  |  Branch (3731:7): [True: 864, False: 1.09k]
  |  Branch (3731:24): [True: 529, False: 569]
  ------------------
 3732|  1.39k|    if (pageH == 0xffffffff && y + h > curPageH) {
  ------------------
  |  Branch (3732:9): [True: 762, False: 631]
  |  Branch (3732:32): [True: 525, False: 237]
  ------------------
 3733|    525|      pageBitmap->expand(y + h, pageDefPixel);
 3734|    525|    }
 3735|  1.39k|  }
 3736|       |
 3737|       |  // get referenced bitmap
 3738|  1.96k|  if (nRefSegs > 1) {
  ------------------
  |  Branch (3738:7): [True: 364, False: 1.59k]
  ------------------
 3739|    364|    error(errSyntaxError, getPos(),
 3740|    364|	  "Bad reference in JBIG2 generic refinement segment");
 3741|    364|    return;
 3742|    364|  }
 3743|  1.59k|  if (nRefSegs == 1) {
  ------------------
  |  Branch (3743:7): [True: 734, False: 864]
  ------------------
 3744|    734|    if (!(seg = findSegment(refSegs[0])) ||
  ------------------
  |  Branch (3744:9): [True: 398, False: 336]
  ------------------
 3745|    734|	seg->getType() != jbig2SegBitmap) {
  ------------------
  |  Branch (3745:2): [True: 336, False: 0]
  ------------------
 3746|    734|      error(errSyntaxError, getPos(),
 3747|    734|	    "Bad bitmap reference in JBIG2 generic refinement segment");
 3748|    734|      return;
 3749|    734|    }
 3750|      0|    refBitmap = (JBIG2Bitmap *)seg;
 3751|    864|  } else {
 3752|    864|    refBitmap = pageBitmap->getSlice(x, y, w, h);
 3753|    864|  }
 3754|       |
 3755|       |  // set up the arithmetic decoder
 3756|    864|  resetRefinementStats(templ, NULL);
 3757|    864|  arithDecoder->start();
 3758|       |
 3759|       |  // read
 3760|    864|  bitmap = readGenericRefinementRegion(w, h, templ, tpgrOn,
 3761|    864|				       refBitmap, 0, 0, atx, aty);
 3762|       |
 3763|       |  // combine the region bitmap into the page bitmap
 3764|    864|  if (imm) {
  ------------------
  |  Branch (3764:7): [True: 816, False: 48]
  ------------------
 3765|    816|    pageBitmap->combine(bitmap, x, y, extCombOp);
 3766|    816|    delete bitmap;
 3767|       |
 3768|       |  // store the region bitmap
 3769|    816|  } else {
 3770|     48|    bitmap->setSegNum(segNum);
 3771|     48|    segments->append(bitmap);
 3772|     48|  }
 3773|       |
 3774|       |  // delete the referenced bitmap
 3775|    864|  if (nRefSegs == 1) {
  ------------------
  |  Branch (3775:7): [True: 0, False: 864]
  ------------------
 3776|      0|    discardSegment(refSegs[0]);
 3777|    864|  } else {
 3778|    864|    delete refBitmap;
 3779|    864|  }
 3780|       |
 3781|    864|  return;
 3782|       |
 3783|  4.06k| eofError:
 3784|  4.06k|  error(errSyntaxError, getPos(), "Unexpected EOF in JBIG2 stream");
 3785|  4.06k|}
_ZN11JBIG2Stream27readGenericRefinementRegionEiiiiP11JBIG2BitmapiiPiS2_:
 3791|  3.57k|						      int *atx, int *aty) {
 3792|  3.57k|  JBIG2Bitmap *bitmap;
 3793|  3.57k|  GBool ltp;
 3794|  3.57k|  Guint ltpCX, cx, cx0, cx2, cx3, cx4, tpgrCX0, tpgrCX1, tpgrCX2;
 3795|  3.57k|  JBIG2BitmapPtr cxPtr0, cxPtr1, cxPtr2, cxPtr3, cxPtr4, cxPtr5, cxPtr6;
 3796|  3.57k|  JBIG2BitmapPtr tpgrCXPtr0, tpgrCXPtr1, tpgrCXPtr2;
 3797|  3.57k|  int x, y, pix;
 3798|       |
 3799|  3.57k|  bitmap = new JBIG2Bitmap(0, w, h);
 3800|  3.57k|  bitmap->clearToZero();
 3801|       |
 3802|       |  // set up the typical row context
 3803|  3.57k|  if (templ) {
  ------------------
  |  Branch (3803:7): [True: 269, False: 3.30k]
  ------------------
 3804|    269|    ltpCX = 0x008;
 3805|  3.30k|  } else {
 3806|  3.30k|    ltpCX = 0x0010;
 3807|  3.30k|  }
 3808|       |
 3809|  3.57k|  ltp = 0;
 3810|   310k|  for (y = 0; y < h; ++y) {
  ------------------
  |  Branch (3810:15): [True: 307k, False: 3.57k]
  ------------------
 3811|       |
 3812|   307k|    if (templ) {
  ------------------
  |  Branch (3812:9): [True: 611, False: 306k]
  ------------------
 3813|       |
 3814|       |      // set up the context
 3815|    611|      bitmap->getPixelPtr(0, y-1, &cxPtr0);
 3816|    611|      cx0 = bitmap->nextPixel(&cxPtr0);
 3817|    611|      bitmap->getPixelPtr(-1, y, &cxPtr1);
 3818|    611|      refBitmap->getPixelPtr(-refDX, y-1-refDY, &cxPtr2);
 3819|    611|      refBitmap->getPixelPtr(-1-refDX, y-refDY, &cxPtr3);
 3820|    611|      cx3 = refBitmap->nextPixel(&cxPtr3);
 3821|    611|      cx3 = (cx3 << 1) | refBitmap->nextPixel(&cxPtr3);
 3822|    611|      refBitmap->getPixelPtr(-refDX, y+1-refDY, &cxPtr4);
 3823|    611|      cx4 = refBitmap->nextPixel(&cxPtr4);
 3824|       |
 3825|       |      // set up the typical prediction context
 3826|    611|      tpgrCX0 = tpgrCX1 = tpgrCX2 = 0; // make gcc happy
 3827|    611|      if (tpgrOn) {
  ------------------
  |  Branch (3827:11): [True: 581, False: 30]
  ------------------
 3828|    581|	refBitmap->getPixelPtr(-1-refDX, y-1-refDY, &tpgrCXPtr0);
 3829|    581|	tpgrCX0 = refBitmap->nextPixel(&tpgrCXPtr0);
 3830|    581|	tpgrCX0 = (tpgrCX0 << 1) | refBitmap->nextPixel(&tpgrCXPtr0);
 3831|    581|	tpgrCX0 = (tpgrCX0 << 1) | refBitmap->nextPixel(&tpgrCXPtr0);
 3832|    581|	refBitmap->getPixelPtr(-1-refDX, y-refDY, &tpgrCXPtr1);
 3833|    581|	tpgrCX1 = refBitmap->nextPixel(&tpgrCXPtr1);
 3834|    581|	tpgrCX1 = (tpgrCX1 << 1) | refBitmap->nextPixel(&tpgrCXPtr1);
 3835|    581|	tpgrCX1 = (tpgrCX1 << 1) | refBitmap->nextPixel(&tpgrCXPtr1);
 3836|    581|	refBitmap->getPixelPtr(-1-refDX, y+1-refDY, &tpgrCXPtr2);
 3837|    581|	tpgrCX2 = refBitmap->nextPixel(&tpgrCXPtr2);
 3838|    581|	tpgrCX2 = (tpgrCX2 << 1) | refBitmap->nextPixel(&tpgrCXPtr2);
 3839|    581|	tpgrCX2 = (tpgrCX2 << 1) | refBitmap->nextPixel(&tpgrCXPtr2);
 3840|    581|      } else {
 3841|     30|	tpgrCXPtr0.p = tpgrCXPtr1.p = tpgrCXPtr2.p = NULL; // make gcc happy
 3842|     30|	tpgrCXPtr0.shift = tpgrCXPtr1.shift = tpgrCXPtr2.shift = 0;
 3843|     30|	tpgrCXPtr0.x = tpgrCXPtr1.x = tpgrCXPtr2.x = 0;
 3844|     30|      }
 3845|       |
 3846|   904k|      for (x = 0; x < w; ++x) {
  ------------------
  |  Branch (3846:19): [True: 903k, False: 611]
  ------------------
 3847|       |
 3848|       |	// update the context
 3849|   903k|	cx0 = ((cx0 << 1) | bitmap->nextPixel(&cxPtr0)) & 7;
 3850|   903k|	cx3 = ((cx3 << 1) | refBitmap->nextPixel(&cxPtr3)) & 7;
 3851|   903k|	cx4 = ((cx4 << 1) | refBitmap->nextPixel(&cxPtr4)) & 3;
 3852|       |
 3853|   903k|	if (tpgrOn) {
  ------------------
  |  Branch (3853:6): [True: 903k, False: 435]
  ------------------
 3854|       |	  // update the typical predictor context
 3855|   903k|	  tpgrCX0 = ((tpgrCX0 << 1) | refBitmap->nextPixel(&tpgrCXPtr0)) & 7;
 3856|   903k|	  tpgrCX1 = ((tpgrCX1 << 1) | refBitmap->nextPixel(&tpgrCXPtr1)) & 7;
 3857|   903k|	  tpgrCX2 = ((tpgrCX2 << 1) | refBitmap->nextPixel(&tpgrCXPtr2)) & 7;
 3858|       |
 3859|       |	  // check for a "typical" pixel
 3860|   903k|	  if (arithDecoder->decodeBit(ltpCX, refinementRegionStats)) {
  ------------------
  |  Branch (3860:8): [True: 368k, False: 534k]
  ------------------
 3861|   368k|	    ltp = !ltp;
 3862|   368k|	  }
 3863|   903k|	  if (tpgrCX0 == 0 && tpgrCX1 == 0 && tpgrCX2 == 0) {
  ------------------
  |  Branch (3863:8): [True: 903k, False: 0]
  |  Branch (3863:24): [True: 902k, False: 1.10k]
  |  Branch (3863:40): [True: 900k, False: 1.10k]
  ------------------
 3864|   900k|	    bitmap->clearPixel(x, y);
 3865|   900k|	    continue;
 3866|   900k|	  } else if (tpgrCX0 == 7 && tpgrCX1 == 7 && tpgrCX2 == 7) {
  ------------------
  |  Branch (3866:15): [True: 0, False: 2.20k]
  |  Branch (3866:31): [True: 0, False: 0]
  |  Branch (3866:47): [True: 0, False: 0]
  ------------------
 3867|      0|	    bitmap->setPixel(x, y);
 3868|      0|	    continue;
 3869|      0|	  }
 3870|   903k|	}
 3871|       |
 3872|       |	// build the context
 3873|  2.63k|	cx = (cx0 << 7) | (bitmap->nextPixel(&cxPtr1) << 6) |
 3874|  2.63k|	     (refBitmap->nextPixel(&cxPtr2) << 5) |
 3875|  2.63k|	     (cx3 << 2) | cx4;
 3876|       |
 3877|       |	// decode the pixel
 3878|  2.63k|	if ((pix = arithDecoder->decodeBit(cx, refinementRegionStats))) {
  ------------------
  |  Branch (3878:6): [True: 1.34k, False: 1.29k]
  ------------------
 3879|  1.34k|	  bitmap->setPixel(x, y);
 3880|  1.34k|	}
 3881|  2.63k|      }
 3882|       |
 3883|   306k|    } else {
 3884|       |
 3885|       |      // set up the context
 3886|   306k|      bitmap->getPixelPtr(0, y-1, &cxPtr0);
 3887|   306k|      cx0 = bitmap->nextPixel(&cxPtr0);
 3888|   306k|      bitmap->getPixelPtr(-1, y, &cxPtr1);
 3889|   306k|      refBitmap->getPixelPtr(-refDX, y-1-refDY, &cxPtr2);
 3890|   306k|      cx2 = refBitmap->nextPixel(&cxPtr2);
 3891|   306k|      refBitmap->getPixelPtr(-1-refDX, y-refDY, &cxPtr3);
 3892|   306k|      cx3 = refBitmap->nextPixel(&cxPtr3);
 3893|   306k|      cx3 = (cx3 << 1) | refBitmap->nextPixel(&cxPtr3);
 3894|   306k|      refBitmap->getPixelPtr(-1-refDX, y+1-refDY, &cxPtr4);
 3895|   306k|      cx4 = refBitmap->nextPixel(&cxPtr4);
 3896|   306k|      cx4 = (cx4 << 1) | refBitmap->nextPixel(&cxPtr4);
 3897|   306k|      bitmap->getPixelPtr(atx[0], y+aty[0], &cxPtr5);
 3898|   306k|      refBitmap->getPixelPtr(atx[1]-refDX, y+aty[1]-refDY, &cxPtr6);
 3899|       |
 3900|       |      // set up the typical prediction context
 3901|   306k|      tpgrCX0 = tpgrCX1 = tpgrCX2 = 0; // make gcc happy
 3902|   306k|      if (tpgrOn) {
  ------------------
  |  Branch (3902:11): [True: 203k, False: 103k]
  ------------------
 3903|   203k|	refBitmap->getPixelPtr(-1-refDX, y-1-refDY, &tpgrCXPtr0);
 3904|   203k|	tpgrCX0 = refBitmap->nextPixel(&tpgrCXPtr0);
 3905|   203k|	tpgrCX0 = (tpgrCX0 << 1) | refBitmap->nextPixel(&tpgrCXPtr0);
 3906|   203k|	tpgrCX0 = (tpgrCX0 << 1) | refBitmap->nextPixel(&tpgrCXPtr0);
 3907|   203k|	refBitmap->getPixelPtr(-1-refDX, y-refDY, &tpgrCXPtr1);
 3908|   203k|	tpgrCX1 = refBitmap->nextPixel(&tpgrCXPtr1);
 3909|   203k|	tpgrCX1 = (tpgrCX1 << 1) | refBitmap->nextPixel(&tpgrCXPtr1);
 3910|   203k|	tpgrCX1 = (tpgrCX1 << 1) | refBitmap->nextPixel(&tpgrCXPtr1);
 3911|   203k|	refBitmap->getPixelPtr(-1-refDX, y+1-refDY, &tpgrCXPtr2);
 3912|   203k|	tpgrCX2 = refBitmap->nextPixel(&tpgrCXPtr2);
 3913|   203k|	tpgrCX2 = (tpgrCX2 << 1) | refBitmap->nextPixel(&tpgrCXPtr2);
 3914|   203k|	tpgrCX2 = (tpgrCX2 << 1) | refBitmap->nextPixel(&tpgrCXPtr2);
 3915|   203k|      } else {
 3916|   103k|	tpgrCXPtr0.p = tpgrCXPtr1.p = tpgrCXPtr2.p = NULL; // make gcc happy
 3917|   103k|	tpgrCXPtr0.shift = tpgrCXPtr1.shift = tpgrCXPtr2.shift = 0;
 3918|   103k|	tpgrCXPtr0.x = tpgrCXPtr1.x = tpgrCXPtr2.x = 0;
 3919|   103k|      }
 3920|       |
 3921|  2.91M|      for (x = 0; x < w; ++x) {
  ------------------
  |  Branch (3921:19): [True: 2.61M, False: 306k]
  ------------------
 3922|       |
 3923|       |	// update the context
 3924|  2.61M|	cx0 = ((cx0 << 1) | bitmap->nextPixel(&cxPtr0)) & 3;
 3925|  2.61M|	cx2 = ((cx2 << 1) | refBitmap->nextPixel(&cxPtr2)) & 3;
 3926|  2.61M|	cx3 = ((cx3 << 1) | refBitmap->nextPixel(&cxPtr3)) & 7;
 3927|  2.61M|	cx4 = ((cx4 << 1) | refBitmap->nextPixel(&cxPtr4)) & 7;
 3928|       |
 3929|  2.61M|	if (tpgrOn) {
  ------------------
  |  Branch (3929:6): [True: 1.93M, False: 677k]
  ------------------
 3930|       |	  // update the typical predictor context
 3931|  1.93M|	  tpgrCX0 = ((tpgrCX0 << 1) | refBitmap->nextPixel(&tpgrCXPtr0)) & 7;
 3932|  1.93M|	  tpgrCX1 = ((tpgrCX1 << 1) | refBitmap->nextPixel(&tpgrCXPtr1)) & 7;
 3933|  1.93M|	  tpgrCX2 = ((tpgrCX2 << 1) | refBitmap->nextPixel(&tpgrCXPtr2)) & 7;
 3934|       |
 3935|       |	  // check for a "typical" pixel
 3936|  1.93M|	  if (arithDecoder->decodeBit(ltpCX, refinementRegionStats)) {
  ------------------
  |  Branch (3936:8): [True: 829k, False: 1.10M]
  ------------------
 3937|   829k|	    ltp = !ltp;
 3938|   829k|	  }
 3939|  1.93M|	  if (tpgrCX0 == 0 && tpgrCX1 == 0 && tpgrCX2 == 0) {
  ------------------
  |  Branch (3939:8): [True: 1.12M, False: 806k]
  |  Branch (3939:24): [True: 1.12M, False: 1.97k]
  |  Branch (3939:40): [True: 1.12M, False: 85]
  ------------------
 3940|  1.12M|	    bitmap->clearPixel(x, y);
 3941|  1.12M|	    continue;
 3942|  1.12M|	  } else if (tpgrCX0 == 7 && tpgrCX1 == 7 && tpgrCX2 == 7) {
  ------------------
  |  Branch (3942:15): [True: 201k, False: 607k]
  |  Branch (3942:31): [True: 201k, False: 0]
  |  Branch (3942:47): [True: 201k, False: 519]
  ------------------
 3943|   201k|	    bitmap->setPixel(x, y);
 3944|   201k|	    continue;
 3945|   201k|	  }
 3946|  1.93M|	}
 3947|       |
 3948|       |	// build the context
 3949|  1.28M|	cx = (cx0 << 11) | (bitmap->nextPixel(&cxPtr1) << 10) |
 3950|  1.28M|	     (cx2 << 8) | (cx3 << 5) | (cx4 << 2) |
 3951|  1.28M|	     (bitmap->nextPixel(&cxPtr5) << 1) |
 3952|  1.28M|	     refBitmap->nextPixel(&cxPtr6);
 3953|       |
 3954|       |	// decode the pixel
 3955|  1.28M|	if ((pix = arithDecoder->decodeBit(cx, refinementRegionStats))) {
  ------------------
  |  Branch (3955:6): [True: 511k, False: 773k]
  ------------------
 3956|   511k|	  bitmap->setPixel(x, y);
 3957|   511k|	}
 3958|  1.28M|      }
 3959|   306k|    }
 3960|   307k|  }
 3961|       |
 3962|  3.57k|  return bitmap;
 3963|  3.57k|}
_ZN11JBIG2Stream15readPageInfoSegEj:
 3965|   107k|void JBIG2Stream::readPageInfoSeg(Guint length) {
 3966|   107k|  Guint xRes, yRes, flags, striping;
 3967|       |
 3968|   107k|  if (!readULong(&pageW) || !readULong(&pageH) ||
  ------------------
  |  Branch (3968:7): [True: 962, False: 106k]
  |  Branch (3968:29): [True: 1.08k, False: 105k]
  ------------------
 3969|   105k|      !readULong(&xRes) || !readULong(&yRes) ||
  ------------------
  |  Branch (3969:7): [True: 534, False: 104k]
  |  Branch (3969:28): [True: 664, False: 103k]
  ------------------
 3970|   103k|      !readUByte(&flags) || !readUWord(&striping)) {
  ------------------
  |  Branch (3970:7): [True: 336, False: 103k]
  |  Branch (3970:29): [True: 563, False: 103k]
  ------------------
 3971|  4.14k|    goto eofError;
 3972|  4.14k|  }
 3973|   103k|  if (pageW == 0 || pageH == 0 ||
  ------------------
  |  Branch (3973:7): [True: 190, False: 102k]
  |  Branch (3973:21): [True: 855, False: 101k]
  ------------------
 3974|   101k|      pageW > INT_MAX || pageH > INT_MAX ||
  ------------------
  |  Branch (3974:7): [True: 13.2k, False: 88.7k]
  |  Branch (3974:26): [True: 3.73k, False: 84.9k]
  ------------------
 3975|  84.9k|      pageH > INT_MAX / pageW) {
  ------------------
  |  Branch (3975:7): [True: 30.3k, False: 54.6k]
  ------------------
 3976|  48.3k|    error(errSyntaxError, getPos(), "Bad page size in JBIG2 stream");
 3977|  48.3k|    return;
 3978|  48.3k|  }
 3979|  54.6k|  pageDefPixel = (flags >> 2) & 1;
 3980|  54.6k|  defCombOp = (flags >> 3) & 3;
 3981|       |
 3982|       |  // this will only happen if there are multiple page info segments
 3983|  54.6k|  if (pageBitmap) {
  ------------------
  |  Branch (3983:7): [True: 3.01k, False: 51.6k]
  ------------------
 3984|  3.01k|    delete pageBitmap;
 3985|  3.01k|  }
 3986|       |
 3987|       |  // allocate the page bitmap
 3988|  54.6k|  if (pageH == 0xffffffff) {
  ------------------
  |  Branch (3988:7): [True: 0, False: 54.6k]
  ------------------
 3989|      0|    curPageH = striping & 0x7fff;
 3990|  54.6k|  } else {
 3991|  54.6k|    curPageH = pageH;
 3992|  54.6k|  }
 3993|  54.6k|  pageBitmap = new JBIG2Bitmap(0, pageW, curPageH);
 3994|       |
 3995|       |  // default pixel value
 3996|  54.6k|  if (pageDefPixel) {
  ------------------
  |  Branch (3996:7): [True: 37.1k, False: 17.5k]
  ------------------
 3997|  37.1k|    pageBitmap->clearToOne();
 3998|  37.1k|  } else {
 3999|  17.5k|    pageBitmap->clearToZero();
 4000|  17.5k|  }
 4001|       |
 4002|  54.6k|  return;
 4003|       |
 4004|  4.14k| eofError:
 4005|  4.14k|  error(errSyntaxError, getPos(), "Unexpected EOF in JBIG2 stream");
 4006|  4.14k|}
_ZN11JBIG2Stream18readEndOfStripeSegEj:
 4008|    350|void JBIG2Stream::readEndOfStripeSeg(Guint length) {
 4009|       |  // skip the segment
 4010|    350|  byteCounter += curStr->discardChars(length);
 4011|    350|}
_ZN11JBIG2Stream15readProfilesSegEj:
 4013|    218|void JBIG2Stream::readProfilesSeg(Guint length) {
 4014|       |  // skip the segment
 4015|    218|  byteCounter += curStr->discardChars(length);
 4016|    218|}
_ZN11JBIG2Stream16readCodeTableSegEjj:
 4018|  7.57k|void JBIG2Stream::readCodeTableSeg(Guint segNum, Guint length) {
 4019|  7.57k|  JBIG2HuffmanTable *huffTab;
 4020|  7.57k|  Guint flags, oob, prefixBits, rangeBits;
 4021|  7.57k|  int lowVal, highVal, val;
 4022|  7.57k|  Guint huffTabSize, i;
 4023|       |
 4024|  7.57k|  if (!readUByte(&flags) || !readLong(&lowVal) || !readLong(&highVal)) {
  ------------------
  |  Branch (4024:7): [True: 128, False: 7.45k]
  |  Branch (4024:29): [True: 772, False: 6.67k]
  |  Branch (4024:51): [True: 638, False: 6.04k]
  ------------------
 4025|  1.53k|    goto eofError;
 4026|  1.53k|  }
 4027|  6.04k|  oob = flags & 1;
 4028|  6.04k|  prefixBits = ((flags >> 1) & 7) + 1;
 4029|  6.04k|  rangeBits = ((flags >> 4) & 7) + 1;
 4030|       |
 4031|  6.04k|  huffDecoder->reset();
 4032|  6.04k|  huffTabSize = 8;
 4033|  6.04k|  huffTab = (JBIG2HuffmanTable *)
 4034|  6.04k|                gmallocn(huffTabSize, sizeof(JBIG2HuffmanTable));
 4035|  6.04k|  i = 0;
 4036|  6.04k|  val = lowVal;
 4037|  71.2k|  while (val < highVal) {
  ------------------
  |  Branch (4037:10): [True: 65.2k, False: 6.04k]
  ------------------
 4038|  65.2k|    if (i == huffTabSize) {
  ------------------
  |  Branch (4038:9): [True: 912, False: 64.3k]
  ------------------
 4039|    912|      huffTabSize *= 2;
 4040|    912|      huffTab = (JBIG2HuffmanTable *)
 4041|    912|	            greallocn(huffTab, huffTabSize, sizeof(JBIG2HuffmanTable));
 4042|    912|    }
 4043|  65.2k|    huffTab[i].val = val;
 4044|  65.2k|    huffTab[i].prefixLen = huffDecoder->readBits(prefixBits);
 4045|  65.2k|    huffTab[i].rangeLen = huffDecoder->readBits(rangeBits);
 4046|  65.2k|    val += 1 << huffTab[i].rangeLen;
 4047|  65.2k|    ++i;
 4048|  65.2k|  }
 4049|  6.04k|  if (i + oob + 3 > huffTabSize) {
  ------------------
  |  Branch (4049:7): [True: 280, False: 5.76k]
  ------------------
 4050|    280|    huffTabSize = i + oob + 3;
 4051|    280|    huffTab = (JBIG2HuffmanTable *)
 4052|    280|                  greallocn(huffTab, huffTabSize, sizeof(JBIG2HuffmanTable));
 4053|    280|  }
 4054|  6.04k|  huffTab[i].val = lowVal - 1;
 4055|  6.04k|  huffTab[i].prefixLen = huffDecoder->readBits(prefixBits);
 4056|  6.04k|  huffTab[i].rangeLen = jbig2HuffmanLOW;
  ------------------
  |  |   31|  6.04k|#define jbig2HuffmanLOW 0xfffffffd
  ------------------
 4057|  6.04k|  ++i;
 4058|  6.04k|  huffTab[i].val = highVal;
 4059|  6.04k|  huffTab[i].prefixLen = huffDecoder->readBits(prefixBits);
 4060|  6.04k|  huffTab[i].rangeLen = 32;
 4061|  6.04k|  ++i;
 4062|  6.04k|  if (oob) {
  ------------------
  |  Branch (4062:7): [True: 1.50k, False: 4.53k]
  ------------------
 4063|  1.50k|    huffTab[i].val = 0;
 4064|  1.50k|    huffTab[i].prefixLen = huffDecoder->readBits(prefixBits);
 4065|  1.50k|    huffTab[i].rangeLen = jbig2HuffmanOOB;
  ------------------
  |  |   32|  1.50k|#define jbig2HuffmanOOB 0xfffffffe
  ------------------
 4066|  1.50k|    ++i;
 4067|  1.50k|  }
 4068|  6.04k|  huffTab[i].val = 0;
 4069|  6.04k|  huffTab[i].prefixLen = 0;
 4070|  6.04k|  huffTab[i].rangeLen = jbig2HuffmanEOT;
  ------------------
  |  |   33|  6.04k|#define jbig2HuffmanEOT 0xffffffff
  ------------------
 4071|  6.04k|  huffDecoder->buildTable(huffTab, i);
 4072|       |
 4073|       |  // create and store the new table segment
 4074|  6.04k|  segments->append(new JBIG2CodeTable(segNum, huffTab));
 4075|       |
 4076|  6.04k|  return;
 4077|       |
 4078|  1.53k| eofError:
 4079|  1.53k|  error(errSyntaxError, getPos(), "Unexpected EOF in JBIG2 stream");
 4080|  1.53k|}
_ZN11JBIG2Stream16readExtensionSegEj:
 4082|    625|void JBIG2Stream::readExtensionSeg(Guint length) {
 4083|       |  // skip the segment
 4084|    625|  byteCounter += curStr->discardChars(length);
 4085|    625|}
_ZN11JBIG2Stream11findSegmentEj:
 4087|  2.83M|JBIG2Segment *JBIG2Stream::findSegment(Guint segNum) {
 4088|  2.83M|  JBIG2Segment *seg;
 4089|  2.83M|  int i;
 4090|       |
 4091|  2.84M|  for (i = 0; i < globalSegments->getLength(); ++i) {
  ------------------
  |  Branch (4091:15): [True: 39.7k, False: 2.80M]
  ------------------
 4092|  39.7k|    seg = (JBIG2Segment *)globalSegments->get(i);
 4093|  39.7k|    if (seg->getSegNum() == segNum) {
  ------------------
  |  Branch (4093:9): [True: 26.3k, False: 13.3k]
  ------------------
 4094|  26.3k|      return seg;
 4095|  26.3k|    }
 4096|  39.7k|  }
 4097|  2.81M|  for (i = 0; i < segments->getLength(); ++i) {
  ------------------
  |  Branch (4097:15): [True: 11.9k, False: 2.80M]
  ------------------
 4098|  11.9k|    seg = (JBIG2Segment *)segments->get(i);
 4099|  11.9k|    if (seg->getSegNum() == segNum) {
  ------------------
  |  Branch (4099:9): [True: 4.39k, False: 7.53k]
  ------------------
 4100|  4.39k|      return seg;
 4101|  4.39k|    }
 4102|  11.9k|  }
 4103|  2.80M|  return NULL;
 4104|  2.80M|}
_ZN11JBIG2Stream17resetGenericStatsEjP23JArithmeticDecoderStats:
 4127|  7.59k|				    JArithmeticDecoderStats *prevStats) {
 4128|  7.59k|  int size;
 4129|       |
 4130|  7.59k|  size = contextSize[templ];
 4131|  7.59k|  if (prevStats && prevStats->getContextSize() == size) {
  ------------------
  |  Branch (4131:7): [True: 185, False: 7.41k]
  |  Branch (4131:20): [True: 0, False: 185]
  ------------------
 4132|      0|    if (genericRegionStats->getContextSize() == size) {
  ------------------
  |  Branch (4132:9): [True: 0, False: 0]
  ------------------
 4133|      0|      genericRegionStats->copyFrom(prevStats);
 4134|      0|    } else {
 4135|      0|      delete genericRegionStats;
 4136|      0|      genericRegionStats = prevStats->copy();
 4137|      0|    }
 4138|  7.59k|  } else {
 4139|  7.59k|    if (genericRegionStats->getContextSize() == size) {
  ------------------
  |  Branch (4139:9): [True: 0, False: 7.59k]
  ------------------
 4140|      0|      genericRegionStats->reset();
 4141|  7.59k|    } else {
 4142|  7.59k|      delete genericRegionStats;
 4143|  7.59k|      genericRegionStats = new JArithmeticDecoderStats(1 << size);
 4144|  7.59k|    }
 4145|  7.59k|  }
 4146|  7.59k|}
_ZN11JBIG2Stream20resetRefinementStatsEjP23JArithmeticDecoderStats:
 4149|  4.53k|				       JArithmeticDecoderStats *prevStats) {
 4150|  4.53k|  int size;
 4151|       |
 4152|  4.53k|  size = refContextSize[templ];
 4153|  4.53k|  if (prevStats && prevStats->getContextSize() == size) {
  ------------------
  |  Branch (4153:7): [True: 394, False: 4.13k]
  |  Branch (4153:20): [True: 0, False: 394]
  ------------------
 4154|      0|    if (refinementRegionStats->getContextSize() == size) {
  ------------------
  |  Branch (4154:9): [True: 0, False: 0]
  ------------------
 4155|      0|      refinementRegionStats->copyFrom(prevStats);
 4156|      0|    } else {
 4157|      0|      delete refinementRegionStats;
 4158|      0|      refinementRegionStats = prevStats->copy();
 4159|      0|    }
 4160|  4.53k|  } else {
 4161|  4.53k|    if (refinementRegionStats->getContextSize() == size) {
  ------------------
  |  Branch (4161:9): [True: 0, False: 4.53k]
  ------------------
 4162|      0|      refinementRegionStats->reset();
 4163|  4.53k|    } else {
 4164|  4.53k|      delete refinementRegionStats;
 4165|  4.53k|      refinementRegionStats = new JArithmeticDecoderStats(1 << size);
 4166|  4.53k|    }
 4167|  4.53k|  }
 4168|  4.53k|}
_ZN11JBIG2Stream13resetIntStatsEi:
 4170|  5.88k|void JBIG2Stream::resetIntStats(int symCodeLen) {
 4171|  5.88k|  iadhStats->reset();
 4172|  5.88k|  iadwStats->reset();
 4173|  5.88k|  iaexStats->reset();
 4174|  5.88k|  iaaiStats->reset();
 4175|  5.88k|  iadtStats->reset();
 4176|  5.88k|  iaitStats->reset();
 4177|  5.88k|  iafsStats->reset();
 4178|  5.88k|  iadsStats->reset();
 4179|  5.88k|  iardxStats->reset();
 4180|  5.88k|  iardyStats->reset();
 4181|  5.88k|  iardwStats->reset();
 4182|  5.88k|  iardhStats->reset();
 4183|  5.88k|  iariStats->reset();
 4184|  5.88k|  if (iaidStats->getContextSize() == 1 << (symCodeLen + 1)) {
  ------------------
  |  Branch (4184:7): [True: 3.32k, False: 2.55k]
  ------------------
 4185|  3.32k|    iaidStats->reset();
 4186|  3.32k|  } else {
 4187|  2.55k|    delete iaidStats;
 4188|  2.55k|    iaidStats = new JArithmeticDecoderStats(1 << (symCodeLen + 1));
 4189|  2.55k|  }
 4190|  5.88k|}
_ZN11JBIG2Stream9readUByteEPj:
 4192|   695k|GBool JBIG2Stream::readUByte(Guint *x) {
 4193|   695k|  int c0;
 4194|       |
 4195|   695k|  if ((c0 = curStr->getChar()) == EOF) {
  ------------------
  |  Branch (4195:7): [True: 2.62k, False: 693k]
  ------------------
 4196|  2.62k|    return gFalse;
  ------------------
  |  |   18|  2.62k|#define gFalse 0
  ------------------
 4197|  2.62k|  }
 4198|   693k|  ++byteCounter;
 4199|   693k|  *x = (Guint)c0;
 4200|   693k|  return gTrue;
  ------------------
  |  |   17|   693k|#define gTrue 1
  ------------------
 4201|   695k|}
_ZN11JBIG2Stream8readByteEPi:
 4203|  92.1k|GBool JBIG2Stream::readByte(int *x) {
 4204|  92.1k| int c0;
 4205|       |
 4206|  92.1k|  if ((c0 = curStr->getChar()) == EOF) {
  ------------------
  |  Branch (4206:7): [True: 6.76k, False: 85.3k]
  ------------------
 4207|  6.76k|    return gFalse;
  ------------------
  |  |   18|  6.76k|#define gFalse 0
  ------------------
 4208|  6.76k|  }
 4209|  85.3k|  ++byteCounter;
 4210|  85.3k|  *x = c0;
 4211|  85.3k|  if (c0 & 0x80) {
  ------------------
  |  Branch (4211:7): [True: 17.3k, False: 68.0k]
  ------------------
 4212|  17.3k|    *x |= -1 - 0xff;
 4213|  17.3k|  }
 4214|  85.3k|  return gTrue;
  ------------------
  |  |   17|  85.3k|#define gTrue 1
  ------------------
 4215|  92.1k|}
_ZN11JBIG2Stream9readUWordEPj:
 4217|  7.27M|GBool JBIG2Stream::readUWord(Guint *x) {
 4218|  7.27M|  int c0, c1;
 4219|       |
 4220|  7.27M|  if ((c0 = curStr->getChar()) == EOF ||
  ------------------
  |  Branch (4220:7): [True: 989, False: 7.27M]
  ------------------
 4221|  7.27M|      (c1 = curStr->getChar()) == EOF) {
  ------------------
  |  Branch (4221:7): [True: 1.03k, False: 7.26M]
  ------------------
 4222|  2.02k|    return gFalse;
  ------------------
  |  |   18|  2.02k|#define gFalse 0
  ------------------
 4223|  2.02k|  }
 4224|  7.26M|  byteCounter += 2;
 4225|  7.26M|  *x = (Guint)((c0 << 8) | c1);
 4226|  7.26M|  return gTrue;
  ------------------
  |  |   17|  7.26M|#define gTrue 1
  ------------------
 4227|  7.27M|}
_ZN11JBIG2Stream9readULongEPj:
 4229|  1.29M|GBool JBIG2Stream::readULong(Guint *x) {
 4230|  1.29M|  int c0, c1, c2, c3;
 4231|       |
 4232|  1.29M|  if ((c0 = curStr->getChar()) == EOF ||
  ------------------
  |  Branch (4232:7): [True: 22.4k, False: 1.27M]
  ------------------
 4233|  1.27M|      (c1 = curStr->getChar()) == EOF ||
  ------------------
  |  Branch (4233:7): [True: 5.35k, False: 1.27M]
  ------------------
 4234|  1.27M|      (c2 = curStr->getChar()) == EOF ||
  ------------------
  |  Branch (4234:7): [True: 5.68k, False: 1.26M]
  ------------------
 4235|  1.26M|      (c3 = curStr->getChar()) == EOF) {
  ------------------
  |  Branch (4235:7): [True: 4.70k, False: 1.26M]
  ------------------
 4236|  38.1k|    return gFalse;
  ------------------
  |  |   18|  38.1k|#define gFalse 0
  ------------------
 4237|  38.1k|  }
 4238|  1.26M|  byteCounter += 4;
 4239|  1.26M|  *x = (Guint)((c0 << 24) | (c1 << 16) | (c2 << 8) | c3);
 4240|  1.26M|  return gTrue;
  ------------------
  |  |   17|  1.26M|#define gTrue 1
  ------------------
 4241|  1.29M|}
_ZN11JBIG2Stream8readLongEPi:
 4243|  18.2k|GBool JBIG2Stream::readLong(int *x) {
 4244|  18.2k|  int c0, c1, c2, c3;
 4245|       |
 4246|  18.2k|  if ((c0 = curStr->getChar()) == EOF ||
  ------------------
  |  Branch (4246:7): [True: 572, False: 17.7k]
  ------------------
 4247|  17.7k|      (c1 = curStr->getChar()) == EOF ||
  ------------------
  |  Branch (4247:7): [True: 567, False: 17.1k]
  ------------------
 4248|  17.1k|      (c2 = curStr->getChar()) == EOF ||
  ------------------
  |  Branch (4248:7): [True: 510, False: 16.6k]
  ------------------
 4249|  16.6k|      (c3 = curStr->getChar()) == EOF) {
  ------------------
  |  Branch (4249:7): [True: 513, False: 16.1k]
  ------------------
 4250|  2.16k|    return gFalse;
  ------------------
  |  |   18|  2.16k|#define gFalse 0
  ------------------
 4251|  2.16k|  }
 4252|  16.1k|  byteCounter += 4;
 4253|  16.1k|  *x = ((c0 << 24) | (c1 << 16) | (c2 << 8) | c3);
 4254|  16.1k|  if (c0 & 0x80) {
  ------------------
  |  Branch (4254:7): [True: 2.44k, False: 13.6k]
  ------------------
 4255|  2.44k|    *x |= -1 - (int)0xffffffff;
 4256|  2.44k|  }
 4257|  16.1k|  return gTrue;
  ------------------
  |  |   17|  16.1k|#define gTrue 1
  ------------------
 4258|  18.2k|}
_ZN12JBIG2SegmentC2Ej:
  644|   156k|  JBIG2Segment(Guint segNumA) { segNum = segNumA; }
_ZN12JBIG2SegmentD2Ev:
  645|   156k|  virtual ~JBIG2Segment() {}
_ZN11JBIG2Bitmap8getPixelEii:
  680|   191M|    { return (x < 0 || x >= w || y < 0 || y >= h) ? 0 :
  ------------------
  |  Branch (680:15): [True: 12.4M, False: 179M]
  |  Branch (680:24): [True: 16.2M, False: 163M]
  |  Branch (680:34): [True: 6.20M, False: 156M]
  |  Branch (680:43): [True: 10.5M, False: 146M]
  ------------------
  681|   191M|             (data[y * line + (x >> 3)] >> (7 - (x & 7))) & 1; }
_ZN11JBIG2Bitmap8setPixelEii:
  683|  25.1M|    { data[y * line + (x >> 3)] |= (Guchar)(1 << (7 - (x & 7))); }
_ZN19JBIG2HuffmanDecoder9setStreamEP6Stream:
  295|  84.4k|  void setStream(Stream *strA) { str = strA; }
_ZN15JBIG2MMRDecoder9setStreamEP6Stream:
  450|  84.4k|  void setStream(Stream *strA) { str = strA; }
_ZN11JBIG2Bitmap10getDataPtrEv:
  690|  1.61M|  Guchar *getDataPtr() { return data; }
_ZN11JBIG2Bitmap11getDataSizeEv:
  691|  51.6k|  int getDataSize() { return h * line; }
_ZN19JBIG2HuffmanDecoder16resetByteCounterEv:
  308|   183k|  void resetByteCounter() { byteCounter = 0; }
_ZN15JBIG2MMRDecoder16resetByteCounterEv:
  456|   183k|  void resetByteCounter() { byteCounter = 0; }
_ZN19JBIG2HuffmanDecoder14getByteCounterEv:
  309|   167k|  Guint getByteCounter() { return byteCounter; }
_ZN15JBIG2MMRDecoder14getByteCounterEv:
  457|   167k|  Guint getByteCounter() { return byteCounter; }
_ZN15JBIG2SymbolDict7getSizeEv:
 1025|  6.34k|  Guint getSize() { return size; }
_ZN14JBIG2CodeTable12getHuffTableEv:
 1122|  5.92k|  JBIG2HuffmanTable *getHuffTable() { return table; }
_ZN15JBIG2SymbolDict21getGenericRegionStatsEv:
 1033|    185|    { return genericRegionStats; }
_ZN15JBIG2SymbolDict24getRefinementRegionStatsEv:
 1035|    401|    { return refinementRegionStats; }
_ZN15JBIG2SymbolDict9setBitmapEjP11JBIG2Bitmap:
 1026|  1.52k|  void setBitmap(Guint idx, JBIG2Bitmap *bitmap) { bitmaps[idx] = bitmap; }
_ZN11JBIG2Bitmap4copyEv:
  671|  1.52k|  JBIG2Bitmap *copy() { return new JBIG2Bitmap(0, this); }
_ZN15JBIG2SymbolDict21setGenericRegionStatsEP23JArithmeticDecoderStats:
 1029|  1.83k|    { genericRegionStats = stats; }
_ZN15JBIG2SymbolDict24setRefinementRegionStatsEP23JArithmeticDecoderStats:
 1031|  1.35k|    { refinementRegionStats = stats; }
_ZN12JBIG2Segment9setSegNumEj:
  646|    797|  void setSegNum(Guint segNumA) { segNum = segNumA; }
_ZN11JBIG2Bitmap8getWidthEv:
  676|  35.2k|  int getWidth() { return w; }
_ZN11JBIG2Bitmap9getHeightEv:
  677|  34.9k|  int getHeight() { return h; }
_ZN16JBIG2PatternDict9setBitmapEjP11JBIG2Bitmap:
 1087|  3.42k|  void setBitmap(Guint idx, JBIG2Bitmap *bitmap) { bitmaps[idx] = bitmap; }
_ZN11JBIG2Stream12mmrAddPixelsEiiPiS0_i:
 2869|   697k|				      int *codingLine, int *a0i, int w) {
 2870|   697k|  if (a1 > codingLine[*a0i]) {
  ------------------
  |  Branch (2870:7): [True: 696k, False: 959]
  ------------------
 2871|   696k|    if (a1 > w) {
  ------------------
  |  Branch (2871:9): [True: 29.1k, False: 667k]
  ------------------
 2872|  29.1k|      error(errSyntaxError, getPos(),
 2873|  29.1k|            "JBIG2 MMR row is wrong length ({0:d})", a1);
 2874|  29.1k|      a1 = w;
 2875|  29.1k|    }
 2876|   696k|    if ((*a0i & 1) ^ blackPixels) {
  ------------------
  |  Branch (2876:9): [True: 293k, False: 403k]
  ------------------
 2877|   293k|      ++*a0i;
 2878|   293k|    }
 2879|   696k|    codingLine[*a0i] = a1;
 2880|   696k|  }
 2881|   697k|}
_ZN11JBIG2Stream15mmrAddPixelsNegEiiPiS0_i:
 2884|  70.3k|					 int *codingLine, int *a0i, int w) {
 2885|  70.3k|  if (a1 > codingLine[*a0i]) {
  ------------------
  |  Branch (2885:7): [True: 53.3k, False: 16.9k]
  ------------------
 2886|  53.3k|    if (a1 > w) {
  ------------------
  |  Branch (2886:9): [True: 0, False: 53.3k]
  ------------------
 2887|      0|      error(errSyntaxError, getPos(),
 2888|      0|            "JBIG2 MMR row is wrong length ({0:d})", a1);
 2889|      0|      a1 = w;
 2890|      0|    }
 2891|  53.3k|    if ((*a0i & 1) ^ blackPixels) {
  ------------------
  |  Branch (2891:9): [True: 41.5k, False: 11.7k]
  ------------------
 2892|  41.5k|      ++*a0i;
 2893|  41.5k|    }
 2894|  53.3k|    codingLine[*a0i] = a1;
 2895|  53.3k|  } else if (a1 < codingLine[*a0i]) {
  ------------------
  |  Branch (2895:14): [True: 10.7k, False: 6.20k]
  ------------------
 2896|  10.7k|    if (a1 < 0) {
  ------------------
  |  Branch (2896:9): [True: 897, False: 9.88k]
  ------------------
 2897|    897|      error(errSyntaxError, getPos(), "Invalid JBIG2 MMR code");
 2898|    897|      a1 = 0;
 2899|    897|    }
 2900|  13.6k|    while (*a0i > 0 && a1 <= codingLine[*a0i - 1]) {
  ------------------
  |  Branch (2900:12): [True: 7.09k, False: 6.55k]
  |  Branch (2900:24): [True: 2.86k, False: 4.23k]
  ------------------
 2901|  2.86k|      --*a0i;
 2902|  2.86k|    }
 2903|  10.7k|    codingLine[*a0i] = a1;
 2904|  10.7k|  }
 2905|  70.3k|}
_ZN11JBIG2Bitmap11getLineSizeEv:
  678|  1.55M|  int getLineSize() { return line; }
_ZN11JBIG2Bitmap11getPixelPtrEiiP14JBIG2BitmapPtr:
  778|  2.76M|inline void JBIG2Bitmap::getPixelPtr(int x, int y, JBIG2BitmapPtr *ptr) {
  779|  2.76M|  if (y < 0 || y >= h || x >= w) {
  ------------------
  |  Branch (779:7): [True: 37.1k, False: 2.72M]
  |  Branch (779:16): [True: 106k, False: 2.61M]
  |  Branch (779:26): [True: 202k, False: 2.41M]
  ------------------
  780|   345k|    ptr->p = NULL;
  781|   345k|    ptr->shift = 0; // make gcc happy
  782|   345k|    ptr->x = 0; // make gcc happy
  783|  2.41M|  } else if (x < 0) {
  ------------------
  |  Branch (783:14): [True: 1.67M, False: 739k]
  ------------------
  784|  1.67M|    ptr->p = &data[y * line];
  785|  1.67M|    ptr->shift = 7;
  786|  1.67M|    ptr->x = x;
  787|  1.67M|  } else {
  788|   739k|    ptr->p = &data[y * line + (x >> 3)];
  789|   739k|    ptr->shift = 7 - (x & 7);
  790|   739k|    ptr->x = x;
  791|   739k|  }
  792|  2.76M|}
_ZN11JBIG2Bitmap9nextPixelEP14JBIG2BitmapPtr:
  794|  29.1M|inline int JBIG2Bitmap::nextPixel(JBIG2BitmapPtr *ptr) {
  795|  29.1M|  int pix;
  796|       |
  797|  29.1M|  if (!ptr->p) {
  ------------------
  |  Branch (797:7): [True: 8.68M, False: 20.5M]
  ------------------
  798|  8.68M|    pix = 0;
  799|  20.5M|  } else if (ptr->x < 0) {
  ------------------
  |  Branch (799:14): [True: 1.70M, False: 18.8M]
  ------------------
  800|  1.70M|    ++ptr->x;
  801|  1.70M|    pix = 0;
  802|  18.8M|  } else {
  803|  18.8M|    pix = (*ptr->p >> ptr->shift) & 1;
  804|  18.8M|    if (++ptr->x == w) {
  ------------------
  |  Branch (804:9): [True: 1.91M, False: 16.8M]
  ------------------
  805|  1.91M|      ptr->p = NULL;
  806|  16.8M|    } else if (ptr->shift == 0) {
  ------------------
  |  Branch (806:16): [True: 1.40M, False: 15.4M]
  ------------------
  807|  1.40M|      ++ptr->p;
  808|  1.40M|      ptr->shift = 7;
  809|  15.4M|    } else {
  810|  15.4M|      --ptr->shift;
  811|  15.4M|    }
  812|  18.8M|  }
  813|  29.1M|  return pix;
  814|  29.1M|}
_ZN11JBIG2Bitmap10clearPixelEii:
  685|  2.02M|    { data[y * line + (x >> 3)] &= (Guchar)(0x7f7f >> (x & 7)); }
_ZN12JBIG2Segment9getSegNumEv:
  647|  51.6k|  Guint getSegNum() { return segNum; }
_ZN15JBIG2SymbolDict7getTypeEv:
 1024|  6.45k|  virtual JBIG2SegmentType getType() { return jbig2SegSymbolDict; }
_ZN16JBIG2PatternDict7getTypeEv:
 1085|  2.70k|  virtual JBIG2SegmentType getType() { return jbig2SegPatternDict; }
_ZN14JBIG2CodeTable7getTypeEv:
 1121|  34.3k|  virtual JBIG2SegmentType getType() { return jbig2SegCodeTable; }

_ZN9JPXStreamC2EP6Stream:
  225|   261k|  FilterStream(strA)
  226|   261k|{
  227|   261k|  bufStr = new BufStream(str, 3);
  228|       |
  229|   261k|  decoded = gFalse;
  ------------------
  |  |   18|   261k|#define gFalse 0
  ------------------
  230|   261k|  nComps = 0;
  231|   261k|  bpc = NULL;
  232|   261k|  width = height = 0;
  233|   261k|  reduction = 0;
  234|   261k|  haveCS = gFalse;
  ------------------
  |  |   18|   261k|#define gFalse 0
  ------------------
  235|       |
  236|   261k|  palette.bpc = NULL;
  237|   261k|  palette.c = NULL;
  238|   261k|  havePalette = gFalse;
  ------------------
  |  |   18|   261k|#define gFalse 0
  ------------------
  239|       |
  240|   261k|  compMap.comp = NULL;
  241|   261k|  compMap.type = NULL;
  242|   261k|  compMap.pComp = NULL;
  243|   261k|  haveCompMap = gFalse;
  ------------------
  |  |   18|   261k|#define gFalse 0
  ------------------
  244|       |
  245|   261k|  channelDefn.idx = NULL;
  246|   261k|  channelDefn.type = NULL;
  247|   261k|  channelDefn.assoc = NULL;
  248|   261k|  haveChannelDefn = gFalse;
  ------------------
  |  |   18|   261k|#define gFalse 0
  ------------------
  249|       |
  250|   261k|  img.tiles = NULL;
  251|       |
  252|   261k|  bitBuf = 0;
  253|   261k|  bitBufLen = 0;
  254|   261k|  bitBufSkip = gFalse;
  ------------------
  |  |   18|   261k|#define gFalse 0
  ------------------
  255|   261k|  byteCount = 0;
  256|   261k|}
_ZN9JPXStreamD2Ev:
  258|   260k|JPXStream::~JPXStream() {
  259|   260k|  close();
  260|   260k|  delete bufStr;
  261|   260k|}
_ZN9JPXStream4copyEv:
  263|   259k|Stream *JPXStream::copy() {
  264|   259k|  return new JPXStream(str->copy());
  265|   259k|}
_ZN9JPXStream5resetEv:
  267|  86.1k|void JPXStream::reset() {
  268|  86.1k|  img.ySize = 0;
  269|  86.1k|  bufStr->reset();
  270|  86.1k|  decoded = gFalse;
  ------------------
  |  |   18|  86.1k|#define gFalse 0
  ------------------
  271|  86.1k|}
_ZN9JPXStream5closeEv:
  273|   346k|void JPXStream::close() {
  274|   346k|  JPXTile *tile;
  275|   346k|  JPXTileComp *tileComp;
  276|   346k|  JPXResLevel *resLevel;
  277|   346k|  JPXPrecinct *precinct;
  278|   346k|  JPXSubband *subband;
  279|   346k|  JPXCodeBlock *cb;
  280|   346k|  Guint comp, i, k, r, pre, sb;
  281|       |
  282|   346k|  gfree(bpc);
  283|   346k|  bpc = NULL;
  284|   346k|  if (havePalette) {
  ------------------
  |  Branch (284:7): [True: 551, False: 346k]
  ------------------
  285|    551|    gfree(palette.bpc);
  286|    551|    gfree(palette.c);
  287|    551|    havePalette = gFalse;
  ------------------
  |  |   18|    551|#define gFalse 0
  ------------------
  288|    551|  }
  289|   346k|  if (haveCompMap) {
  ------------------
  |  Branch (289:7): [True: 1.05k, False: 345k]
  ------------------
  290|  1.05k|    gfree(compMap.comp);
  291|  1.05k|    gfree(compMap.type);
  292|  1.05k|    gfree(compMap.pComp);
  293|  1.05k|    haveCompMap = gFalse;
  ------------------
  |  |   18|  1.05k|#define gFalse 0
  ------------------
  294|  1.05k|  }
  295|   346k|  if (haveChannelDefn) {
  ------------------
  |  Branch (295:7): [True: 1.42k, False: 345k]
  ------------------
  296|  1.42k|    gfree(channelDefn.idx);
  297|  1.42k|    gfree(channelDefn.type);
  298|  1.42k|    gfree(channelDefn.assoc);
  299|  1.42k|    haveChannelDefn = gFalse;
  ------------------
  |  |   18|  1.42k|#define gFalse 0
  ------------------
  300|  1.42k|  }
  301|       |
  302|   346k|  if (img.tiles) {
  ------------------
  |  Branch (302:7): [True: 40.3k, False: 306k]
  ------------------
  303|   407k|    for (i = 0; i < img.nXTiles * img.nYTiles; ++i) {
  ------------------
  |  Branch (303:17): [True: 366k, False: 40.3k]
  ------------------
  304|   366k|      tile = &img.tiles[i];
  305|   366k|      if (tile->tileComps) {
  ------------------
  |  Branch (305:11): [True: 366k, False: 0]
  ------------------
  306|  3.16M|	for (comp = 0; comp < img.nComps; ++comp) {
  ------------------
  |  Branch (306:17): [True: 2.79M, False: 366k]
  ------------------
  307|  2.79M|	  tileComp = &tile->tileComps[comp];
  308|  2.79M|	  gfree(tileComp->quantSteps);
  309|  2.79M|	  gfree(tileComp->data);
  310|  2.79M|	  gfree(tileComp->buf);
  311|  2.79M|	  if (tileComp->resLevels) {
  ------------------
  |  Branch (311:8): [True: 2.37M, False: 420k]
  ------------------
  312|  10.3M|	    for (r = 0; r <= tileComp->nDecompLevels; ++r) {
  ------------------
  |  Branch (312:18): [True: 8.01M, False: 2.37M]
  ------------------
  313|  8.01M|	      resLevel = &tileComp->resLevels[r];
  314|  8.01M|	      if (resLevel->precincts) {
  ------------------
  |  Branch (314:12): [True: 348k, False: 7.66M]
  ------------------
  315|   844k|		for (pre = 0; pre < resLevel->nPrecincts; ++pre) {
  ------------------
  |  Branch (315:17): [True: 496k, False: 348k]
  ------------------
  316|   496k|		  precinct = &resLevel->precincts[pre];
  317|   496k|		  if (precinct->subbands) {
  ------------------
  |  Branch (317:9): [True: 496k, False: 0]
  ------------------
  318|  1.82M|		    for (sb = 0; sb < (Guint)(r == 0 ? 1 : 3); ++sb) {
  ------------------
  |  Branch (318:20): [True: 1.33M, False: 496k]
  |  Branch (318:33): [True: 159k, False: 1.66M]
  ------------------
  319|  1.33M|		      subband = &precinct->subbands[sb];
  320|  1.33M|		      gfree(subband->inclusion);
  321|  1.33M|		      gfree(subband->zeroBitPlane);
  322|  1.33M|		      if (subband->cbs) {
  ------------------
  |  Branch (322:13): [True: 993k, False: 337k]
  ------------------
  323|  6.25M|			for (k = 0; k < subband->nXCBs * subband->nYCBs; ++k) {
  ------------------
  |  Branch (323:16): [True: 5.25M, False: 993k]
  ------------------
  324|  5.25M|			  cb = &subband->cbs[k];
  325|  5.25M|			  gfree(cb->dataLen);
  326|  5.25M|			  gfree(cb->touched);
  327|  5.25M|			  if (cb->arithDecoder) {
  ------------------
  |  Branch (327:10): [True: 344k, False: 4.91M]
  ------------------
  328|   344k|			    delete cb->arithDecoder;
  329|   344k|			  }
  330|  5.25M|			  if (cb->stats) {
  ------------------
  |  Branch (330:10): [True: 344k, False: 4.91M]
  ------------------
  331|   344k|			    delete cb->stats;
  332|   344k|			  }
  333|  5.25M|			}
  334|   993k|			gfree(subband->cbs);
  335|   993k|		      }
  336|  1.33M|		    }
  337|   496k|		    gfree(precinct->subbands);
  338|   496k|		  }
  339|   496k|		}
  340|   348k|		gfree(resLevel->precincts);
  341|   348k|	      }
  342|  8.01M|	    }
  343|  2.37M|	    gfree(tileComp->resLevels);
  344|  2.37M|	  }
  345|  2.79M|	}
  346|   366k|	gfree(tile->tileComps);
  347|   366k|      }
  348|   366k|    }
  349|  40.3k|    gfree(img.tiles);
  350|       |    img.tiles = NULL;
  351|  40.3k|  }
  352|   346k|  bufStr->close();
  353|   346k|}
_ZN9JPXStream11decodeImageEv:
  355|  86.0k|void JPXStream::decodeImage() {
  356|  86.0k|  if (readBoxes() == jpxDecodeFatalError) {
  ------------------
  |  Branch (356:7): [True: 75.7k, False: 10.3k]
  ------------------
  357|       |    // readBoxes reported an error, so we go immediately to EOF
  358|  75.7k|    curY = img.ySize >> reduction;
  359|  75.7k|  } else {
  360|  10.3k|    curY = img.yOffsetR;
  361|  10.3k|  }
  362|  86.0k|  curX = img.xOffsetR;
  363|  86.0k|  curComp = 0;
  364|  86.0k|  readBufLen = 0;
  365|  86.0k|  decoded = gTrue;
  ------------------
  |  |   17|  86.0k|#define gTrue 1
  ------------------
  366|  86.0k|}
_ZN9JPXStream7getCharEv:
  368|  56.3M|int JPXStream::getChar() {
  369|  56.3M|  int c;
  370|       |
  371|  56.3M|  if (!decoded) {
  ------------------
  |  Branch (371:7): [True: 86.0k, False: 56.2M]
  ------------------
  372|  86.0k|    decodeImage();
  373|  86.0k|  }
  374|  56.3M|  if (readBufLen < 8) {
  ------------------
  |  Branch (374:7): [True: 7.22M, False: 49.0M]
  ------------------
  375|  7.22M|    fillReadBuf();
  376|  7.22M|  }
  377|  56.3M|  if (readBufLen == 8) {
  ------------------
  |  Branch (377:7): [True: 1.85M, False: 54.4M]
  ------------------
  378|  1.85M|    c = readBuf & 0xff;
  379|  1.85M|    readBufLen = 0;
  380|  54.4M|  } else if (readBufLen > 8) {
  ------------------
  |  Branch (380:14): [True: 54.3M, False: 80.3k]
  ------------------
  381|  54.3M|    c = (readBuf >> (readBufLen - 8)) & 0xff;
  382|  54.3M|    readBufLen -= 8;
  383|  54.3M|  } else if (readBufLen == 0) {
  ------------------
  |  Branch (383:14): [True: 80.3k, False: 1]
  ------------------
  384|  80.3k|    c = EOF;
  385|  80.3k|  } else {
  386|      1|    c = (readBuf << (8 - readBufLen)) & 0xff;
  387|      1|    readBufLen = 0;
  388|      1|  }
  389|  56.3M|  return c;
  390|  56.3M|}
_ZN9JPXStream8lookCharEv:
  392|  3.35M|int JPXStream::lookChar() {
  393|  3.35M|  int c;
  394|       |
  395|  3.35M|  if (!decoded) {
  ------------------
  |  Branch (395:7): [True: 0, False: 3.35M]
  ------------------
  396|      0|    decodeImage();
  397|      0|  }
  398|  3.35M|  if (readBufLen < 8) {
  ------------------
  |  Branch (398:7): [True: 1.45M, False: 1.90M]
  ------------------
  399|  1.45M|    fillReadBuf();
  400|  1.45M|  }
  401|  3.35M|  if (readBufLen == 8) {
  ------------------
  |  Branch (401:7): [True: 826k, False: 2.52M]
  ------------------
  402|   826k|    c = readBuf & 0xff;
  403|  2.52M|  } else if (readBufLen > 8) {
  ------------------
  |  Branch (403:14): [True: 2.52M, False: 458]
  ------------------
  404|  2.52M|    c = (readBuf >> (readBufLen - 8)) & 0xff;
  405|  2.52M|  } else if (readBufLen == 0) {
  ------------------
  |  Branch (405:14): [True: 458, False: 0]
  ------------------
  406|    458|    c = EOF;
  407|    458|  } else {
  408|      0|    c = (readBuf << (8 - readBufLen)) & 0xff;
  409|      0|  }
  410|  3.35M|  return c;
  411|  3.35M|}
_ZN9JPXStream11fillReadBufEv:
  413|  8.68M|void JPXStream::fillReadBuf() {
  414|  8.68M|  JPXTileComp *tileComp;
  415|  8.68M|  Guint tileIdx, tx, ty;
  416|  8.68M|  int pix, pixBits, k;
  417|  8.68M|  GBool eol;
  418|       |
  419|  9.39M|  do {
  420|  9.39M|    if (curY >= (img.ySize >> reduction)) {
  ------------------
  |  Branch (420:9): [True: 80.8k, False: 9.31M]
  ------------------
  421|  80.8k|      return;
  422|  80.8k|    }
  423|  9.31M|    tileIdx = (((curY << reduction) - img.yTileOffset) / img.yTileSize)
  424|  9.31M|                * img.nXTiles
  425|  9.31M|              + ((curX << reduction) - img.xTileOffset) / img.xTileSize;
  426|  9.31M|#if 1 //~ ignore the palette, assume the PDF ColorSpace object is valid
  427|  9.31M|    tileComp = &img.tiles[tileIdx].tileComps[curComp];
  428|       |#else
  429|       |    tileComp = &img.tiles[tileIdx].tileComps[havePalette ? 0 : curComp];
  430|       |#endif
  431|  9.31M|    tx = jpxFloorDiv(curX, tileComp->hSep);
  ------------------
  |  |  158|  9.31M|#define jpxFloorDiv(x, y) ((x) / (y))
  ------------------
  432|  9.31M|    if (tx < tileComp->x0r) {
  ------------------
  |  Branch (432:9): [True: 2.00M, False: 7.31M]
  ------------------
  433|  2.00M|      tx = 0;
  434|  7.31M|    } else {
  435|  7.31M|      tx -= tileComp->x0r;
  436|  7.31M|    }
  437|  9.31M|    ty = jpxFloorDiv(curY, tileComp->vSep);
  ------------------
  |  |  158|  9.31M|#define jpxFloorDiv(x, y) ((x) / (y))
  ------------------
  438|  9.31M|    if (ty < tileComp->y0r) {
  ------------------
  |  Branch (438:9): [True: 3.28M, False: 6.02M]
  ------------------
  439|  3.28M|      ty  = 0;
  440|  6.02M|    } else {
  441|  6.02M|      ty -= tileComp->y0r;
  442|  6.02M|    }
  443|  9.31M|    pix = (int)tileComp->data[ty * tileComp->w + tx];
  444|  9.31M|    pixBits = tileComp->prec;
  445|  9.31M|    eol = gFalse;
  ------------------
  |  |   18|  9.31M|#define gFalse 0
  ------------------
  446|  9.31M|#if 1 //~ ignore the palette, assume the PDF ColorSpace object is valid
  447|  9.31M|    if (++curComp == img.nComps) {
  ------------------
  |  Branch (447:9): [True: 2.25M, False: 7.06M]
  ------------------
  448|       |#else
  449|       |    if (havePalette) {
  450|       |      if (pix >= 0 && pix < palette.nEntries) {
  451|       |	pix = palette.c[pix * palette.nComps + curComp];
  452|       |      } else {
  453|       |	pix = 0;
  454|       |      }
  455|       |      pixBits = palette.bpc[curComp];
  456|       |    }
  457|       |    if (++curComp == (Guint)(havePalette ? palette.nComps : img.nComps)) {
  458|       |#endif
  459|  2.25M|      curComp = 0;
  460|  2.25M|      if (++curX == (img.xSize >> reduction)) {
  ------------------
  |  Branch (460:11): [True: 5.79k, False: 2.25M]
  ------------------
  461|  5.79k|	curX = img.xOffsetR;
  462|  5.79k|	++curY;
  463|  5.79k|	eol = gTrue;
  ------------------
  |  |   17|  5.79k|#define gTrue 1
  ------------------
  464|  5.79k|      }
  465|  2.25M|    }
  466|  9.31M|    if (pixBits == 8) {
  ------------------
  |  Branch (466:9): [True: 1.38M, False: 7.92M]
  ------------------
  467|  1.38M|      readBuf = (readBuf << 8) | (pix & 0xff);
  468|  7.92M|    } else {
  469|  7.92M|      readBuf = (readBuf << pixBits) | (pix & ((1 << pixBits) - 1));
  470|  7.92M|    }
  471|  9.31M|    readBufLen += pixBits;
  472|  9.31M|    if (eol && (k = readBufLen & 7)) {
  ------------------
  |  Branch (472:9): [True: 5.79k, False: 9.31M]
  |  Branch (472:16): [True: 3.90k, False: 1.88k]
  ------------------
  473|  3.90k|      readBuf <<= 8 - k;
  474|  3.90k|      readBufLen += 8 - k;
  475|  3.90k|    }
  476|  9.31M|  } while (readBufLen < 8);
  ------------------
  |  Branch (476:12): [True: 718k, False: 8.59M]
  ------------------
  477|  8.68M|}
_ZN9JPXStream9readBoxesEv:
  607|  86.0k|JPXDecodeResult JPXStream::readBoxes() {
  608|  86.0k|  JPXDecodeResult result;
  609|  86.0k|  GBool haveCodestream;
  610|  86.0k|  Guint boxType, boxLen, dataLen;
  611|  86.0k|  Guint w, h, n, bpc1, compression, unknownColorspace, ipr;
  612|  86.0k|  Guint i, j;
  613|       |
  614|  86.0k|  haveImgHdr = gFalse;
  ------------------
  |  |   18|  86.0k|#define gFalse 0
  ------------------
  615|  86.0k|  haveCodestream = gFalse;
  ------------------
  |  |   18|  86.0k|#define gFalse 0
  ------------------
  616|       |
  617|       |  // check for a naked JPEG 2000 codestream (without the JP2/JPX
  618|       |  // wrapper) -- this appears to be a violation of the PDF spec, but
  619|       |  // Acrobat allows it
  620|  86.0k|  if (bufStr->lookChar() == 0xff) {
  ------------------
  |  Branch (620:7): [True: 63.4k, False: 22.5k]
  ------------------
  621|  63.4k|    cover(7);
  622|  63.4k|    error(errSyntaxWarning, getPos(),
  623|  63.4k|	  "Naked JPEG 2000 codestream, missing JP2/JPX wrapper");
  624|  63.4k|    if ((result = readCodestream(0)) == jpxDecodeFatalError) {
  ------------------
  |  Branch (624:9): [True: 58.0k, False: 5.38k]
  ------------------
  625|  58.0k|      return result;
  626|  58.0k|    }
  627|  5.38k|    nComps = img.nComps;
  628|  5.38k|    bpc = (Guint *)gmallocn(nComps, sizeof(Guint));
  629|  38.8k|    for (i = 0; i < nComps; ++i) {
  ------------------
  |  Branch (629:17): [True: 33.4k, False: 5.38k]
  ------------------
  630|  33.4k|      bpc[i] = img.tiles[0].tileComps[i].prec;
  631|  33.4k|    }
  632|  5.38k|    width = img.xSize - img.xOffset;
  633|  5.38k|    height = img.ySize - img.yOffset;
  634|  5.38k|    return result;
  635|  63.4k|  }
  636|       |
  637|   118k|  while (readBoxHdr(&boxType, &boxLen, &dataLen)) {
  ------------------
  |  Branch (637:10): [True: 114k, False: 4.15k]
  ------------------
  638|   114k|    switch (boxType) {
  639|  14.3k|    case 0x6a703268:		// JP2 header
  ------------------
  |  Branch (639:5): [True: 14.3k, False: 100k]
  ------------------
  640|       |      // this is a grouping box ('superbox') which has no real
  641|       |      // contents and doesn't appear to be used consistently, i.e.,
  642|       |      // some things which should be subboxes of the JP2 header box
  643|       |      // show up outside of it - so we simply ignore the JP2 header
  644|       |      // box
  645|  14.3k|      cover(8);
  646|  14.3k|      break;
  647|  12.9k|    case 0x69686472:		// image header
  ------------------
  |  Branch (647:5): [True: 12.9k, False: 101k]
  ------------------
  648|  12.9k|      cover(9);
  649|  12.9k|      if (!readULong(&h) ||
  ------------------
  |  Branch (649:11): [True: 825, False: 12.1k]
  ------------------
  650|  12.1k|	  !readULong(&w) ||
  ------------------
  |  Branch (650:4): [True: 725, False: 11.4k]
  ------------------
  651|  11.4k|	  !readUWord(&n) ||
  ------------------
  |  Branch (651:4): [True: 356, False: 11.0k]
  ------------------
  652|  11.0k|	  !readUByte(&bpc1) ||
  ------------------
  |  Branch (652:4): [True: 289, False: 10.8k]
  ------------------
  653|  10.8k|	  !readUByte(&compression) ||
  ------------------
  |  Branch (653:4): [True: 245, False: 10.5k]
  ------------------
  654|  10.5k|	  !readUByte(&unknownColorspace) ||
  ------------------
  |  Branch (654:4): [True: 187, False: 10.3k]
  ------------------
  655|  10.3k|	  !readUByte(&ipr)) {
  ------------------
  |  Branch (655:4): [True: 308, False: 10.0k]
  ------------------
  656|  2.93k|	error(errSyntaxError, getPos(), "Unexpected EOF in JPX stream");
  657|  2.93k|	return jpxDecodeFatalError;
  658|  2.93k|      }
  659|  10.0k|      if (compression != 7) {
  ------------------
  |  Branch (659:11): [True: 148, False: 9.91k]
  ------------------
  660|    148|	error(errSyntaxError, getPos(),
  661|    148|	      "Unknown compression type in JPX stream");
  662|    148|	return jpxDecodeFatalError;
  663|    148|      }
  664|  9.91k|      height = h;
  665|  9.91k|      width = w;
  666|  9.91k|      nComps = n;
  667|  9.91k|      bpc = (Guint *)gmallocn(nComps, sizeof(Guint));
  668|  3.68M|      for (i = 0; i < nComps; ++i) {
  ------------------
  |  Branch (668:19): [True: 3.67M, False: 9.91k]
  ------------------
  669|  3.67M|	bpc[i] = bpc1;
  670|  3.67M|      }
  671|  9.91k|      haveImgHdr = gTrue;
  ------------------
  |  |   17|  9.91k|#define gTrue 1
  ------------------
  672|  9.91k|      break;
  673|    211|    case 0x62706363:		// bits per component
  ------------------
  |  Branch (673:5): [True: 211, False: 114k]
  ------------------
  674|    211|      cover(10);
  675|    211|      if (!haveImgHdr) {
  ------------------
  |  Branch (675:11): [True: 211, False: 0]
  ------------------
  676|    211|	error(errSyntaxError, getPos(),
  677|    211|	      "Found bits per component box before image header box in JPX stream");
  678|    211|	return jpxDecodeFatalError;
  679|    211|      }
  680|      0|      if (dataLen != nComps) {
  ------------------
  |  Branch (680:11): [True: 0, False: 0]
  ------------------
  681|      0|	error(errSyntaxError, getPos(),
  682|      0|	      "Invalid bits per component box in JPX stream");
  683|      0|	return jpxDecodeFatalError;
  684|      0|      }
  685|      0|      for (i = 0; i < nComps; ++i) {
  ------------------
  |  Branch (685:19): [True: 0, False: 0]
  ------------------
  686|      0|	if (!readUByte(&bpc[i])) {
  ------------------
  |  Branch (686:6): [True: 0, False: 0]
  ------------------
  687|      0|	  error(errSyntaxError, getPos(), "Unexpected EOF in JPX stream");
  688|      0|	  return jpxDecodeFatalError;
  689|      0|	}
  690|      0|      }
  691|      0|      break;
  692|  12.5k|    case 0x636F6C72:		// color specification
  ------------------
  |  Branch (692:5): [True: 12.5k, False: 101k]
  ------------------
  693|  12.5k|      cover(11);
  694|  12.5k|      if (!readColorSpecBox(dataLen)) {
  ------------------
  |  Branch (694:11): [True: 3.15k, False: 9.42k]
  ------------------
  695|  3.15k|	return jpxDecodeFatalError;
  696|  3.15k|      }
  697|  9.42k|      break;
  698|  9.42k|    case 0x70636c72:		// palette
  ------------------
  |  Branch (698:5): [True: 994, False: 113k]
  ------------------
  699|    994|      cover(12);
  700|    994|      if (!readUWord(&palette.nEntries) ||
  ------------------
  |  Branch (700:11): [True: 245, False: 749]
  ------------------
  701|    749|	  !readUByte(&palette.nComps)) {
  ------------------
  |  Branch (701:4): [True: 198, False: 551]
  ------------------
  702|    443|	error(errSyntaxError, getPos(), "Unexpected EOF in JPX stream");
  703|    443|	return jpxDecodeFatalError;
  704|    443|      }
  705|    551|      havePalette = gTrue;
  ------------------
  |  |   17|    551|#define gTrue 1
  ------------------
  706|    551|      palette.bpc = (Guint *)gmallocn(palette.nComps, sizeof(Guint));
  707|    551|      palette.c =
  708|    551|          (int *)gmallocn(palette.nEntries * palette.nComps, sizeof(int));
  709|  7.32k|      for (i = 0; i < palette.nComps; ++i) {
  ------------------
  |  Branch (709:19): [True: 7.05k, False: 276]
  ------------------
  710|  7.05k|	if (!readUByte(&palette.bpc[i])) {
  ------------------
  |  Branch (710:6): [True: 275, False: 6.77k]
  ------------------
  711|    275|	  error(errSyntaxError, getPos(), "Unexpected EOF in JPX stream");
  712|    275|	  return jpxDecodeFatalError;
  713|    275|	}
  714|  6.77k|	++palette.bpc[i];
  715|  6.77k|      }
  716|  58.0k|      for (i = 0; i < palette.nEntries; ++i) {
  ------------------
  |  Branch (716:19): [True: 57.9k, False: 145]
  ------------------
  717|   174k|	for (j = 0; j < palette.nComps; ++j) {
  ------------------
  |  Branch (717:14): [True: 116k, False: 57.7k]
  ------------------
  718|   116k|	  if (!readNBytes(((palette.bpc[j] & 0x7f) + 7) >> 3,
  ------------------
  |  Branch (718:8): [True: 131, False: 116k]
  ------------------
  719|   116k|			  (palette.bpc[j] & 0x80) ? gTrue : gFalse,
  ------------------
  |  |   17|  58.0k|#define gTrue 1
  ------------------
              			  (palette.bpc[j] & 0x80) ? gTrue : gFalse,
  ------------------
  |  |   18|  58.3k|#define gFalse 0
  ------------------
  |  Branch (719:6): [True: 58.0k, False: 58.3k]
  ------------------
  720|   116k|			  &palette.c[i * palette.nComps + j])) {
  721|    131|	    error(errSyntaxError, getPos(), "Unexpected EOF in JPX stream");
  722|    131|	    return jpxDecodeFatalError;
  723|    131|	  }
  724|   116k|	}
  725|  57.9k|      }
  726|    145|      break;
  727|  1.05k|    case 0x636d6170:		// component mapping
  ------------------
  |  Branch (727:5): [True: 1.05k, False: 113k]
  ------------------
  728|  1.05k|      cover(13);
  729|  1.05k|      haveCompMap = gTrue;
  ------------------
  |  |   17|  1.05k|#define gTrue 1
  ------------------
  730|  1.05k|      compMap.nChannels = dataLen / 4;
  731|  1.05k|      compMap.comp = (Guint *)gmallocn(compMap.nChannels, sizeof(Guint));
  732|  1.05k|      compMap.type = (Guint *)gmallocn(compMap.nChannels, sizeof(Guint));
  733|  1.05k|      compMap.pComp = (Guint *)gmallocn(compMap.nChannels, sizeof(Guint));
  734|   191k|      for (i = 0; i < compMap.nChannels; ++i) {
  ------------------
  |  Branch (734:19): [True: 191k, False: 348]
  ------------------
  735|   191k|	if (!readUWord(&compMap.comp[i]) ||
  ------------------
  |  Branch (735:6): [True: 367, False: 191k]
  ------------------
  736|   191k|	    !readUByte(&compMap.type[i]) ||
  ------------------
  |  Branch (736:6): [True: 171, False: 191k]
  ------------------
  737|   191k|	    !readUByte(&compMap.pComp[i])) {
  ------------------
  |  Branch (737:6): [True: 164, False: 190k]
  ------------------
  738|    702|	  error(errSyntaxError, getPos(), "Unexpected EOF in JPX stream");
  739|    702|	  return jpxDecodeFatalError;
  740|    702|	}
  741|   191k|      }
  742|    348|      break;
  743|  1.67k|    case 0x63646566:		// channel definition
  ------------------
  |  Branch (743:5): [True: 1.67k, False: 112k]
  ------------------
  744|  1.67k|      cover(14);
  745|  1.67k|      if (!readUWord(&channelDefn.nChannels)) {
  ------------------
  |  Branch (745:11): [True: 250, False: 1.42k]
  ------------------
  746|    250|	error(errSyntaxError, getPos(), "Unexpected EOF in JPX stream");
  747|    250|	return jpxDecodeFatalError;
  748|    250|      }
  749|  1.42k|      haveChannelDefn = gTrue;
  ------------------
  |  |   17|  1.42k|#define gTrue 1
  ------------------
  750|  1.42k|      channelDefn.idx =
  751|  1.42k|	  (Guint *)gmallocn(channelDefn.nChannels, sizeof(Guint));
  752|  1.42k|      channelDefn.type =
  753|  1.42k|	  (Guint *)gmallocn(channelDefn.nChannels, sizeof(Guint));
  754|  1.42k|      channelDefn.assoc =
  755|  1.42k|	  (Guint *)gmallocn(channelDefn.nChannels, sizeof(Guint));
  756|   299k|      for (i = 0; i < channelDefn.nChannels; ++i) {
  ------------------
  |  Branch (756:19): [True: 299k, False: 489]
  ------------------
  757|   299k|	if (!readUWord(&channelDefn.idx[i]) ||
  ------------------
  |  Branch (757:6): [True: 327, False: 299k]
  ------------------
  758|   299k|	    !readUWord(&channelDefn.type[i]) ||
  ------------------
  |  Branch (758:6): [True: 302, False: 298k]
  ------------------
  759|   298k|	    !readUWord(&channelDefn.assoc[i])) {
  ------------------
  |  Branch (759:6): [True: 306, False: 298k]
  ------------------
  760|    935|	  error(errSyntaxError, getPos(), "Unexpected EOF in JPX stream");
  761|    935|	  return jpxDecodeFatalError;
  762|    935|	}
  763|   299k|      }
  764|    489|      break;
  765|  4.04k|    case 0x6A703263:		// contiguous codestream
  ------------------
  |  Branch (765:5): [True: 4.04k, False: 110k]
  ------------------
  766|  4.04k|      cover(15);
  767|  4.04k|      if (!bpc) {
  ------------------
  |  Branch (767:11): [True: 1.03k, False: 3.00k]
  ------------------
  768|  1.03k|	error(errSyntaxError, getPos(),
  769|  1.03k|	      "JPX stream is missing the image header box");
  770|  1.03k|      }
  771|  4.04k|      if (!haveCS) {
  ------------------
  |  Branch (771:11): [True: 3.17k, False: 862]
  ------------------
  772|  3.17k|	error(errSyntaxError, getPos(),
  773|  3.17k|	      "JPX stream has no supported color spec");
  774|  3.17k|      }
  775|  4.04k|      if ((result = readCodestream(dataLen)) != jpxDecodeOk) {
  ------------------
  |  Branch (775:11): [True: 3.72k, False: 313]
  ------------------
  776|  3.72k|	return result;
  777|  3.72k|      }
  778|    313|      haveCodestream = gTrue;
  ------------------
  |  |   17|    313|#define gTrue 1
  ------------------
  779|    313|      break;
  780|  66.5k|    default:
  ------------------
  |  Branch (780:5): [True: 66.5k, False: 47.9k]
  ------------------
  781|  66.5k|      cover(16);
  782|  66.5k|      if (bufStr->discardChars(dataLen) != dataLen) {
  ------------------
  |  Branch (782:11): [True: 5.51k, False: 61.0k]
  ------------------
  783|  5.51k|	error(errSyntaxError, getPos(), "Unexpected EOF in JPX stream");
  784|  5.51k|	return haveCodestream ? jpxDecodeNonFatalError : jpxDecodeFatalError;
  ------------------
  |  Branch (784:9): [True: 313, False: 5.20k]
  ------------------
  785|  5.51k|      }
  786|  61.0k|      break;
  787|   114k|    }
  788|   114k|  }
  789|  4.15k|  return jpxDecodeOk;
  790|  22.5k|}
_ZN9JPXStream16readColorSpecBoxEj:
  792|  12.5k|GBool JPXStream::readColorSpecBox(Guint dataLen) {
  793|  12.5k|  JPXColorSpec newCS;
  794|  12.5k|  Guint csApprox, csEnum;
  795|  12.5k|  GBool ok;
  796|       |
  797|  12.5k|  ok = gFalse;
  ------------------
  |  |   18|  12.5k|#define gFalse 0
  ------------------
  798|  12.5k|  if (!readUByte(&newCS.meth) ||
  ------------------
  |  Branch (798:7): [True: 128, False: 12.4k]
  ------------------
  799|  12.4k|      !readByte(&newCS.prec) ||
  ------------------
  |  Branch (799:7): [True: 237, False: 12.2k]
  ------------------
  800|  12.2k|      !readUByte(&csApprox)) {
  ------------------
  |  Branch (800:7): [True: 241, False: 11.9k]
  ------------------
  801|    606|    goto err;
  802|    606|  }
  803|  11.9k|  switch (newCS.meth) {
  ------------------
  |  Branch (803:11): [True: 11.6k, False: 326]
  ------------------
  804|  8.11k|  case 1:			// enumerated colorspace
  ------------------
  |  Branch (804:3): [True: 8.11k, False: 3.85k]
  ------------------
  805|  8.11k|    cover(17);
  806|  8.11k|    if (!readULong(&csEnum)) {
  ------------------
  |  Branch (806:9): [True: 561, False: 7.55k]
  ------------------
  807|    561|      goto err;
  808|    561|    }
  809|  7.55k|    newCS.enumerated.type = (JPXColorSpaceType)csEnum;
  810|  7.55k|    switch (newCS.enumerated.type) {
  811|    214|    case jpxCSBiLevel:
  ------------------
  |  Branch (811:5): [True: 214, False: 7.33k]
  ------------------
  812|    214|      ok = gTrue;
  ------------------
  |  |   17|    214|#define gTrue 1
  ------------------
  813|    214|      break;
  814|    595|    case jpxCSYCbCr1:
  ------------------
  |  Branch (814:5): [True: 595, False: 6.95k]
  ------------------
  815|    595|      ok = gTrue;
  ------------------
  |  |   17|    595|#define gTrue 1
  ------------------
  816|    595|      break;
  817|    227|    case jpxCSYCbCr2:
  ------------------
  |  Branch (817:5): [True: 227, False: 7.32k]
  ------------------
  818|    227|      ok = gTrue;
  ------------------
  |  |   17|    227|#define gTrue 1
  ------------------
  819|    227|      break;
  820|     57|    case jpxCSYCBCr3:
  ------------------
  |  Branch (820:5): [True: 57, False: 7.49k]
  ------------------
  821|     57|      ok = gTrue;
  ------------------
  |  |   17|     57|#define gTrue 1
  ------------------
  822|     57|      break;
  823|    269|    case jpxCSPhotoYCC:
  ------------------
  |  Branch (823:5): [True: 269, False: 7.28k]
  ------------------
  824|    269|      ok = gTrue;
  ------------------
  |  |   17|    269|#define gTrue 1
  ------------------
  825|    269|      break;
  826|    138|    case jpxCSCMY:
  ------------------
  |  Branch (826:5): [True: 138, False: 7.41k]
  ------------------
  827|    138|      ok = gTrue;
  ------------------
  |  |   17|    138|#define gTrue 1
  ------------------
  828|    138|      break;
  829|    175|    case jpxCSCMYK:
  ------------------
  |  Branch (829:5): [True: 175, False: 7.37k]
  ------------------
  830|    175|      ok = gTrue;
  ------------------
  |  |   17|    175|#define gTrue 1
  ------------------
  831|    175|      break;
  832|    230|    case jpxCSYCCK:
  ------------------
  |  Branch (832:5): [True: 230, False: 7.32k]
  ------------------
  833|    230|      ok = gTrue;
  ------------------
  |  |   17|    230|#define gTrue 1
  ------------------
  834|    230|      break;
  835|  3.30k|    case jpxCSCIELab:
  ------------------
  |  Branch (835:5): [True: 3.30k, False: 4.24k]
  ------------------
  836|  3.30k|      if (dataLen == 7 + 7*4) {
  ------------------
  |  Branch (836:11): [True: 2.83k, False: 470]
  ------------------
  837|  2.83k|	if (!readULong(&newCS.enumerated.cieLab.rl) ||
  ------------------
  |  Branch (837:6): [True: 202, False: 2.63k]
  ------------------
  838|  2.63k|	    !readULong(&newCS.enumerated.cieLab.ol) ||
  ------------------
  |  Branch (838:6): [True: 0, False: 2.63k]
  ------------------
  839|  2.63k|	    !readULong(&newCS.enumerated.cieLab.ra) ||
  ------------------
  |  Branch (839:6): [True: 175, False: 2.46k]
  ------------------
  840|  2.46k|	    !readULong(&newCS.enumerated.cieLab.oa) ||
  ------------------
  |  Branch (840:6): [True: 129, False: 2.33k]
  ------------------
  841|  2.33k|	    !readULong(&newCS.enumerated.cieLab.rb) ||
  ------------------
  |  Branch (841:6): [True: 128, False: 2.20k]
  ------------------
  842|  2.20k|	    !readULong(&newCS.enumerated.cieLab.ob) ||
  ------------------
  |  Branch (842:6): [True: 515, False: 1.68k]
  ------------------
  843|  1.68k|	    !readULong(&newCS.enumerated.cieLab.il)) {
  ------------------
  |  Branch (843:6): [True: 258, False: 1.43k]
  ------------------
  844|  1.40k|	  goto err;
  845|  1.40k|	}
  846|  2.83k|      } else if (dataLen == 7) {
  ------------------
  |  Branch (846:18): [True: 197, False: 273]
  ------------------
  847|       |	//~ this assumes the 8-bit case
  848|    197|	cover(92);
  849|    197|	newCS.enumerated.cieLab.rl = 100;
  850|    197|	newCS.enumerated.cieLab.ol = 0;
  851|    197|	newCS.enumerated.cieLab.ra = 255;
  852|    197|	newCS.enumerated.cieLab.oa = 128;
  853|    197|	newCS.enumerated.cieLab.rb = 255;
  854|    197|	newCS.enumerated.cieLab.ob = 96;
  855|    197|	newCS.enumerated.cieLab.il = 0x00443530;
  856|    273|      } else {
  857|    273|	goto err;
  858|    273|      }
  859|  1.62k|      ok = gTrue;
  ------------------
  |  |   17|  1.62k|#define gTrue 1
  ------------------
  860|  1.62k|      break;
  861|    280|    case jpxCSsRGB:
  ------------------
  |  Branch (861:5): [True: 280, False: 7.27k]
  ------------------
  862|    280|      ok = gTrue;
  ------------------
  |  |   17|    280|#define gTrue 1
  ------------------
  863|    280|      break;
  864|    203|    case jpxCSGrayscale:
  ------------------
  |  Branch (864:5): [True: 203, False: 7.34k]
  ------------------
  865|    203|      ok = gTrue;
  ------------------
  |  |   17|    203|#define gTrue 1
  ------------------
  866|    203|      break;
  867|    508|    case jpxCSBiLevel2:
  ------------------
  |  Branch (867:5): [True: 508, False: 7.04k]
  ------------------
  868|    508|      ok = gTrue;
  ------------------
  |  |   17|    508|#define gTrue 1
  ------------------
  869|    508|      break;
  870|      0|    case jpxCSCIEJab:
  ------------------
  |  Branch (870:5): [True: 0, False: 7.55k]
  ------------------
  871|       |      // not allowed in PDF
  872|      0|      goto err;
  873|    301|    case jpxCSCISesRGB:
  ------------------
  |  Branch (873:5): [True: 301, False: 7.25k]
  ------------------
  874|    301|      ok = gTrue;
  ------------------
  |  |   17|    301|#define gTrue 1
  ------------------
  875|    301|      break;
  876|    234|    case jpxCSROMMRGB:
  ------------------
  |  Branch (876:5): [True: 234, False: 7.31k]
  ------------------
  877|    234|      ok = gTrue;
  ------------------
  |  |   17|    234|#define gTrue 1
  ------------------
  878|    234|      break;
  879|    275|    case jpxCSsRGBYCbCr:
  ------------------
  |  Branch (879:5): [True: 275, False: 7.27k]
  ------------------
  880|    275|      ok = gTrue;
  ------------------
  |  |   17|    275|#define gTrue 1
  ------------------
  881|    275|      break;
  882|    204|    case jpxCSYPbPr1125:
  ------------------
  |  Branch (882:5): [True: 204, False: 7.34k]
  ------------------
  883|    204|      ok = gTrue;
  ------------------
  |  |   17|    204|#define gTrue 1
  ------------------
  884|    204|      break;
  885|    203|    case jpxCSYPbPr1250:
  ------------------
  |  Branch (885:5): [True: 203, False: 7.34k]
  ------------------
  886|    203|      ok = gTrue;
  ------------------
  |  |   17|    203|#define gTrue 1
  ------------------
  887|    203|      break;
  888|    131|    default:
  ------------------
  |  Branch (888:5): [True: 131, False: 7.42k]
  ------------------
  889|    131|      goto err;
  890|  7.55k|    }
  891|  5.74k|    break;
  892|  5.74k|  case 2:			// restricted ICC profile
  ------------------
  |  Branch (892:3): [True: 498, False: 11.4k]
  ------------------
  893|    738|  case 3: 			// any ICC profile (JPX)
  ------------------
  |  Branch (893:3): [True: 240, False: 11.7k]
  ------------------
  894|  3.53k|  case 4:			// vendor color (JPX)
  ------------------
  |  Branch (894:3): [True: 2.79k, False: 9.17k]
  ------------------
  895|  3.53k|    cover(18);
  896|  3.53k|    if (dataLen > 3 &&
  ------------------
  |  Branch (896:9): [True: 3.33k, False: 201]
  ------------------
  897|  3.33k|	bufStr->discardChars(dataLen - 3) != dataLen - 3) {
  ------------------
  |  Branch (897:2): [True: 173, False: 3.15k]
  ------------------
  898|    173|      goto err;
  899|    173|    }
  900|  3.35k|    break;
  901|  11.9k|  }
  902|       |
  903|  9.42k|  if (ok && (!haveCS || newCS.prec > cs.prec)) {
  ------------------
  |  Branch (903:7): [True: 5.74k, False: 3.68k]
  |  Branch (903:14): [True: 5.05k, False: 682]
  |  Branch (903:25): [True: 259, False: 423]
  ------------------
  904|  5.31k|    cs = newCS;
  905|  5.31k|    haveCS = gTrue;
  ------------------
  |  |   17|  5.31k|#define gTrue 1
  ------------------
  906|  5.31k|  }
  907|       |
  908|  9.42k|  return gTrue;
  ------------------
  |  |   17|  9.42k|#define gTrue 1
  ------------------
  909|       |
  910|  3.15k| err:
  911|  3.15k|  error(errSyntaxError, getPos(), "Error in JPX color spec");
  912|  3.15k|  return gFalse;
  ------------------
  |  |   18|  3.15k|#define gFalse 0
  ------------------
  913|  11.9k|}
_ZN9JPXStream14readCodestreamEj:
  915|  67.4k|JPXDecodeResult JPXStream::readCodestream(Guint len) {
  916|  67.4k|  JPXTile *tile;
  917|  67.4k|  JPXTileComp *tileComp;
  918|  67.4k|  int segType;
  919|  67.4k|  GBool haveSIZ, haveCOD, haveQCD, haveSOT, ok;
  920|  67.4k|  Guint style, progOrder, nLayers, multiComp, nDecompLevels;
  921|  67.4k|  Guint codeBlockW, codeBlockH, codeBlockStyle, transform;
  922|  67.4k|  Guint precinctSize;
  923|  67.4k|  Guint segLen, capabilities, comp, i, j, r;
  924|       |
  925|       |  //----- main header
  926|  67.4k|  haveSIZ = haveCOD = haveQCD = haveSOT = gFalse;
  ------------------
  |  |   18|  67.4k|#define gFalse 0
  ------------------
  927|   430k|  do {
  928|   430k|    if (!readMarkerHdr(&segType, &segLen)) {
  ------------------
  |  Branch (928:9): [True: 1.97k, False: 428k]
  ------------------
  929|  1.97k|      error(errSyntaxError, getPos(), "Error in JPX codestream");
  930|  1.97k|      return jpxDecodeFatalError;
  931|  1.97k|    }
  932|   428k|    switch (segType) {
  933|  43.2k|    case 0x4f:			// SOC - start of codestream
  ------------------
  |  Branch (933:5): [True: 43.2k, False: 385k]
  ------------------
  934|       |      // marker only
  935|  43.2k|      cover(19);
  936|  43.2k|      break;
  937|  54.3k|    case 0x51:			// SIZ - image and tile size
  ------------------
  |  Branch (937:5): [True: 54.3k, False: 374k]
  ------------------
  938|  54.3k|      cover(20);
  939|  54.3k|      if (haveSIZ) {
  ------------------
  |  Branch (939:11): [True: 131, False: 54.2k]
  ------------------
  940|    131|	error(errSyntaxError, getPos(),
  941|    131|	      "Duplicate SIZ marker segment in JPX stream");
  942|    131|	return jpxDecodeFatalError;
  943|    131|      }
  944|  54.2k|      if (!readUWord(&capabilities) ||
  ------------------
  |  Branch (944:11): [True: 496, False: 53.7k]
  ------------------
  945|  53.7k|	  !readULong(&img.xSize) ||
  ------------------
  |  Branch (945:4): [True: 1.02k, False: 52.6k]
  ------------------
  946|  52.6k|	  !readULong(&img.ySize) ||
  ------------------
  |  Branch (946:4): [True: 976, False: 51.7k]
  ------------------
  947|  51.7k|	  !readULong(&img.xOffset) ||
  ------------------
  |  Branch (947:4): [True: 789, False: 50.9k]
  ------------------
  948|  50.9k|	  !readULong(&img.yOffset) ||
  ------------------
  |  Branch (948:4): [True: 1.03k, False: 49.8k]
  ------------------
  949|  49.8k|	  !readULong(&img.xTileSize) ||
  ------------------
  |  Branch (949:4): [True: 986, False: 48.9k]
  ------------------
  950|  48.9k|	  !readULong(&img.yTileSize) ||
  ------------------
  |  Branch (950:4): [True: 967, False: 47.9k]
  ------------------
  951|  47.9k|	  !readULong(&img.xTileOffset) ||
  ------------------
  |  Branch (951:4): [True: 849, False: 47.0k]
  ------------------
  952|  47.0k|	  !readULong(&img.yTileOffset) ||
  ------------------
  |  Branch (952:4): [True: 947, False: 46.1k]
  ------------------
  953|  46.1k|	  !readUWord(&img.nComps)) {
  ------------------
  |  Branch (953:4): [True: 270, False: 45.8k]
  ------------------
  954|  8.33k|	error(errSyntaxError, getPos(), "Error in JPX SIZ marker segment");
  955|  8.33k|	return jpxDecodeFatalError;
  956|  8.33k|      }
  957|  45.8k|      if (haveImgHdr && img.nComps != nComps) {
  ------------------
  |  Branch (957:11): [True: 2.97k, False: 42.8k]
  |  Branch (957:25): [True: 2.73k, False: 237]
  ------------------
  958|  2.73k|	error(errSyntaxError, getPos(),
  959|  2.73k|	      "Different number of components in JPX SIZ marker segment");
  960|  2.73k|	return jpxDecodeFatalError;
  961|  2.73k|      }
  962|  43.1k|      if (img.xSize == 0 || img.ySize == 0 ||
  ------------------
  |  Branch (962:11): [True: 138, False: 42.9k]
  |  Branch (962:29): [True: 132, False: 42.8k]
  ------------------
  963|  42.8k|	  img.xOffset >= img.xSize || img.yOffset >= img.ySize ||
  ------------------
  |  Branch (963:4): [True: 505, False: 42.3k]
  |  Branch (963:32): [True: 133, False: 42.2k]
  ------------------
  964|  42.2k|	  img.xTileSize == 0 || img.yTileSize == 0 ||
  ------------------
  |  Branch (964:4): [True: 181, False: 42.0k]
  |  Branch (964:26): [True: 130, False: 41.9k]
  ------------------
  965|  41.9k|	  img.xTileOffset > img.xOffset ||
  ------------------
  |  Branch (965:4): [True: 306, False: 41.6k]
  ------------------
  966|  41.6k|	  img.yTileOffset > img.yOffset ||
  ------------------
  |  Branch (966:4): [True: 324, False: 41.2k]
  ------------------
  967|  41.2k|	  img.xTileSize + img.xTileOffset <= img.xOffset ||
  ------------------
  |  Branch (967:4): [True: 0, False: 41.2k]
  ------------------
  968|  41.2k|	  img.yTileSize + img.yTileOffset <= img.yOffset ||
  ------------------
  |  Branch (968:4): [True: 133, False: 41.1k]
  ------------------
  969|  41.1k|	  img.nComps == 0) {
  ------------------
  |  Branch (969:4): [True: 128, False: 41.0k]
  ------------------
  970|  2.11k|	error(errSyntaxError, getPos(), "Error in JPX SIZ marker segment");
  971|  2.11k|	return jpxDecodeFatalError;
  972|  2.11k|      }
  973|  41.0k|      img.xSizeR = jpxCeilDivPow2(img.xSize, reduction);
  ------------------
  |  |  167|  41.0k|#define jpxCeilDivPow2(x, y) (((x) + (1 << (y)) - 1) >> (y))
  ------------------
  974|  41.0k|      img.ySizeR = jpxCeilDivPow2(img.ySize, reduction);
  ------------------
  |  |  167|  41.0k|#define jpxCeilDivPow2(x, y) (((x) + (1 << (y)) - 1) >> (y))
  ------------------
  975|  41.0k|      img.xOffsetR = jpxCeilDivPow2(img.xOffset, reduction);
  ------------------
  |  |  167|  41.0k|#define jpxCeilDivPow2(x, y) (((x) + (1 << (y)) - 1) >> (y))
  ------------------
  976|  41.0k|      img.yOffsetR = jpxCeilDivPow2(img.yOffset, reduction);
  ------------------
  |  |  167|  41.0k|#define jpxCeilDivPow2(x, y) (((x) + (1 << (y)) - 1) >> (y))
  ------------------
  977|  41.0k|      img.nXTiles = (img.xSize - img.xTileOffset + img.xTileSize - 1)
  978|  41.0k|	            / img.xTileSize;
  979|  41.0k|      img.nYTiles = (img.ySize - img.yTileOffset + img.yTileSize - 1)
  980|  41.0k|	            / img.yTileSize;
  981|       |      // check for overflow before allocating memory
  982|  41.0k|      if (img.nXTiles <= 0 || img.nYTiles <= 0 ||
  ------------------
  |  Branch (982:11): [True: 135, False: 40.8k]
  |  Branch (982:31): [True: 263, False: 40.6k]
  ------------------
  983|  40.6k|	  img.nXTiles >= INT_MAX / img.nYTiles) {
  ------------------
  |  Branch (983:4): [True: 257, False: 40.3k]
  ------------------
  984|    655|	error(errSyntaxError, getPos(),
  985|    655|	      "Bad tile count in JPX SIZ marker segment");
  986|    655|	return jpxDecodeFatalError;
  987|    655|      }
  988|  40.3k|      img.tiles = (JPXTile *)gmallocn(img.nXTiles * img.nYTiles,
  989|  40.3k|				      sizeof(JPXTile));
  990|   407k|      for (i = 0; i < img.nXTiles * img.nYTiles; ++i) {
  ------------------
  |  Branch (990:19): [True: 366k, False: 40.3k]
  ------------------
  991|   366k|	img.tiles[i].init = gFalse;
  ------------------
  |  |   18|   366k|#define gFalse 0
  ------------------
  992|   366k|	img.tiles[i].nextTilePart = 0;
  993|   366k|	img.tiles[i].tileComps = NULL;
  994|   366k|      }
  995|   407k|      for (i = 0; i < img.nXTiles * img.nYTiles; ++i) {
  ------------------
  |  Branch (995:19): [True: 366k, False: 40.3k]
  ------------------
  996|   366k|	img.tiles[i].tileComps = (JPXTileComp *)gmallocn(img.nComps,
  997|   366k|							 sizeof(JPXTileComp));
  998|  3.16M|	for (comp = 0; comp < img.nComps; ++comp) {
  ------------------
  |  Branch (998:17): [True: 2.79M, False: 366k]
  ------------------
  999|  2.79M|	  img.tiles[i].tileComps[comp].quantSteps = NULL;
 1000|  2.79M|	  img.tiles[i].tileComps[comp].data = NULL;
 1001|  2.79M|	  img.tiles[i].tileComps[comp].buf = NULL;
 1002|  2.79M|	  img.tiles[i].tileComps[comp].resLevels = NULL;
 1003|  2.79M|	}
 1004|   366k|      }
 1005|   671k|      for (comp = 0; comp < img.nComps; ++comp) {
  ------------------
  |  Branch (1005:22): [True: 631k, False: 40.3k]
  ------------------
 1006|   631k|	if (!readUByte(&img.tiles[0].tileComps[comp].prec) ||
  ------------------
  |  Branch (1006:6): [True: 0, False: 631k]
  ------------------
 1007|   631k|	    !readUByte(&img.tiles[0].tileComps[comp].hSep) ||
  ------------------
  |  Branch (1007:6): [True: 0, False: 631k]
  ------------------
 1008|   631k|	    !readUByte(&img.tiles[0].tileComps[comp].vSep)) {
  ------------------
  |  Branch (1008:6): [True: 16, False: 631k]
  ------------------
 1009|     16|	  error(errSyntaxError, getPos(), "Error in JPX SIZ marker segment");
 1010|     16|	  return jpxDecodeFatalError;
 1011|     16|	}
 1012|   631k|	if (img.tiles[0].tileComps[comp].hSep == 0 ||
  ------------------
  |  Branch (1012:6): [True: 0, False: 631k]
  ------------------
 1013|   631k|	    img.tiles[0].tileComps[comp].vSep == 0) {
  ------------------
  |  Branch (1013:6): [True: 2, False: 631k]
  ------------------
 1014|      2|	  error(errSyntaxError, getPos(), "Error in JPX SIZ marker segment");
 1015|      2|	  return jpxDecodeFatalError;
 1016|      2|	}
 1017|   631k|	img.tiles[0].tileComps[comp].sgned =
 1018|   631k|	    (img.tiles[0].tileComps[comp].prec & 0x80) ? gTrue : gFalse;
  ------------------
  |  |   17|  63.9k|#define gTrue 1
  ------------------
              	    (img.tiles[0].tileComps[comp].prec & 0x80) ? gTrue : gFalse;
  ------------------
  |  |   18|  1.19M|#define gFalse 0
  ------------------
  |  Branch (1018:6): [True: 63.9k, False: 567k]
  ------------------
 1019|   631k|	img.tiles[0].tileComps[comp].prec =
 1020|   631k|	    (img.tiles[0].tileComps[comp].prec & 0x7f) + 1;
 1021|  2.68M|	for (i = 1; i < img.nXTiles * img.nYTiles; ++i) {
  ------------------
  |  Branch (1021:14): [True: 2.05M, False: 631k]
  ------------------
 1022|  2.05M|	  img.tiles[i].tileComps[comp] = img.tiles[0].tileComps[comp];
 1023|  2.05M|	}
 1024|   631k|      }
 1025|  40.3k|      haveSIZ = gTrue;
  ------------------
  |  |   17|  40.3k|#define gTrue 1
  ------------------
 1026|  40.3k|      break;
 1027|  53.7k|    case 0x52:			// COD - coding style default
  ------------------
  |  Branch (1027:5): [True: 53.7k, False: 374k]
  ------------------
 1028|  53.7k|      cover(21);
 1029|  53.7k|      if (!haveSIZ) {
  ------------------
  |  Branch (1029:11): [True: 11.0k, False: 42.7k]
  ------------------
 1030|  11.0k|	error(errSyntaxError, getPos(),
 1031|  11.0k|	      "JPX COD marker segment before SIZ segment");
 1032|  11.0k|	return jpxDecodeFatalError;
 1033|  11.0k|      }
 1034|  42.7k|      if (!readUByte(&style) ||
  ------------------
  |  Branch (1034:11): [True: 208, False: 42.5k]
  ------------------
 1035|  42.5k|	  !readUByte(&progOrder) ||
  ------------------
  |  Branch (1035:4): [True: 240, False: 42.3k]
  ------------------
 1036|  42.3k|	  !readUWord(&nLayers) ||
  ------------------
  |  Branch (1036:4): [True: 577, False: 41.7k]
  ------------------
 1037|  41.7k|	  !readUByte(&multiComp) ||
  ------------------
  |  Branch (1037:4): [True: 284, False: 41.4k]
  ------------------
 1038|  41.4k|	  !readUByte(&nDecompLevels) ||
  ------------------
  |  Branch (1038:4): [True: 240, False: 41.2k]
  ------------------
 1039|  41.2k|	  !readUByte(&codeBlockW) ||
  ------------------
  |  Branch (1039:4): [True: 128, False: 41.0k]
  ------------------
 1040|  41.0k|	  !readUByte(&codeBlockH) ||
  ------------------
  |  Branch (1040:4): [True: 244, False: 40.8k]
  ------------------
 1041|  40.8k|	  !readUByte(&codeBlockStyle) ||
  ------------------
  |  Branch (1041:4): [True: 258, False: 40.5k]
  ------------------
 1042|  40.5k|	  !readUByte(&transform)) {
  ------------------
  |  Branch (1042:4): [True: 279, False: 40.3k]
  ------------------
 1043|  2.45k|	error(errSyntaxError, getPos(), "Error in JPX COD marker segment");
 1044|  2.45k|	return jpxDecodeFatalError;
 1045|  2.45k|      }
 1046|  40.3k|      if (nDecompLevels < 1 ||
  ------------------
  |  Branch (1046:11): [True: 1, False: 40.3k]
  ------------------
 1047|  40.3k|	  nDecompLevels > 31 ||
  ------------------
  |  Branch (1047:4): [True: 304, False: 40.0k]
  ------------------
 1048|  40.0k|	  codeBlockW > 8 ||
  ------------------
  |  Branch (1048:4): [True: 278, False: 39.7k]
  ------------------
 1049|  39.7k|	  codeBlockH > 8) {
  ------------------
  |  Branch (1049:4): [True: 0, False: 39.7k]
  ------------------
 1050|    583|	error(errSyntaxError, getPos(), "Error in JPX COD marker segment");
 1051|    583|	return jpxDecodeFatalError;
 1052|    583|      }
 1053|  39.7k|      codeBlockW += 2;
 1054|  39.7k|      codeBlockH += 2;
 1055|   639k|      for (i = 0; i < img.nXTiles * img.nYTiles; ++i) {
  ------------------
  |  Branch (1055:19): [True: 599k, False: 39.7k]
  ------------------
 1056|   599k|	img.tiles[i].progOrder = progOrder;
 1057|   599k|	img.tiles[i].nLayers = nLayers;
 1058|   599k|	img.tiles[i].multiComp = multiComp;
 1059|  4.12M|	for (comp = 0; comp < img.nComps; ++comp) {
  ------------------
  |  Branch (1059:17): [True: 3.52M, False: 599k]
  ------------------
 1060|  3.52M|	  img.tiles[i].tileComps[comp].style = style;
 1061|  3.52M|	  img.tiles[i].tileComps[comp].nDecompLevels = nDecompLevels;
 1062|  3.52M|	  img.tiles[i].tileComps[comp].codeBlockW = codeBlockW;
 1063|  3.52M|	  img.tiles[i].tileComps[comp].codeBlockH = codeBlockH;
 1064|  3.52M|	  img.tiles[i].tileComps[comp].codeBlockStyle = codeBlockStyle;
 1065|  3.52M|	  img.tiles[i].tileComps[comp].transform = transform;
 1066|  3.52M|	  img.tiles[i].tileComps[comp].resLevels =
 1067|  3.52M|	      (JPXResLevel *)gmallocn(nDecompLevels + 1, sizeof(JPXResLevel));
 1068|  15.4M|	  for (r = 0; r <= nDecompLevels; ++r) {
  ------------------
  |  Branch (1068:16): [True: 11.9M, False: 3.52M]
  ------------------
 1069|  11.9M|	    img.tiles[i].tileComps[comp].resLevels[r].precincts = NULL;
 1070|  11.9M|	  }
 1071|  3.52M|	}
 1072|   599k|      }
 1073|   186k|      for (r = 0; r <= nDecompLevels; ++r) {
  ------------------
  |  Branch (1073:19): [True: 147k, False: 39.2k]
  ------------------
 1074|   147k|	if (style & 0x01) {
  ------------------
  |  Branch (1074:6): [True: 4.74k, False: 142k]
  ------------------
 1075|  4.74k|	  cover(91);
 1076|  4.74k|	  if (!readUByte(&precinctSize)) {
  ------------------
  |  Branch (1076:8): [True: 254, False: 4.49k]
  ------------------
 1077|    254|	    error(errSyntaxError, getPos(), "Error in JPX COD marker segment");
 1078|    254|	    return jpxDecodeFatalError;
 1079|    254|	  }
 1080|  4.49k|	  if (r > 0 && ((precinctSize & 0x0f) == 0 ||
  ------------------
  |  Branch (1080:8): [True: 3.15k, False: 1.33k]
  |  Branch (1080:18): [True: 230, False: 2.92k]
  ------------------
 1081|  2.92k|			(precinctSize & 0xf0) == 0)) {
  ------------------
  |  Branch (1081:4): [True: 20, False: 2.90k]
  ------------------
 1082|    250|	    error(errSyntaxError, getPos(),
 1083|    250|		  "Invalid precinct size in JPX COD marker segment");
 1084|    250|	    return jpxDecodeFatalError;
 1085|    250|	  }
 1086|  4.24k|	  img.tiles[0].tileComps[0].resLevels[r].precinctWidth =
 1087|  4.24k|	      precinctSize & 0x0f;
 1088|  4.24k|	  img.tiles[0].tileComps[0].resLevels[r].precinctHeight =
 1089|  4.24k|	      (precinctSize >> 4) & 0x0f;
 1090|   142k|	} else {
 1091|   142k|	  img.tiles[0].tileComps[0].resLevels[r].precinctWidth = 15;
 1092|   142k|	  img.tiles[0].tileComps[0].resLevels[r].precinctHeight = 15;
 1093|   142k|	}
 1094|   147k|      }
 1095|   637k|      for (i = 0; i < img.nXTiles * img.nYTiles; ++i) {
  ------------------
  |  Branch (1095:19): [True: 598k, False: 39.2k]
  ------------------
 1096|  4.11M|	for (comp = 0; comp < img.nComps; ++comp) {
  ------------------
  |  Branch (1096:17): [True: 3.51M, False: 598k]
  ------------------
 1097|  3.51M|	  if (!(i == 0 && comp == 0)) {
  ------------------
  |  Branch (1097:10): [True: 662k, False: 2.85M]
  |  Branch (1097:20): [True: 39.2k, False: 623k]
  ------------------
 1098|  15.2M|	    for (r = 0; r <= nDecompLevels; ++r) {
  ------------------
  |  Branch (1098:18): [True: 11.7M, False: 3.47M]
  ------------------
 1099|  11.7M|	      img.tiles[i].tileComps[comp].resLevels[r].precinctWidth =
 1100|  11.7M|		  img.tiles[0].tileComps[0].resLevels[r].precinctWidth;
 1101|  11.7M|	      img.tiles[i].tileComps[comp].resLevels[r].precinctHeight =
 1102|  11.7M|		  img.tiles[0].tileComps[0].resLevels[r].precinctHeight;
 1103|  11.7M|	    }
 1104|  3.47M|	  }
 1105|  3.51M|	}
 1106|   598k|      }
 1107|  39.2k|      haveCOD = gTrue;
  ------------------
  |  |   17|  39.2k|#define gTrue 1
  ------------------
 1108|  39.2k|      break;
 1109|  11.2k|    case 0x53:			// COC - coding style component
  ------------------
  |  Branch (1109:5): [True: 11.2k, False: 417k]
  ------------------
 1110|  11.2k|      cover(22);
 1111|  11.2k|      if (!haveCOD) {
  ------------------
  |  Branch (1111:11): [True: 182, False: 11.0k]
  ------------------
 1112|    182|	error(errSyntaxError, getPos(),
 1113|    182|	      "JPX COC marker segment before COD segment");
 1114|    182|	return jpxDecodeFatalError;
 1115|    182|      }
 1116|  11.0k|      comp = 0;
 1117|  11.0k|      if ((img.nComps > 256 && !readUWord(&comp)) ||
  ------------------
  |  Branch (1117:12): [True: 513, False: 10.5k]
  |  Branch (1117:32): [True: 306, False: 207]
  ------------------
 1118|  10.7k|	  (img.nComps <= 256 && !readUByte(&comp)) ||
  ------------------
  |  Branch (1118:5): [True: 10.5k, False: 207]
  |  Branch (1118:26): [True: 257, False: 10.2k]
  ------------------
 1119|  10.4k|	  comp >= img.nComps ||
  ------------------
  |  Branch (1119:4): [True: 169, False: 10.2k]
  ------------------
 1120|  10.2k|	  !readUByte(&style) ||
  ------------------
  |  Branch (1120:4): [True: 267, False: 10.0k]
  ------------------
 1121|  10.0k|	  !readUByte(&nDecompLevels) ||
  ------------------
  |  Branch (1121:4): [True: 171, False: 9.85k]
  ------------------
 1122|  9.85k|	  !readUByte(&codeBlockW) ||
  ------------------
  |  Branch (1122:4): [True: 255, False: 9.60k]
  ------------------
 1123|  9.60k|	  !readUByte(&codeBlockH) ||
  ------------------
  |  Branch (1123:4): [True: 274, False: 9.32k]
  ------------------
 1124|  9.32k|	  !readUByte(&codeBlockStyle) ||
  ------------------
  |  Branch (1124:4): [True: 268, False: 9.06k]
  ------------------
 1125|  9.06k|	  !readUByte(&transform)) {
  ------------------
  |  Branch (1125:4): [True: 255, False: 8.80k]
  ------------------
 1126|  2.22k|	error(errSyntaxError, getPos(), "Error in JPX COC marker segment");
 1127|  2.22k|	return jpxDecodeFatalError;
 1128|  2.22k|      }
 1129|  8.80k|      if (nDecompLevels < 1 ||
  ------------------
  |  Branch (1129:11): [True: 72, False: 8.73k]
  ------------------
 1130|  8.73k|	  nDecompLevels > 31 ||
  ------------------
  |  Branch (1130:4): [True: 271, False: 8.46k]
  ------------------
 1131|  8.46k|	  codeBlockW > 8 ||
  ------------------
  |  Branch (1131:4): [True: 29, False: 8.43k]
  ------------------
 1132|  8.43k|	  codeBlockH > 8) {
  ------------------
  |  Branch (1132:4): [True: 0, False: 8.43k]
  ------------------
 1133|    372|	error(errSyntaxError, getPos(), "Error in JPX COC marker segment");
 1134|    372|	return jpxDecodeFatalError;
 1135|    372|      }
 1136|  8.43k|      style = (img.tiles[0].tileComps[comp].style & ~1) | (style & 1);
 1137|  8.43k|      codeBlockW += 2;
 1138|  8.43k|      codeBlockH += 2;
 1139|  28.6k|      for (i = 0; i < img.nXTiles * img.nYTiles; ++i) {
  ------------------
  |  Branch (1139:19): [True: 20.2k, False: 8.43k]
  ------------------
 1140|  20.2k|	img.tiles[i].tileComps[comp].style = style;
 1141|  20.2k|	img.tiles[i].tileComps[comp].nDecompLevels = nDecompLevels;
 1142|  20.2k|	img.tiles[i].tileComps[comp].codeBlockW = codeBlockW;
 1143|  20.2k|	img.tiles[i].tileComps[comp].codeBlockH = codeBlockH;
 1144|  20.2k|	img.tiles[i].tileComps[comp].codeBlockStyle = codeBlockStyle;
 1145|  20.2k|	img.tiles[i].tileComps[comp].transform = transform;
 1146|  20.2k|	img.tiles[i].tileComps[comp].resLevels =
 1147|  20.2k|	    (JPXResLevel *)greallocn(
 1148|  20.2k|		     img.tiles[i].tileComps[comp].resLevels,
 1149|  20.2k|		     nDecompLevels + 1,
 1150|  20.2k|		     sizeof(JPXResLevel));
 1151|   394k|	for (r = 0; r <= nDecompLevels; ++r) {
  ------------------
  |  Branch (1151:14): [True: 374k, False: 20.2k]
  ------------------
 1152|   374k|	  img.tiles[i].tileComps[comp].resLevels[r].precincts = NULL;
 1153|   374k|	}
 1154|  20.2k|      }
 1155|   114k|      for (r = 0; r <= nDecompLevels; ++r) {
  ------------------
  |  Branch (1155:19): [True: 106k, False: 7.79k]
  ------------------
 1156|   106k|	if (style & 0x01) {
  ------------------
  |  Branch (1156:6): [True: 2.15k, False: 104k]
  ------------------
 1157|  2.15k|	  if (!readUByte(&precinctSize)) {
  ------------------
  |  Branch (1157:8): [True: 340, False: 1.81k]
  ------------------
 1158|    340|	    error(errSyntaxError, getPos(), "Error in JPX COD marker segment");
 1159|    340|	    return jpxDecodeFatalError;
 1160|    340|	  }
 1161|  1.81k|	  if (r > 0 && ((precinctSize & 0x0f) == 0 ||
  ------------------
  |  Branch (1161:8): [True: 738, False: 1.07k]
  |  Branch (1161:18): [True: 237, False: 501]
  ------------------
 1162|    501|			(precinctSize & 0xf0) == 0)) {
  ------------------
  |  Branch (1162:4): [True: 60, False: 441]
  ------------------
 1163|    297|	    error(errSyntaxError, getPos(),
 1164|    297|		  "Invalid precinct size in JPX COD marker segment");
 1165|    297|	    return jpxDecodeFatalError;
 1166|    297|	  }
 1167|  1.51k|	  img.tiles[0].tileComps[comp].resLevels[r].precinctWidth =
 1168|  1.51k|	      precinctSize & 0x0f;
 1169|  1.51k|	  img.tiles[0].tileComps[comp].resLevels[r].precinctHeight =
 1170|  1.51k|	      (precinctSize >> 4) & 0x0f;
 1171|   104k|	} else {
 1172|   104k|	  img.tiles[0].tileComps[comp].resLevels[r].precinctWidth = 15;
 1173|   104k|	  img.tiles[0].tileComps[comp].resLevels[r].precinctHeight = 15;
 1174|   104k|	}
 1175|   106k|      }
 1176|  17.9k|      for (i = 1; i < img.nXTiles * img.nYTiles; ++i) {
  ------------------
  |  Branch (1176:19): [True: 10.1k, False: 7.79k]
  ------------------
 1177|   274k|	for (r = 0; r <= img.tiles[i].tileComps[comp].nDecompLevels; ++r) {
  ------------------
  |  Branch (1177:14): [True: 264k, False: 10.1k]
  ------------------
 1178|   264k|	  img.tiles[i].tileComps[comp].resLevels[r].precinctWidth =
 1179|   264k|	      img.tiles[0].tileComps[comp].resLevels[r].precinctWidth;
 1180|   264k|	  img.tiles[i].tileComps[comp].resLevels[r].precinctHeight =
 1181|   264k|	      img.tiles[0].tileComps[comp].resLevels[r].precinctHeight;
 1182|   264k|	}
 1183|  10.1k|      }
 1184|  7.79k|      break;
 1185|  38.4k|    case 0x5c:			// QCD - quantization default
  ------------------
  |  Branch (1185:5): [True: 38.4k, False: 390k]
  ------------------
 1186|  38.4k|      cover(23);
 1187|  38.4k|      if (!haveSIZ) {
  ------------------
  |  Branch (1187:11): [True: 0, False: 38.4k]
  ------------------
 1188|      0|	error(errSyntaxError, getPos(),
 1189|      0|	      "JPX QCD marker segment before SIZ segment");
 1190|      0|	return jpxDecodeFatalError;
 1191|      0|      }
 1192|  38.4k|      if (!readUByte(&img.tiles[0].tileComps[0].quantStyle)) {
  ------------------
  |  Branch (1192:11): [True: 180, False: 38.3k]
  ------------------
 1193|    180|	error(errSyntaxError, getPos(), "Error in JPX QCD marker segment");
 1194|    180|	return jpxDecodeFatalError;
 1195|    180|      }
 1196|  38.3k|      if ((img.tiles[0].tileComps[0].quantStyle & 0x1f) == 0x00) {
  ------------------
  |  Branch (1196:11): [True: 12.3k, False: 25.9k]
  ------------------
 1197|  12.3k|	if (segLen <= 3) {
  ------------------
  |  Branch (1197:6): [True: 142, False: 12.2k]
  ------------------
 1198|    142|	  error(errSyntaxError, getPos(), "Error in JPX QCD marker segment");
 1199|    142|	  return jpxDecodeFatalError;
 1200|    142|	}
 1201|  12.2k|	img.tiles[0].tileComps[0].nQuantSteps = segLen - 3;
 1202|  12.2k|	img.tiles[0].tileComps[0].quantSteps =
 1203|  12.2k|	    (Guint *)greallocn(img.tiles[0].tileComps[0].quantSteps,
 1204|  12.2k|			       img.tiles[0].tileComps[0].nQuantSteps,
 1205|  12.2k|			       sizeof(Guint));
 1206|   413k|	for (i = 0; i < img.tiles[0].tileComps[0].nQuantSteps; ++i) {
  ------------------
  |  Branch (1206:14): [True: 401k, False: 12.0k]
  ------------------
 1207|   401k|	  if (!readUByte(&img.tiles[0].tileComps[0].quantSteps[i])) {
  ------------------
  |  Branch (1207:8): [True: 181, False: 401k]
  ------------------
 1208|    181|	    error(errSyntaxError, getPos(), "Error in JPX QCD marker segment");
 1209|    181|	    return jpxDecodeFatalError;
 1210|    181|	  }
 1211|   401k|	}
 1212|  25.9k|      } else if ((img.tiles[0].tileComps[0].quantStyle & 0x1f) == 0x01) {
  ------------------
  |  Branch (1212:18): [True: 1.07k, False: 24.8k]
  ------------------
 1213|  1.07k|	img.tiles[0].tileComps[0].nQuantSteps = 1;
 1214|  1.07k|	img.tiles[0].tileComps[0].quantSteps =
 1215|  1.07k|	    (Guint *)greallocn(img.tiles[0].tileComps[0].quantSteps,
 1216|  1.07k|			       img.tiles[0].tileComps[0].nQuantSteps,
 1217|  1.07k|			       sizeof(Guint));
 1218|  1.07k|	if (!readUWord(&img.tiles[0].tileComps[0].quantSteps[0])) {
  ------------------
  |  Branch (1218:6): [True: 383, False: 695]
  ------------------
 1219|    383|	  error(errSyntaxError, getPos(), "Error in JPX QCD marker segment");
 1220|    383|	  return jpxDecodeFatalError;
 1221|    383|	}
 1222|  24.8k|      } else if ((img.tiles[0].tileComps[0].quantStyle & 0x1f) == 0x02) {
  ------------------
  |  Branch (1222:18): [True: 24.6k, False: 141]
  ------------------
 1223|  24.6k|	if (segLen < 5) {
  ------------------
  |  Branch (1223:6): [True: 133, False: 24.5k]
  ------------------
 1224|    133|	  error(errSyntaxError, getPos(), "Error in JPX QCD marker segment");
 1225|    133|	  return jpxDecodeFatalError;
 1226|    133|	}
 1227|  24.5k|	img.tiles[0].tileComps[0].nQuantSteps = (segLen - 3) / 2;
 1228|  24.5k|	img.tiles[0].tileComps[0].quantSteps =
 1229|  24.5k|	    (Guint *)greallocn(img.tiles[0].tileComps[0].quantSteps,
 1230|  24.5k|			       img.tiles[0].tileComps[0].nQuantSteps,
 1231|  24.5k|			       sizeof(Guint));
 1232|   939k|	for (i = 0; i < img.tiles[0].tileComps[0].nQuantSteps; ++i) {
  ------------------
  |  Branch (1232:14): [True: 915k, False: 24.0k]
  ------------------
 1233|   915k|	  if (!readUWord(&img.tiles[0].tileComps[0].quantSteps[i])) {
  ------------------
  |  Branch (1233:8): [True: 454, False: 914k]
  ------------------
 1234|    454|	    error(errSyntaxError, getPos(), "Error in JPX QCD marker segment");
 1235|    454|	    return jpxDecodeFatalError;
 1236|    454|	  }
 1237|   915k|	}
 1238|  24.5k|      } else {
 1239|    141|	error(errSyntaxError, getPos(), "Error in JPX QCD marker segment");
 1240|    141|	return jpxDecodeFatalError;
 1241|    141|      }
 1242|   790k|      for (i = 0; i < img.nXTiles * img.nYTiles; ++i) {
  ------------------
  |  Branch (1242:19): [True: 753k, False: 36.8k]
  ------------------
 1243|  5.02M|	for (comp = 0; comp < img.nComps; ++comp) {
  ------------------
  |  Branch (1243:17): [True: 4.26M, False: 753k]
  ------------------
 1244|  4.26M|	  if (!(i == 0 && comp == 0)) {
  ------------------
  |  Branch (1244:10): [True: 727k, False: 3.54M]
  |  Branch (1244:20): [True: 36.8k, False: 690k]
  ------------------
 1245|  4.23M|	    img.tiles[i].tileComps[comp].quantStyle =
 1246|  4.23M|	        img.tiles[0].tileComps[0].quantStyle;
 1247|  4.23M|	    img.tiles[i].tileComps[comp].nQuantSteps =
 1248|  4.23M|	        img.tiles[0].tileComps[0].nQuantSteps;
 1249|  4.23M|	    img.tiles[i].tileComps[comp].quantSteps = 
 1250|  4.23M|	        (Guint *)greallocn(img.tiles[i].tileComps[comp].quantSteps,
 1251|  4.23M|				   img.tiles[0].tileComps[0].nQuantSteps,
 1252|  4.23M|				   sizeof(Guint));
 1253|  96.5M|	    for (j = 0; j < img.tiles[0].tileComps[0].nQuantSteps; ++j) {
  ------------------
  |  Branch (1253:18): [True: 92.3M, False: 4.23M]
  ------------------
 1254|  92.3M|	      img.tiles[i].tileComps[comp].quantSteps[j] =
 1255|  92.3M|		  img.tiles[0].tileComps[0].quantSteps[j];
 1256|  92.3M|	    }
 1257|  4.23M|	  }
 1258|  4.26M|	}
 1259|   753k|      }
 1260|  36.8k|      haveQCD = gTrue;
  ------------------
  |  |   17|  36.8k|#define gTrue 1
  ------------------
 1261|  36.8k|      break;
 1262|  4.30k|    case 0x5d:			// QCC - quantization component
  ------------------
  |  Branch (1262:5): [True: 4.30k, False: 424k]
  ------------------
 1263|  4.30k|      cover(24);
 1264|  4.30k|      if (!haveQCD) {
  ------------------
  |  Branch (1264:11): [True: 204, False: 4.09k]
  ------------------
 1265|    204|	error(errSyntaxError, getPos(),
 1266|    204|	      "JPX QCC marker segment before QCD segment");
 1267|    204|	return jpxDecodeFatalError;
 1268|    204|      }
 1269|  4.09k|      comp = 0;
 1270|  4.09k|      if ((img.nComps > 256 && !readUWord(&comp)) ||
  ------------------
  |  Branch (1270:12): [True: 786, False: 3.31k]
  |  Branch (1270:32): [True: 159, False: 627]
  ------------------
 1271|  3.93k|	  (img.nComps <= 256 && !readUByte(&comp)) ||
  ------------------
  |  Branch (1271:5): [True: 3.31k, False: 627]
  |  Branch (1271:26): [True: 158, False: 3.15k]
  ------------------
 1272|  3.77k|	  comp >= img.nComps ||
  ------------------
  |  Branch (1272:4): [True: 138, False: 3.64k]
  ------------------
 1273|  3.64k|	  !readUByte(&img.tiles[0].tileComps[comp].quantStyle)) {
  ------------------
  |  Branch (1273:4): [True: 286, False: 3.35k]
  ------------------
 1274|    741|	error(errSyntaxError, getPos(), "Error in JPX QCC marker segment");
 1275|    741|	return jpxDecodeFatalError;
 1276|    741|      }
 1277|  3.35k|      if ((img.tiles[0].tileComps[comp].quantStyle & 0x1f) == 0x00) {
  ------------------
  |  Branch (1277:11): [True: 1.25k, False: 2.09k]
  ------------------
 1278|  1.25k|	if (segLen <= (img.nComps > 256 ? 5U : 4U)) {
  ------------------
  |  Branch (1278:6): [True: 269, False: 990]
  |  Branch (1278:17): [True: 525, False: 734]
  ------------------
 1279|    269|	  error(errSyntaxError, getPos(), "Error in JPX QCC marker segment");
 1280|    269|	  return jpxDecodeFatalError;
 1281|    269|	}
 1282|    990|	img.tiles[0].tileComps[comp].nQuantSteps =
 1283|    990|	    segLen - (img.nComps > 256 ? 5 : 4);
  ------------------
  |  Branch (1283:16): [True: 525, False: 465]
  ------------------
 1284|    990|	img.tiles[0].tileComps[comp].quantSteps =
 1285|    990|	    (Guint *)greallocn(img.tiles[0].tileComps[comp].quantSteps,
 1286|    990|			       img.tiles[0].tileComps[comp].nQuantSteps,
 1287|    990|			       sizeof(Guint));
 1288|   348k|	for (i = 0; i < img.tiles[0].tileComps[comp].nQuantSteps; ++i) {
  ------------------
  |  Branch (1288:14): [True: 348k, False: 808]
  ------------------
 1289|   348k|	  if (!readUByte(&img.tiles[0].tileComps[comp].quantSteps[i])) {
  ------------------
  |  Branch (1289:8): [True: 182, False: 347k]
  ------------------
 1290|    182|	    error(errSyntaxError, getPos(), "Error in JPX QCC marker segment");
 1291|    182|	    return jpxDecodeFatalError;
 1292|    182|	  }
 1293|   348k|	}
 1294|  2.09k|      } else if ((img.tiles[0].tileComps[comp].quantStyle & 0x1f) == 0x01) {
  ------------------
  |  Branch (1294:18): [True: 1.32k, False: 772]
  ------------------
 1295|  1.32k|	img.tiles[0].tileComps[comp].nQuantSteps = 1;
 1296|  1.32k|	img.tiles[0].tileComps[comp].quantSteps =
 1297|  1.32k|	    (Guint *)greallocn(img.tiles[0].tileComps[comp].quantSteps,
 1298|  1.32k|			       img.tiles[0].tileComps[comp].nQuantSteps,
 1299|  1.32k|			       sizeof(Guint));
 1300|  1.32k|	if (!readUWord(&img.tiles[0].tileComps[comp].quantSteps[0])) {
  ------------------
  |  Branch (1300:6): [True: 509, False: 815]
  ------------------
 1301|    509|	  error(errSyntaxError, getPos(), "Error in JPX QCC marker segment");
 1302|    509|	  return jpxDecodeFatalError;
 1303|    509|	}
 1304|  1.32k|      } else if ((img.tiles[0].tileComps[comp].quantStyle & 0x1f) == 0x02) {
  ------------------
  |  Branch (1304:18): [True: 573, False: 199]
  ------------------
 1305|    573|	if (segLen < (img.nComps > 256 ? 5U : 4U) + 2) {
  ------------------
  |  Branch (1305:6): [True: 155, False: 418]
  |  Branch (1305:16): [True: 33, False: 540]
  ------------------
 1306|    155|	  error(errSyntaxError, getPos(), "Error in JPX QCC marker segment");
 1307|    155|	  return jpxDecodeFatalError;
 1308|    155|	}
 1309|    418|	img.tiles[0].tileComps[comp].nQuantSteps =
 1310|    418|	    (segLen - (img.nComps > 256 ? 5 : 4)) / 2;
  ------------------
  |  Branch (1310:17): [True: 33, False: 385]
  ------------------
 1311|    418|	img.tiles[0].tileComps[comp].quantSteps =
 1312|    418|	    (Guint *)greallocn(img.tiles[0].tileComps[comp].quantSteps,
 1313|    418|			       img.tiles[0].tileComps[comp].nQuantSteps,
 1314|    418|			       sizeof(Guint));
 1315|   902k|	for (i = 0; i < img.tiles[0].tileComps[comp].nQuantSteps; ++i) {
  ------------------
  |  Branch (1315:14): [True: 902k, False: 129]
  ------------------
 1316|   902k|	  if (!readUWord(&img.tiles[0].tileComps[comp].quantSteps[i])) {
  ------------------
  |  Branch (1316:8): [True: 289, False: 901k]
  ------------------
 1317|    289|	    error(errSyntaxError, getPos(), "Error in JPX QCD marker segment");
 1318|    289|	    return jpxDecodeFatalError;
 1319|    289|	  }
 1320|   902k|	}
 1321|    418|      } else {
 1322|    199|	error(errSyntaxError, getPos(), "Error in JPX QCC marker segment");
 1323|    199|	return jpxDecodeFatalError;
 1324|    199|      }
 1325|   638k|      for (i = 1; i < img.nXTiles * img.nYTiles; ++i) {
  ------------------
  |  Branch (1325:19): [True: 637k, False: 1.75k]
  ------------------
 1326|   637k|	img.tiles[i].tileComps[comp].quantStyle =
 1327|   637k|	    img.tiles[0].tileComps[comp].quantStyle;
 1328|   637k|	img.tiles[i].tileComps[comp].nQuantSteps =
 1329|   637k|	    img.tiles[0].tileComps[comp].nQuantSteps;
 1330|   637k|	img.tiles[i].tileComps[comp].quantSteps = 
 1331|   637k|	    (Guint *)greallocn(img.tiles[i].tileComps[comp].quantSteps,
 1332|   637k|			       img.tiles[0].tileComps[comp].nQuantSteps,
 1333|   637k|			       sizeof(Guint));
 1334|  20.6M|	for (j = 0; j < img.tiles[0].tileComps[comp].nQuantSteps; ++j) {
  ------------------
  |  Branch (1334:14): [True: 20.0M, False: 637k]
  ------------------
 1335|  20.0M|	  img.tiles[i].tileComps[comp].quantSteps[j] =
 1336|  20.0M|	      img.tiles[0].tileComps[comp].quantSteps[j];
 1337|  20.0M|	}
 1338|   637k|      }
 1339|  1.75k|      break;
 1340|   137k|    case 0x5e:			// RGN - region of interest
  ------------------
  |  Branch (1340:5): [True: 137k, False: 290k]
  ------------------
 1341|   137k|      cover(25);
 1342|   137k|#if 1 //~ ROI is unimplemented
 1343|   137k|      error(errUnimplemented, -1, "got a JPX RGN segment");
 1344|   137k|      if (segLen > 2 &&
  ------------------
  |  Branch (1344:11): [True: 137k, False: 183]
  ------------------
 1345|   137k|	  bufStr->discardChars(segLen - 2) != segLen - 2) {
  ------------------
  |  Branch (1345:4): [True: 455, False: 137k]
  ------------------
 1346|    455|	error(errSyntaxError, getPos(), "Error in JPX RGN marker segment");
 1347|    455|	return jpxDecodeFatalError;
 1348|    455|      }
 1349|       |#else
 1350|       |      if ((img.nComps > 256 && !readUWord(&comp)) ||
 1351|       |	  (img.nComps <= 256 && !readUByte(&comp)) ||
 1352|       |	  comp >= img.nComps ||
 1353|       |	  !readUByte(&compInfo[comp].defROI.style) ||
 1354|       |	  !readUByte(&compInfo[comp].defROI.shift)) {
 1355|       |	error(errSyntaxError, getPos(), "Error in JPX RGN marker segment");
 1356|       |	return jpxDecodeFatalError;
 1357|       |      }
 1358|       |#endif
 1359|   137k|      break;
 1360|   137k|    case 0x5f:			// POC - progression order change
  ------------------
  |  Branch (1360:5): [True: 7.04k, False: 421k]
  ------------------
 1361|  7.04k|      cover(26);
 1362|  7.04k|#if 1 //~ progression order changes are unimplemented
 1363|  7.04k|      error(errUnimplemented, -1, "got a JPX POC segment");
 1364|  7.04k|      if (segLen > 2 &&
  ------------------
  |  Branch (1364:11): [True: 3.99k, False: 3.04k]
  ------------------
 1365|  3.99k|	  bufStr->discardChars(segLen - 2) != segLen - 2) {
  ------------------
  |  Branch (1365:4): [True: 133, False: 3.86k]
  ------------------
 1366|    133|	error(errSyntaxError, getPos(), "Error in JPX POC marker segment");
 1367|    133|	return jpxDecodeFatalError;
 1368|    133|      }
 1369|       |#else
 1370|       |      nProgs = (segLen - 2) / (img.nComps > 256 ? 9 : 7);
 1371|       |      progs = (JPXProgOrder *)gmallocn(nProgs, sizeof(JPXProgOrder));
 1372|       |      for (i = 0; i < nProgs; ++i) {
 1373|       |	if (!readUByte(&progs[i].startRes) ||
 1374|       |	    !(img.nComps > 256 && readUWord(&progs[i].startComp)) ||
 1375|       |	    !(img.nComps <= 256 && readUByte(&progs[i].startComp)) ||
 1376|       |	    !readUWord(&progs[i].endLayer) ||
 1377|       |	    !readUByte(&progs[i].endRes) ||
 1378|       |	    !(img.nComps > 256 && readUWord(&progs[i].endComp)) ||
 1379|       |	    !(img.nComps <= 256 && readUByte(&progs[i].endComp)) ||
 1380|       |	    !readUByte(&progs[i].progOrder)) {
 1381|       |	  error(errSyntaxError, getPos(), "Error in JPX POC marker segment");
 1382|       |	  return jpxDecodeFatalError;
 1383|       |	}
 1384|       |      }
 1385|       |#endif
 1386|  6.91k|      break;
 1387|  6.91k|    case 0x60:			// PPM - packed packet headers, main header
  ------------------
  |  Branch (1387:5): [True: 5.52k, False: 423k]
  ------------------
 1388|  5.52k|      cover(27);
 1389|  5.52k|#if 1 //~ packed packet headers are unimplemented
 1390|  5.52k|      error(errUnimplemented, -1, "Got a JPX PPM segment");
 1391|  5.52k|      if (segLen > 2 &&
  ------------------
  |  Branch (1391:11): [True: 5.38k, False: 138]
  ------------------
 1392|  5.38k|	  bufStr->discardChars(segLen - 2) != segLen - 2) {
  ------------------
  |  Branch (1392:4): [True: 322, False: 5.06k]
  ------------------
 1393|    322|	error(errSyntaxError, getPos(), "Error in JPX PPM marker segment");
 1394|    322|	return jpxDecodeFatalError;
 1395|    322|      }
 1396|  5.20k|#endif
 1397|  5.20k|      break;
 1398|  5.20k|    case 0x55:			// TLM - tile-part lengths
  ------------------
  |  Branch (1398:5): [True: 791, False: 427k]
  ------------------
 1399|       |      // skipped
 1400|    791|      cover(28);
 1401|    791|      if (segLen > 2 &&
  ------------------
  |  Branch (1401:11): [True: 533, False: 258]
  ------------------
 1402|    533|	  bufStr->discardChars(segLen - 2) != segLen - 2) {
  ------------------
  |  Branch (1402:4): [True: 130, False: 403]
  ------------------
 1403|    130|	error(errSyntaxError, getPos(), "Error in JPX TLM marker segment");
 1404|    130|	return jpxDecodeFatalError;
 1405|    130|      }
 1406|    661|      break;
 1407|    661|    case 0x57:			// PLM - packet length, main header
  ------------------
  |  Branch (1407:5): [True: 543, False: 427k]
  ------------------
 1408|       |      // skipped
 1409|    543|      cover(29);
 1410|    543|      if (segLen > 2 &&
  ------------------
  |  Branch (1410:11): [True: 306, False: 237]
  ------------------
 1411|    306|	  bufStr->discardChars(segLen - 2) != segLen - 2) {
  ------------------
  |  Branch (1411:4): [True: 170, False: 136]
  ------------------
 1412|    170|	error(errSyntaxError, getPos(), "Error in JPX PLM marker segment");
 1413|    170|	return jpxDecodeFatalError;
 1414|    170|      }
 1415|    373|      break;
 1416|    373|    case 0x63:			// CRG - component registration
  ------------------
  |  Branch (1416:5): [True: 322, False: 428k]
  ------------------
 1417|       |      // skipped
 1418|    322|      cover(30);
 1419|    322|      if (segLen > 2 &&
  ------------------
  |  Branch (1419:11): [True: 298, False: 24]
  ------------------
 1420|    298|	  bufStr->discardChars(segLen - 2) != segLen - 2) {
  ------------------
  |  Branch (1420:4): [True: 158, False: 140]
  ------------------
 1421|    158|	error(errSyntaxError, getPos(), "Error in JPX CRG marker segment");
 1422|    158|	return jpxDecodeFatalError;
 1423|    158|      }
 1424|    164|      break;
 1425|    492|    case 0x64:			// COM - comment
  ------------------
  |  Branch (1425:5): [True: 492, False: 428k]
  ------------------
 1426|       |      // skipped
 1427|    492|      cover(31);
 1428|    492|      if (segLen > 2 &&
  ------------------
  |  Branch (1428:11): [True: 437, False: 55]
  ------------------
 1429|    437|	  bufStr->discardChars(segLen - 2) != segLen - 2) {
  ------------------
  |  Branch (1429:4): [True: 131, False: 306]
  ------------------
 1430|    131|	error(errSyntaxError, getPos(), "Error in JPX COM marker segment");
 1431|    131|	return jpxDecodeFatalError;
 1432|    131|      }
 1433|    361|      break;
 1434|  27.8k|    case 0x90:			// SOT - start of tile
  ------------------
  |  Branch (1434:5): [True: 27.8k, False: 400k]
  ------------------
 1435|  27.8k|      cover(32);
 1436|  27.8k|      haveSOT = gTrue;
  ------------------
  |  |   17|  27.8k|#define gTrue 1
  ------------------
 1437|  27.8k|      break;
 1438|  42.7k|    default:
  ------------------
  |  Branch (1438:5): [True: 42.7k, False: 385k]
  ------------------
 1439|  42.7k|      cover(33);
 1440|  42.7k|      error(errSyntaxError, getPos(),
 1441|  42.7k|	    "Unknown marker segment {0:02x} in JPX stream", segType);
 1442|  42.7k|      if (segLen > 2) {
  ------------------
  |  Branch (1442:11): [True: 19.5k, False: 23.1k]
  ------------------
 1443|  19.5k|	bufStr->discardChars(segLen - 2);
 1444|  19.5k|      }
 1445|  42.7k|      break;
 1446|   428k|    }
 1447|   428k|  } while (!haveSOT);
  ------------------
  |  Branch (1447:12): [True: 363k, False: 27.8k]
  ------------------
 1448|       |
 1449|  27.8k|  if (!haveSIZ) {
  ------------------
  |  Branch (1449:7): [True: 178, False: 27.7k]
  ------------------
 1450|    178|    error(errSyntaxError, getPos(),
 1451|    178|	  "Missing SIZ marker segment in JPX stream");
 1452|    178|    return jpxDecodeFatalError;
 1453|    178|  }
 1454|  27.7k|  if (!haveCOD) {
  ------------------
  |  Branch (1454:7): [True: 277, False: 27.4k]
  ------------------
 1455|    277|    error(errSyntaxError, getPos(),
 1456|    277|	  "Missing COD marker segment in JPX stream");
 1457|    277|    return jpxDecodeFatalError;
 1458|    277|  }
 1459|  27.4k|  if (!haveQCD) {
  ------------------
  |  Branch (1459:7): [True: 136, False: 27.2k]
  ------------------
 1460|    136|    error(errSyntaxError, getPos(),
 1461|    136|	  "Missing QCD marker segment in JPX stream");
 1462|    136|    return jpxDecodeFatalError;
 1463|    136|  }
 1464|       |
 1465|       |  //----- read the tile-parts
 1466|  27.2k|  ok = gTrue;
  ------------------
  |  |   17|  27.2k|#define gTrue 1
  ------------------
 1467|  28.5k|  while (1) {
  ------------------
  |  Branch (1467:10): [True: 28.5k, Folded]
  ------------------
 1468|  28.5k|    if (!readTilePart()) {
  ------------------
  |  Branch (1468:9): [True: 24.1k, False: 4.40k]
  ------------------
 1469|  24.1k|      ok = gFalse;
  ------------------
  |  |   18|  24.1k|#define gFalse 0
  ------------------
 1470|  24.1k|      break;
 1471|  24.1k|    }
 1472|  4.40k|    if (!readMarkerHdr(&segType, &segLen)) {
  ------------------
  |  Branch (1472:9): [True: 1.40k, False: 2.99k]
  ------------------
 1473|  1.40k|      error(errSyntaxError, getPos(), "Error in JPX codestream");
 1474|  1.40k|      ok = gFalse;
  ------------------
  |  |   18|  1.40k|#define gFalse 0
  ------------------
 1475|  1.40k|      break;
 1476|  1.40k|    }
 1477|  2.99k|    if (segType != 0x90) {	// SOT - start of tile
  ------------------
  |  Branch (1477:9): [True: 1.69k, False: 1.30k]
  ------------------
 1478|  1.69k|      break;
 1479|  1.69k|    }
 1480|  2.99k|  }
 1481|       |
 1482|  27.2k|  if (segType != 0xd9) {	// EOC - end of codestream
  ------------------
  |  Branch (1482:7): [True: 26.9k, False: 353]
  ------------------
 1483|  26.9k|    error(errSyntaxError, getPos(), "Missing EOC marker in JPX codestream");
 1484|  26.9k|    ok = gFalse;
  ------------------
  |  |   18|  26.9k|#define gFalse 0
  ------------------
 1485|  26.9k|  }
 1486|       |
 1487|       |  //----- finish decoding the image
 1488|  33.6k|  for (i = 0; i < img.nXTiles * img.nYTiles; ++i) {
  ------------------
  |  Branch (1488:15): [True: 27.5k, False: 6.14k]
  ------------------
 1489|  27.5k|    tile = &img.tiles[i];
 1490|  27.5k|    if (!tile->init) {
  ------------------
  |  Branch (1490:9): [True: 17.0k, False: 10.4k]
  ------------------
 1491|  17.0k|      error(errSyntaxError, getPos(), "Uninitialized tile in JPX codestream");
 1492|  17.0k|      return jpxDecodeFatalError;
 1493|  17.0k|    }
 1494|  70.7k|    for (comp = 0; comp < img.nComps; ++comp) {
  ------------------
  |  Branch (1494:20): [True: 60.2k, False: 10.4k]
  ------------------
 1495|  60.2k|      tileComp = &tile->tileComps[comp];
 1496|  60.2k|      inverseTransform(tileComp);
 1497|  60.2k|    }
 1498|  10.4k|    if (!inverseMultiCompAndDC(tile)) {
  ------------------
  |  Branch (1498:9): [True: 4.08k, False: 6.37k]
  ------------------
 1499|  4.08k|      return jpxDecodeFatalError;
 1500|  4.08k|    }
 1501|  10.4k|  }
 1502|       |
 1503|       |  //~ can free memory below tileComps here, and also tileComp.buf
 1504|       |
 1505|  6.14k|  return ok ? jpxDecodeOk : jpxDecodeNonFatalError;
  ------------------
  |  Branch (1505:10): [True: 313, False: 5.83k]
  ------------------
 1506|  27.2k|}
_ZN9JPXStream12readTilePartEv:
 1508|  28.5k|GBool JPXStream::readTilePart() {
 1509|  28.5k|  JPXTile *tile;
 1510|  28.5k|  JPXTileComp *tileComp;
 1511|  28.5k|  JPXResLevel *resLevel;
 1512|  28.5k|  JPXPrecinct *precinct;
 1513|  28.5k|  JPXSubband *subband;
 1514|  28.5k|  JPXCodeBlock *cb;
 1515|  28.5k|  int *sbCoeffs;
 1516|  28.5k|  GBool haveSOD;
 1517|  28.5k|  Guint tileIdx, tilePartLen, tilePartIdx, nTileParts;
 1518|  28.5k|  GBool tilePartToEOC;
 1519|  28.5k|  Guint style, progOrder, nLayers, multiComp, nDecompLevels;
 1520|  28.5k|  Guint codeBlockW, codeBlockH, codeBlockStyle, transform;
 1521|  28.5k|  Guint precinctSize, qStyle;
 1522|  28.5k|  Guint px0, py0, px1, py1;
 1523|  28.5k|  Guint preCol0, preCol1, preRow0, preRow1, preCol, preRow;
 1524|  28.5k|  Guint cbCol0, cbCol1, cbRow0, cbRow1, cbX, cbY;
 1525|  28.5k|  Guint n, nSBs, nx, ny, comp, segLen;
 1526|  28.5k|  Guint i, j, k, r, pre, sb, cbi, cbj;
 1527|  28.5k|  int segType, level;
 1528|       |
 1529|       |  // process the SOT marker segment
 1530|  28.5k|  if (!readUWord(&tileIdx) ||
  ------------------
  |  Branch (1530:7): [True: 553, False: 28.0k]
  ------------------
 1531|  28.0k|      !readULong(&tilePartLen) ||
  ------------------
  |  Branch (1531:7): [True: 1.05k, False: 26.9k]
  ------------------
 1532|  26.9k|      !readUByte(&tilePartIdx) ||
  ------------------
  |  Branch (1532:7): [True: 186, False: 26.8k]
  ------------------
 1533|  26.8k|      !readUByte(&nTileParts)) {
  ------------------
  |  Branch (1533:7): [True: 259, False: 26.5k]
  ------------------
 1534|  2.04k|    error(errSyntaxError, getPos(), "Error in JPX SOT marker segment");
 1535|  2.04k|    return gFalse;
  ------------------
  |  |   18|  2.04k|#define gFalse 0
  ------------------
 1536|  2.04k|  }
 1537|       |
 1538|       |  // check tileIdx and tilePartIdx
 1539|       |  // (this ignores nTileParts, because some encoders get it wrong)
 1540|  26.5k|  if (tileIdx >= img.nXTiles * img.nYTiles ||
  ------------------
  |  Branch (1540:7): [True: 129, False: 26.4k]
  ------------------
 1541|  26.4k|      tilePartIdx != img.tiles[tileIdx].nextTilePart ||
  ------------------
  |  Branch (1541:7): [True: 130, False: 26.2k]
  ------------------
 1542|  26.2k|      (tilePartIdx > 0 && !img.tiles[tileIdx].init) ||
  ------------------
  |  Branch (1542:8): [True: 1.30k, False: 24.9k]
  |  Branch (1542:27): [True: 0, False: 1.30k]
  ------------------
 1543|  26.2k|      (tilePartIdx == 0 && img.tiles[tileIdx].init)) {
  ------------------
  |  Branch (1543:8): [True: 24.9k, False: 1.30k]
  |  Branch (1543:28): [True: 0, False: 24.9k]
  ------------------
 1544|    259|    error(errSyntaxError, getPos(), "Weird tile-part header in JPX stream");
 1545|    259|    return gFalse;
  ------------------
  |  |   18|    259|#define gFalse 0
  ------------------
 1546|    259|  }
 1547|  26.2k|  ++img.tiles[tileIdx].nextTilePart;
 1548|       |
 1549|  26.2k|  tilePartToEOC = tilePartLen == 0;
 1550|  26.2k|  tilePartLen -= 12; // subtract size of SOT segment
 1551|       |
 1552|  26.2k|  haveSOD = gFalse;
  ------------------
  |  |   18|  26.2k|#define gFalse 0
  ------------------
 1553|   140k|  do {
 1554|   140k|    if (!readMarkerHdr(&segType, &segLen)) {
  ------------------
  |  Branch (1554:9): [True: 1.75k, False: 138k]
  ------------------
 1555|  1.75k|      error(errSyntaxError, getPos(), "Error in JPX tile-part codestream");
 1556|  1.75k|      return gFalse;
  ------------------
  |  |   18|  1.75k|#define gFalse 0
  ------------------
 1557|  1.75k|    }
 1558|   138k|    tilePartLen -= 2 + segLen;
 1559|   138k|    switch (segType) {
 1560|  13.6k|    case 0x52:			// COD - coding style default
  ------------------
  |  Branch (1560:5): [True: 13.6k, False: 125k]
  ------------------
 1561|  13.6k|      cover(34);
 1562|  13.6k|      if (tilePartIdx != 0) {
  ------------------
  |  Branch (1562:11): [True: 141, False: 13.5k]
  ------------------
 1563|    141|	error(errSyntaxError, getPos(), "Extraneous JPX COD marker segment");
 1564|    141|	return gFalse;
  ------------------
  |  |   18|    141|#define gFalse 0
  ------------------
 1565|    141|      }
 1566|  13.5k|      if (!readUByte(&style) ||
  ------------------
  |  Branch (1566:11): [True: 180, False: 13.3k]
  ------------------
 1567|  13.3k|	  !readUByte(&progOrder) ||
  ------------------
  |  Branch (1567:4): [True: 128, False: 13.1k]
  ------------------
 1568|  13.1k|	  !readUWord(&nLayers) ||
  ------------------
  |  Branch (1568:4): [True: 322, False: 12.8k]
  ------------------
 1569|  12.8k|	  !readUByte(&multiComp) ||
  ------------------
  |  Branch (1569:4): [True: 288, False: 12.5k]
  ------------------
 1570|  12.5k|	  !readUByte(&nDecompLevels) ||
  ------------------
  |  Branch (1570:4): [True: 281, False: 12.3k]
  ------------------
 1571|  12.3k|	  !readUByte(&codeBlockW) ||
  ------------------
  |  Branch (1571:4): [True: 192, False: 12.1k]
  ------------------
 1572|  12.1k|	  !readUByte(&codeBlockH) ||
  ------------------
  |  Branch (1572:4): [True: 162, False: 11.9k]
  ------------------
 1573|  11.9k|	  !readUByte(&codeBlockStyle) ||
  ------------------
  |  Branch (1573:4): [True: 251, False: 11.7k]
  ------------------
 1574|  11.7k|	  !readUByte(&transform)) {
  ------------------
  |  Branch (1574:4): [True: 233, False: 11.4k]
  ------------------
 1575|  2.03k|	error(errSyntaxError, getPos(), "Error in JPX COD marker segment");
 1576|  2.03k|	return gFalse;
  ------------------
  |  |   18|  2.03k|#define gFalse 0
  ------------------
 1577|  2.03k|      }
 1578|  11.4k|      if (nDecompLevels < 1 ||
  ------------------
  |  Branch (1578:11): [True: 4, False: 11.4k]
  ------------------
 1579|  11.4k|	  nDecompLevels > 31 ||
  ------------------
  |  Branch (1579:4): [True: 136, False: 11.3k]
  ------------------
 1580|  11.3k|	  codeBlockW > 8 ||
  ------------------
  |  Branch (1580:4): [True: 169, False: 11.1k]
  ------------------
 1581|  11.1k|	  codeBlockH > 8) {
  ------------------
  |  Branch (1581:4): [True: 2, False: 11.1k]
  ------------------
 1582|    311|	error(errSyntaxError, getPos(), "Error in JPX COD marker segment");
 1583|    311|	return gFalse;
  ------------------
  |  |   18|    311|#define gFalse 0
  ------------------
 1584|    311|      }
 1585|  11.1k|      codeBlockW += 2;
 1586|  11.1k|      codeBlockH += 2;
 1587|  11.1k|      img.tiles[tileIdx].progOrder = progOrder;
 1588|  11.1k|      img.tiles[tileIdx].nLayers = nLayers;
 1589|  11.1k|      img.tiles[tileIdx].multiComp = multiComp;
 1590|   159k|      for (comp = 0; comp < img.nComps; ++comp) {
  ------------------
  |  Branch (1590:22): [True: 148k, False: 11.1k]
  ------------------
 1591|   148k|	img.tiles[tileIdx].tileComps[comp].style = style;
 1592|   148k|	img.tiles[tileIdx].tileComps[comp].nDecompLevels = nDecompLevels;
 1593|   148k|	img.tiles[tileIdx].tileComps[comp].codeBlockW = codeBlockW;
 1594|   148k|	img.tiles[tileIdx].tileComps[comp].codeBlockH = codeBlockH;
 1595|   148k|	img.tiles[tileIdx].tileComps[comp].codeBlockStyle = codeBlockStyle;
 1596|   148k|	img.tiles[tileIdx].tileComps[comp].transform = transform;
 1597|   148k|	img.tiles[tileIdx].tileComps[comp].resLevels =
 1598|   148k|	    (JPXResLevel *)greallocn(
 1599|   148k|		     img.tiles[tileIdx].tileComps[comp].resLevels,
 1600|   148k|		     nDecompLevels + 1,
 1601|   148k|		     sizeof(JPXResLevel));
 1602|   587k|	for (r = 0; r <= nDecompLevels; ++r) {
  ------------------
  |  Branch (1602:14): [True: 439k, False: 148k]
  ------------------
 1603|   439k|	  img.tiles[tileIdx].tileComps[comp].resLevels[r].precincts = NULL;
 1604|   439k|	}
 1605|   148k|      }
 1606|  42.1k|      for (r = 0; r <= nDecompLevels; ++r) {
  ------------------
  |  Branch (1606:19): [True: 31.4k, False: 10.7k]
  ------------------
 1607|  31.4k|	if (style & 0x01) {
  ------------------
  |  Branch (1607:6): [True: 1.27k, False: 30.1k]
  ------------------
 1608|  1.27k|	  if (!readUByte(&precinctSize)) {
  ------------------
  |  Branch (1608:8): [True: 248, False: 1.02k]
  ------------------
 1609|    248|	    error(errSyntaxError, getPos(), "Error in JPX COD marker segment");
 1610|    248|	    return gFalse;
  ------------------
  |  |   18|    248|#define gFalse 0
  ------------------
 1611|    248|	  }
 1612|  1.02k|	  if (r > 0 && ((precinctSize & 0x0f) == 0 ||
  ------------------
  |  Branch (1612:8): [True: 602, False: 425]
  |  Branch (1612:18): [True: 177, False: 425]
  ------------------
 1613|    425|			(precinctSize & 0xf0) == 0)) {
  ------------------
  |  Branch (1613:4): [True: 0, False: 425]
  ------------------
 1614|    177|	    error(errSyntaxError, getPos(),
 1615|    177|		  "Invalid precinct size in JPX COD marker segment");
 1616|    177|	    return gFalse;
  ------------------
  |  |   18|    177|#define gFalse 0
  ------------------
 1617|    177|	  }
 1618|    850|	  img.tiles[tileIdx].tileComps[0].resLevels[r].precinctWidth =
 1619|    850|	      precinctSize & 0x0f;
 1620|    850|	  img.tiles[tileIdx].tileComps[0].resLevels[r].precinctHeight =
 1621|    850|	      (precinctSize >> 4) & 0x0f;
 1622|  30.1k|	} else {
 1623|  30.1k|	  img.tiles[tileIdx].tileComps[0].resLevels[r].precinctWidth = 15;
 1624|  30.1k|	  img.tiles[tileIdx].tileComps[0].resLevels[r].precinctHeight = 15;
 1625|  30.1k|	}
 1626|  31.4k|      }
 1627|   147k|      for (comp = 1; comp < img.nComps; ++comp) {
  ------------------
  |  Branch (1627:22): [True: 136k, False: 10.7k]
  ------------------
 1628|   541k|	for (r = 0; r <= nDecompLevels; ++r) {
  ------------------
  |  Branch (1628:14): [True: 405k, False: 136k]
  ------------------
 1629|   405k|	  img.tiles[tileIdx].tileComps[comp].resLevels[r].precinctWidth =
 1630|   405k|	      img.tiles[tileIdx].tileComps[0].resLevels[r].precinctWidth;
 1631|   405k|	  img.tiles[tileIdx].tileComps[comp].resLevels[r].precinctHeight =
 1632|   405k|	      img.tiles[tileIdx].tileComps[0].resLevels[r].precinctHeight;
 1633|   405k|	}
 1634|   136k|      }
 1635|  10.7k|      break;
 1636|  33.1k|    case 0x53:			// COC - coding style component
  ------------------
  |  Branch (1636:5): [True: 33.1k, False: 105k]
  ------------------
 1637|  33.1k|      cover(35);
 1638|  33.1k|      if (tilePartIdx != 0) {
  ------------------
  |  Branch (1638:11): [True: 230, False: 32.9k]
  ------------------
 1639|    230|	error(errSyntaxError, getPos(), "Extraneous JPX COC marker segment");
 1640|    230|	return gFalse;
  ------------------
  |  |   18|    230|#define gFalse 0
  ------------------
 1641|    230|      }
 1642|  32.9k|      comp = 0;
 1643|  32.9k|      if ((img.nComps > 256 && !readUWord(&comp)) ||
  ------------------
  |  Branch (1643:12): [True: 538, False: 32.3k]
  |  Branch (1643:32): [True: 319, False: 219]
  ------------------
 1644|  32.5k|	  (img.nComps <= 256 && !readUByte(&comp)) ||
  ------------------
  |  Branch (1644:5): [True: 32.3k, False: 219]
  |  Branch (1644:26): [True: 265, False: 32.1k]
  ------------------
 1645|  32.3k|	  comp >= img.nComps ||
  ------------------
  |  Branch (1645:4): [True: 200, False: 32.1k]
  ------------------
 1646|  32.1k|	  !readUByte(&style) ||
  ------------------
  |  Branch (1646:4): [True: 291, False: 31.8k]
  ------------------
 1647|  31.8k|	  !readUByte(&nDecompLevels) ||
  ------------------
  |  Branch (1647:4): [True: 295, False: 31.5k]
  ------------------
 1648|  31.5k|	  !readUByte(&codeBlockW) ||
  ------------------
  |  Branch (1648:4): [True: 274, False: 31.2k]
  ------------------
 1649|  31.2k|	  !readUByte(&codeBlockH) ||
  ------------------
  |  Branch (1649:4): [True: 289, False: 30.9k]
  ------------------
 1650|  30.9k|	  !readUByte(&codeBlockStyle) ||
  ------------------
  |  Branch (1650:4): [True: 260, False: 30.7k]
  ------------------
 1651|  30.7k|	  !readUByte(&transform)) {
  ------------------
  |  Branch (1651:4): [True: 298, False: 30.4k]
  ------------------
 1652|  2.49k|	error(errSyntaxError, getPos(), "Error in JPX COC marker segment");
 1653|  2.49k|	return gFalse;
  ------------------
  |  |   18|  2.49k|#define gFalse 0
  ------------------
 1654|  2.49k|      }
 1655|  30.4k|      if (nDecompLevels < 1 ||
  ------------------
  |  Branch (1655:11): [True: 380, False: 30.0k]
  ------------------
 1656|  30.0k|	  nDecompLevels > 31 ||
  ------------------
  |  Branch (1656:4): [True: 87, False: 29.9k]
  ------------------
 1657|  29.9k|	  codeBlockW > 8 ||
  ------------------
  |  Branch (1657:4): [True: 96, False: 29.8k]
  ------------------
 1658|  29.8k|	  codeBlockH > 8) {
  ------------------
  |  Branch (1658:4): [True: 125, False: 29.7k]
  ------------------
 1659|    688|	error(errSyntaxError, getPos(), "Error in JPX COC marker segment");
 1660|    688|	return gFalse;
  ------------------
  |  |   18|    688|#define gFalse 0
  ------------------
 1661|    688|      }
 1662|  29.7k|      img.tiles[tileIdx].tileComps[comp].style =
 1663|  29.7k|	  (img.tiles[tileIdx].tileComps[comp].style & ~1) | (style & 1);
 1664|  29.7k|      img.tiles[tileIdx].tileComps[comp].nDecompLevels = nDecompLevels;
 1665|  29.7k|      img.tiles[tileIdx].tileComps[comp].codeBlockW = codeBlockW + 2;
 1666|  29.7k|      img.tiles[tileIdx].tileComps[comp].codeBlockH = codeBlockH + 2;
 1667|  29.7k|      img.tiles[tileIdx].tileComps[comp].codeBlockStyle = codeBlockStyle;
 1668|  29.7k|      img.tiles[tileIdx].tileComps[comp].transform = transform;
 1669|  29.7k|      img.tiles[tileIdx].tileComps[comp].resLevels =
 1670|  29.7k|	  (JPXResLevel *)greallocn(
 1671|  29.7k|		     img.tiles[tileIdx].tileComps[comp].resLevels,
 1672|  29.7k|		     nDecompLevels + 1,
 1673|  29.7k|		     sizeof(JPXResLevel));
 1674|   631k|      for (r = 0; r <= nDecompLevels; ++r) {
  ------------------
  |  Branch (1674:19): [True: 602k, False: 29.7k]
  ------------------
 1675|   602k|	img.tiles[tileIdx].tileComps[comp].resLevels[r].precincts = NULL;
 1676|   602k|      }
 1677|   631k|      for (r = 0; r <= nDecompLevels; ++r) {
  ------------------
  |  Branch (1677:19): [True: 601k, False: 29.1k]
  ------------------
 1678|   601k|	if (style & 0x01) {
  ------------------
  |  Branch (1678:6): [True: 16.7k, False: 585k]
  ------------------
 1679|  16.7k|	  if (!readUByte(&precinctSize)) {
  ------------------
  |  Branch (1679:8): [True: 342, False: 16.4k]
  ------------------
 1680|    342|	    error(errSyntaxError, getPos(), "Error in JPX COD marker segment");
 1681|    342|	    return gFalse;
  ------------------
  |  |   18|    342|#define gFalse 0
  ------------------
 1682|    342|	  }
 1683|  16.4k|	  if (r > 0 && ((precinctSize & 0x0f) == 0 ||
  ------------------
  |  Branch (1683:8): [True: 8.18k, False: 8.25k]
  |  Branch (1683:18): [True: 202, False: 7.98k]
  ------------------
 1684|  7.98k|			(precinctSize & 0xf0) == 0)) {
  ------------------
  |  Branch (1684:4): [True: 32, False: 7.95k]
  ------------------
 1685|    234|	    error(errSyntaxError, getPos(),
 1686|    234|		  "Invalid precinct size in JPX COD marker segment");
 1687|    234|	    return gFalse;
  ------------------
  |  |   18|    234|#define gFalse 0
  ------------------
 1688|    234|	  }
 1689|  16.2k|	  img.tiles[tileIdx].tileComps[comp].resLevels[r].precinctWidth =
 1690|  16.2k|	      precinctSize & 0x0f;
 1691|  16.2k|	  img.tiles[tileIdx].tileComps[comp].resLevels[r].precinctHeight =
 1692|  16.2k|	      (precinctSize >> 4) & 0x0f;
 1693|   585k|	} else {
 1694|   585k|	  img.tiles[tileIdx].tileComps[comp].resLevels[r].precinctWidth = 15;
 1695|   585k|	  img.tiles[tileIdx].tileComps[comp].resLevels[r].precinctHeight = 15;
 1696|   585k|	}
 1697|   601k|      }
 1698|  29.1k|      break;
 1699|  29.1k|    case 0x5c:			// QCD - quantization default
  ------------------
  |  Branch (1699:5): [True: 12.6k, False: 126k]
  ------------------
 1700|  12.6k|      cover(36);
 1701|  12.6k|      if (tilePartIdx != 0) {
  ------------------
  |  Branch (1701:11): [True: 240, False: 12.4k]
  ------------------
 1702|    240|	error(errSyntaxError, getPos(), "Extraneous JPX QCD marker segment");
 1703|    240|	return gFalse;
  ------------------
  |  |   18|    240|#define gFalse 0
  ------------------
 1704|    240|      }
 1705|  12.4k|      if (!readUByte(&img.tiles[tileIdx].tileComps[0].quantStyle)) {
  ------------------
  |  Branch (1705:11): [True: 169, False: 12.2k]
  ------------------
 1706|    169|	error(errSyntaxError, getPos(), "Error in JPX QCD marker segment");
 1707|    169|	return gFalse;
  ------------------
  |  |   18|    169|#define gFalse 0
  ------------------
 1708|    169|      }
 1709|  12.2k|      if ((img.tiles[tileIdx].tileComps[0].quantStyle & 0x1f) == 0x00) {
  ------------------
  |  Branch (1709:11): [True: 3.63k, False: 8.62k]
  ------------------
 1710|  3.63k|	if (segLen <= 3) {
  ------------------
  |  Branch (1710:6): [True: 147, False: 3.49k]
  ------------------
 1711|    147|	  error(errSyntaxError, getPos(), "Error in JPX QCD marker segment");
 1712|    147|	  return gFalse;
  ------------------
  |  |   18|    147|#define gFalse 0
  ------------------
 1713|    147|	}
 1714|  3.49k|	img.tiles[tileIdx].tileComps[0].nQuantSteps = segLen - 3;
 1715|  3.49k|	img.tiles[tileIdx].tileComps[0].quantSteps =
 1716|  3.49k|	    (Guint *)greallocn(img.tiles[tileIdx].tileComps[0].quantSteps,
 1717|  3.49k|			       img.tiles[tileIdx].tileComps[0].nQuantSteps,
 1718|  3.49k|			       sizeof(Guint));
 1719|   126k|	for (i = 0; i < img.tiles[tileIdx].tileComps[0].nQuantSteps; ++i) {
  ------------------
  |  Branch (1719:14): [True: 123k, False: 3.35k]
  ------------------
 1720|   123k|	  if (!readUByte(&img.tiles[tileIdx].tileComps[0].quantSteps[i])) {
  ------------------
  |  Branch (1720:8): [True: 137, False: 123k]
  ------------------
 1721|    137|	    error(errSyntaxError, getPos(), "Error in JPX QCD marker segment");
 1722|    137|	    return gFalse;
  ------------------
  |  |   18|    137|#define gFalse 0
  ------------------
 1723|    137|	  }
 1724|   123k|	}
 1725|  8.62k|      } else if ((img.tiles[tileIdx].tileComps[0].quantStyle & 0x1f) == 0x01) {
  ------------------
  |  Branch (1725:18): [True: 512, False: 8.10k]
  ------------------
 1726|    512|	img.tiles[tileIdx].tileComps[0].nQuantSteps = 1;
 1727|    512|	img.tiles[tileIdx].tileComps[0].quantSteps =
 1728|    512|	    (Guint *)greallocn(img.tiles[tileIdx].tileComps[0].quantSteps,
 1729|    512|			       img.tiles[tileIdx].tileComps[0].nQuantSteps,
 1730|    512|			       sizeof(Guint));
 1731|    512|	if (!readUWord(&img.tiles[tileIdx].tileComps[0].quantSteps[0])) {
  ------------------
  |  Branch (1731:6): [True: 0, False: 512]
  ------------------
 1732|      0|	  error(errSyntaxError, getPos(), "Error in JPX QCD marker segment");
 1733|      0|	  return gFalse;
  ------------------
  |  |   18|      0|#define gFalse 0
  ------------------
 1734|      0|	}
 1735|  8.10k|      } else if ((img.tiles[tileIdx].tileComps[0].quantStyle & 0x1f) == 0x02) {
  ------------------
  |  Branch (1735:18): [True: 7.92k, False: 181]
  ------------------
 1736|  7.92k|	if (segLen < 5) {
  ------------------
  |  Branch (1736:6): [True: 133, False: 7.79k]
  ------------------
 1737|    133|	  error(errSyntaxError, getPos(), "Error in JPX QCD marker segment");
 1738|    133|	  return gFalse;
  ------------------
  |  |   18|    133|#define gFalse 0
  ------------------
 1739|    133|	}
 1740|  7.79k|	img.tiles[tileIdx].tileComps[0].nQuantSteps = (segLen - 3) / 2;
 1741|  7.79k|	img.tiles[tileIdx].tileComps[0].quantSteps =
 1742|  7.79k|	    (Guint *)greallocn(img.tiles[tileIdx].tileComps[0].quantSteps,
 1743|  7.79k|			       img.tiles[tileIdx].tileComps[0].nQuantSteps,
 1744|  7.79k|			       sizeof(Guint));
 1745|   126k|	for (i = 0; i < img.tiles[tileIdx].tileComps[0].nQuantSteps; ++i) {
  ------------------
  |  Branch (1745:14): [True: 119k, False: 7.31k]
  ------------------
 1746|   119k|	  if (!readUWord(&img.tiles[tileIdx].tileComps[0].quantSteps[i])) {
  ------------------
  |  Branch (1746:8): [True: 483, False: 119k]
  ------------------
 1747|    483|	    error(errSyntaxError, getPos(), "Error in JPX QCD marker segment");
 1748|    483|	    return gFalse;
  ------------------
  |  |   18|    483|#define gFalse 0
  ------------------
 1749|    483|	  }
 1750|   119k|	}
 1751|  7.79k|      } else {
 1752|    181|	error(errSyntaxError, getPos(), "Error in JPX QCD marker segment");
 1753|    181|	return gFalse;
  ------------------
  |  |   18|    181|#define gFalse 0
  ------------------
 1754|    181|      }
 1755|   155k|      for (comp = 1; comp < img.nComps; ++comp) {
  ------------------
  |  Branch (1755:22): [True: 144k, False: 11.1k]
  ------------------
 1756|   144k|	img.tiles[tileIdx].tileComps[comp].quantStyle =
 1757|   144k|	    img.tiles[tileIdx].tileComps[0].quantStyle;
 1758|   144k|	img.tiles[tileIdx].tileComps[comp].nQuantSteps =
 1759|   144k|	    img.tiles[tileIdx].tileComps[0].nQuantSteps;
 1760|   144k|	img.tiles[tileIdx].tileComps[comp].quantSteps = 
 1761|   144k|	    (Guint *)greallocn(img.tiles[tileIdx].tileComps[comp].quantSteps,
 1762|   144k|			       img.tiles[tileIdx].tileComps[0].nQuantSteps,
 1763|   144k|			       sizeof(Guint));
 1764|  2.56M|	for (j = 0; j < img.tiles[tileIdx].tileComps[0].nQuantSteps; ++j) {
  ------------------
  |  Branch (1764:14): [True: 2.41M, False: 144k]
  ------------------
 1765|  2.41M|	  img.tiles[tileIdx].tileComps[comp].quantSteps[j] =
 1766|  2.41M|	      img.tiles[tileIdx].tileComps[0].quantSteps[j];
 1767|  2.41M|	}
 1768|   144k|      }
 1769|  11.1k|      break;
 1770|  6.79k|    case 0x5d:			// QCC - quantization component
  ------------------
  |  Branch (1770:5): [True: 6.79k, False: 132k]
  ------------------
 1771|  6.79k|      cover(37);
 1772|  6.79k|      if (tilePartIdx != 0) {
  ------------------
  |  Branch (1772:11): [True: 255, False: 6.54k]
  ------------------
 1773|    255|	error(errSyntaxError, getPos(), "Extraneous JPX QCC marker segment");
 1774|    255|	return gFalse;
  ------------------
  |  |   18|    255|#define gFalse 0
  ------------------
 1775|    255|      }
 1776|  6.54k|      comp = 0;
 1777|  6.54k|      if ((img.nComps > 256 && !readUWord(&comp)) ||
  ------------------
  |  Branch (1777:12): [True: 648, False: 5.89k]
  |  Branch (1777:32): [True: 74, False: 574]
  ------------------
 1778|  6.47k|	  (img.nComps <= 256 && !readUByte(&comp)) ||
  ------------------
  |  Branch (1778:5): [True: 5.89k, False: 574]
  |  Branch (1778:26): [True: 454, False: 5.44k]
  ------------------
 1779|  6.01k|	  comp >= img.nComps ||
  ------------------
  |  Branch (1779:4): [True: 223, False: 5.79k]
  ------------------
 1780|  5.79k|	  !readUByte(&img.tiles[tileIdx].tileComps[comp].quantStyle)) {
  ------------------
  |  Branch (1780:4): [True: 210, False: 5.58k]
  ------------------
 1781|    961|	error(errSyntaxError, getPos(), "Error in JPX QCC marker segment");
 1782|    961|	return gFalse;
  ------------------
  |  |   18|    961|#define gFalse 0
  ------------------
 1783|    961|      }
 1784|  5.58k|      if ((img.tiles[tileIdx].tileComps[comp].quantStyle & 0x1f) == 0x00) {
  ------------------
  |  Branch (1784:11): [True: 1.31k, False: 4.26k]
  ------------------
 1785|  1.31k|	if (segLen <= (img.nComps > 256 ? 5U : 4U)) {
  ------------------
  |  Branch (1785:6): [True: 255, False: 1.06k]
  |  Branch (1785:17): [True: 521, False: 794]
  ------------------
 1786|    255|	  error(errSyntaxError, getPos(), "Error in JPX QCC marker segment");
 1787|    255|	  return gFalse;
  ------------------
  |  |   18|    255|#define gFalse 0
  ------------------
 1788|    255|	}
 1789|  1.06k|	img.tiles[tileIdx].tileComps[comp].nQuantSteps =
 1790|  1.06k|	    segLen - (img.nComps > 256 ? 5 : 4);
  ------------------
  |  Branch (1790:16): [True: 521, False: 539]
  ------------------
 1791|  1.06k|	img.tiles[tileIdx].tileComps[comp].quantSteps =
 1792|  1.06k|	    (Guint *)greallocn(img.tiles[tileIdx].tileComps[comp].quantSteps,
 1793|  1.06k|			       img.tiles[tileIdx].tileComps[comp].nQuantSteps,
 1794|  1.06k|			       sizeof(Guint));
 1795|   190k|	for (i = 0; i < img.tiles[tileIdx].tileComps[comp].nQuantSteps; ++i) {
  ------------------
  |  Branch (1795:14): [True: 189k, False: 897]
  ------------------
 1796|   189k|	  if (!readUByte(&img.tiles[tileIdx].tileComps[comp].quantSteps[i])) {
  ------------------
  |  Branch (1796:8): [True: 163, False: 189k]
  ------------------
 1797|    163|	    error(errSyntaxError, getPos(), "Error in JPX QCC marker segment");
 1798|    163|	    return gFalse;
  ------------------
  |  |   18|    163|#define gFalse 0
  ------------------
 1799|    163|	  }
 1800|   189k|	}
 1801|  4.26k|      } else if ((img.tiles[tileIdx].tileComps[comp].quantStyle & 0x1f)
  ------------------
  |  Branch (1801:18): [True: 2.65k, False: 1.61k]
  ------------------
 1802|  4.26k|		 == 0x01) {
 1803|  2.65k|	img.tiles[tileIdx].tileComps[comp].nQuantSteps = 1;
 1804|  2.65k|	img.tiles[tileIdx].tileComps[comp].quantSteps =
 1805|  2.65k|	    (Guint *)greallocn(img.tiles[tileIdx].tileComps[comp].quantSteps,
 1806|  2.65k|			       img.tiles[tileIdx].tileComps[comp].nQuantSteps,
 1807|  2.65k|			       sizeof(Guint));
 1808|  2.65k|	if (!readUWord(&img.tiles[tileIdx].tileComps[comp].quantSteps[0])) {
  ------------------
  |  Branch (1808:6): [True: 360, False: 2.29k]
  ------------------
 1809|    360|	  error(errSyntaxError, getPos(), "Error in JPX QCC marker segment");
 1810|    360|	  return gFalse;
  ------------------
  |  |   18|    360|#define gFalse 0
  ------------------
 1811|    360|	}
 1812|  2.65k|      } else if ((img.tiles[tileIdx].tileComps[comp].quantStyle & 0x1f)
  ------------------
  |  Branch (1812:18): [True: 1.35k, False: 252]
  ------------------
 1813|  1.61k|		 == 0x02) {
 1814|  1.35k|	if (segLen < (img.nComps > 256 ? 5U : 4U) + 2) {
  ------------------
  |  Branch (1814:6): [True: 144, False: 1.21k]
  |  Branch (1814:16): [True: 53, False: 1.30k]
  ------------------
 1815|    144|	  error(errSyntaxError, getPos(), "Error in JPX QCC marker segment");
 1816|    144|	  return gFalse;
  ------------------
  |  |   18|    144|#define gFalse 0
  ------------------
 1817|    144|	}
 1818|  1.21k|	img.tiles[tileIdx].tileComps[comp].nQuantSteps =
 1819|  1.21k|	    (segLen - (img.nComps > 256 ? 5 : 4)) / 2;
  ------------------
  |  Branch (1819:17): [True: 53, False: 1.16k]
  ------------------
 1820|  1.21k|	img.tiles[tileIdx].tileComps[comp].quantSteps =
 1821|  1.21k|	    (Guint *)greallocn(img.tiles[tileIdx].tileComps[comp].quantSteps,
 1822|  1.21k|			       img.tiles[tileIdx].tileComps[comp].nQuantSteps,
 1823|  1.21k|			       sizeof(Guint));
 1824|   194k|	for (i = 0; i < img.tiles[tileIdx].tileComps[comp].nQuantSteps; ++i) {
  ------------------
  |  Branch (1824:14): [True: 194k, False: 698]
  ------------------
 1825|   194k|	  if (!readUWord(&img.tiles[tileIdx].tileComps[comp].quantSteps[i])) {
  ------------------
  |  Branch (1825:8): [True: 516, False: 193k]
  ------------------
 1826|    516|	    error(errSyntaxError, getPos(), "Error in JPX QCD marker segment");
 1827|    516|	    return gFalse;
  ------------------
  |  |   18|    516|#define gFalse 0
  ------------------
 1828|    516|	  }
 1829|   194k|	}
 1830|  1.21k|      } else {
 1831|    252|	error(errSyntaxError, getPos(), "Error in JPX QCC marker segment");
 1832|    252|	return gFalse;
  ------------------
  |  |   18|    252|#define gFalse 0
  ------------------
 1833|    252|      }
 1834|  3.89k|      break;
 1835|  13.0k|    case 0x5e:			// RGN - region of interest
  ------------------
  |  Branch (1835:5): [True: 13.0k, False: 125k]
  ------------------
 1836|  13.0k|      cover(38);
 1837|  13.0k|      if (tilePartIdx != 0) {
  ------------------
  |  Branch (1837:11): [True: 179, False: 12.8k]
  ------------------
 1838|    179|	error(errSyntaxError, getPos(), "Extraneous JPX RGN marker segment");
 1839|    179|	return gFalse;
  ------------------
  |  |   18|    179|#define gFalse 0
  ------------------
 1840|    179|      }
 1841|  12.8k|#if 1 //~ ROI is unimplemented
 1842|  12.8k|      error(errUnimplemented, -1, "Got a JPX RGN segment");
 1843|  12.8k|      if (segLen > 2 &&
  ------------------
  |  Branch (1843:11): [True: 11.6k, False: 1.13k]
  ------------------
 1844|  11.6k|	  bufStr->discardChars(segLen - 2) != segLen - 2) {
  ------------------
  |  Branch (1844:4): [True: 197, False: 11.4k]
  ------------------
 1845|    197|	error(errSyntaxError, getPos(), "Error in JPX RGN marker segment");
 1846|    197|	return gFalse;
  ------------------
  |  |   18|    197|#define gFalse 0
  ------------------
 1847|    197|      }
 1848|       |#else
 1849|       |      if ((img.nComps > 256 && !readUWord(&comp)) ||
 1850|       |	  (img.nComps <= 256 && !readUByte(&comp)) ||
 1851|       |	  comp >= img.nComps ||
 1852|       |	  !readUByte(&compInfo[comp].roi.style) ||
 1853|       |	  !readUByte(&compInfo[comp].roi.shift)) {
 1854|       |	error(errSyntaxError, getPos(), "Error in JPX RGN marker segment");
 1855|       |	return gFalse;
 1856|       |      }
 1857|       |#endif
 1858|  12.6k|      break;
 1859|  12.6k|    case 0x5f:			// POC - progression order change
  ------------------
  |  Branch (1859:5): [True: 1.96k, False: 136k]
  ------------------
 1860|  1.96k|      cover(39);
 1861|  1.96k|#if 1 //~ progression order changes are unimplemented
 1862|  1.96k|      error(errUnimplemented, -1, "Got a JPX POC segment");
 1863|  1.96k|      if (segLen > 2 &&
  ------------------
  |  Branch (1863:11): [True: 1.56k, False: 400]
  ------------------
 1864|  1.56k|	  bufStr->discardChars(segLen - 2) != segLen - 2) {
  ------------------
  |  Branch (1864:4): [True: 168, False: 1.40k]
  ------------------
 1865|    168|	error(errSyntaxError, getPos(), "Error in JPX POC marker segment");
 1866|    168|	return gFalse;
  ------------------
  |  |   18|    168|#define gFalse 0
  ------------------
 1867|    168|      }
 1868|       |#else
 1869|       |      nTileProgs = (segLen - 2) / (img.nComps > 256 ? 9 : 7);
 1870|       |      tileProgs = (JPXProgOrder *)gmallocn(nTileProgs, sizeof(JPXProgOrder));
 1871|       |      for (i = 0; i < nTileProgs; ++i) {
 1872|       |	if (!readUByte(&tileProgs[i].startRes) ||
 1873|       |	    !(img.nComps > 256 && readUWord(&tileProgs[i].startComp)) ||
 1874|       |	    !(img.nComps <= 256 && readUByte(&tileProgs[i].startComp)) ||
 1875|       |	    !readUWord(&tileProgs[i].endLayer) ||
 1876|       |	    !readUByte(&tileProgs[i].endRes) ||
 1877|       |	    !(img.nComps > 256 && readUWord(&tileProgs[i].endComp)) ||
 1878|       |	    !(img.nComps <= 256 && readUByte(&tileProgs[i].endComp)) ||
 1879|       |	    !readUByte(&tileProgs[i].progOrder)) {
 1880|       |	  error(errSyntaxError, getPos(), "Error in JPX POC marker segment");
 1881|       |	  return gFalse;
 1882|       |	}
 1883|       |      }
 1884|       |#endif
 1885|  1.80k|      break;
 1886|  2.15k|    case 0x61:			// PPT - packed packet headers, tile-part hdr
  ------------------
  |  Branch (1886:5): [True: 2.15k, False: 136k]
  ------------------
 1887|  2.15k|      cover(40);
 1888|  2.15k|#if 1 //~ packed packet headers are unimplemented
 1889|  2.15k|      error(errUnimplemented, -1, "Got a JPX PPT segment");
 1890|  2.15k|      if (segLen > 2 &&
  ------------------
  |  Branch (1890:11): [True: 1.97k, False: 178]
  ------------------
 1891|  1.97k|	  bufStr->discardChars(segLen - 2) != segLen - 2) {
  ------------------
  |  Branch (1891:4): [True: 276, False: 1.70k]
  ------------------
 1892|    276|	error(errSyntaxError, getPos(), "Error in JPX PPT marker segment");
 1893|    276|	return gFalse;
  ------------------
  |  |   18|    276|#define gFalse 0
  ------------------
 1894|    276|      }
 1895|  1.88k|#endif
 1896|  3.01k|    case 0x58:			// PLT - packet length, tile-part header
  ------------------
  |  Branch (1896:5): [True: 1.13k, False: 137k]
  ------------------
 1897|       |      // skipped
 1898|  3.01k|      cover(41);
 1899|  3.01k|      if (segLen > 2 &&
  ------------------
  |  Branch (1899:11): [True: 2.84k, False: 178]
  ------------------
 1900|  2.84k|	  bufStr->discardChars(segLen - 2) != segLen - 2) {
  ------------------
  |  Branch (1900:4): [True: 236, False: 2.60k]
  ------------------
 1901|    236|	error(errSyntaxError, getPos(), "Error in JPX PLT marker segment");
 1902|    236|	return gFalse;
  ------------------
  |  |   18|    236|#define gFalse 0
  ------------------
 1903|    236|      }
 1904|  2.78k|      break;
 1905|  2.78k|    case 0x64:			// COM - comment
  ------------------
  |  Branch (1905:5): [True: 1.47k, False: 137k]
  ------------------
 1906|       |      // skipped
 1907|  1.47k|      cover(42);
 1908|  1.47k|      if (segLen > 2 &&
  ------------------
  |  Branch (1908:11): [True: 1.10k, False: 368]
  ------------------
 1909|  1.10k|	  bufStr->discardChars(segLen - 2) != segLen - 2) {
  ------------------
  |  Branch (1909:4): [True: 237, False: 868]
  ------------------
 1910|    237|	error(errSyntaxError, getPos(), "Error in JPX COM marker segment");
 1911|    237|	return gFalse;
  ------------------
  |  |   18|    237|#define gFalse 0
  ------------------
 1912|    237|      }
 1913|  1.23k|      break;
 1914|  11.9k|    case 0x93:			// SOD - start of data
  ------------------
  |  Branch (1914:5): [True: 11.9k, False: 126k]
  ------------------
 1915|  11.9k|      cover(43);
 1916|  11.9k|      haveSOD = gTrue;
  ------------------
  |  |   17|  11.9k|#define gTrue 1
  ------------------
 1917|  11.9k|      break;
 1918|  40.8k|    default:
  ------------------
  |  Branch (1918:5): [True: 40.8k, False: 97.9k]
  ------------------
 1919|  40.8k|      cover(44);
 1920|  40.8k|      error(errSyntaxError, getPos(),
 1921|  40.8k|	    "Unknown marker segment {0:02x} in JPX tile-part stream",
 1922|  40.8k|	    segType);
 1923|  40.8k|      if (segLen > 2) {
  ------------------
  |  Branch (1923:11): [True: 18.5k, False: 22.3k]
  ------------------
 1924|  18.5k|	bufStr->discardChars(segLen - 2);
 1925|  18.5k|      }
 1926|  40.8k|      break;
 1927|   138k|    }
 1928|   138k|  } while (!haveSOD);
  ------------------
  |  Branch (1928:12): [True: 114k, False: 11.9k]
  ------------------
 1929|       |
 1930|  76.8k|  for (comp = 0; comp < img.nComps; ++comp) {
  ------------------
  |  Branch (1930:18): [True: 65.1k, False: 11.6k]
  ------------------
 1931|  65.1k|    tileComp = &img.tiles[tileIdx].tileComps[comp];
 1932|  65.1k|    qStyle = tileComp->quantStyle & 0x1f;
 1933|  65.1k|    if ((qStyle == 0 && tileComp->nQuantSteps < 3 * tileComp->nDecompLevels + 1) ||
  ------------------
  |  Branch (1933:10): [True: 14.3k, False: 50.8k]
  |  Branch (1933:25): [True: 152, False: 14.2k]
  ------------------
 1934|  65.0k|	(qStyle == 1 && tileComp->nQuantSteps < 1) ||
  ------------------
  |  Branch (1934:3): [True: 1.54k, False: 63.4k]
  |  Branch (1934:18): [True: 0, False: 1.54k]
  ------------------
 1935|  65.0k|	(qStyle == 2 && tileComp->nQuantSteps < 3 * tileComp->nDecompLevels + 1)) {
  ------------------
  |  Branch (1935:3): [True: 49.2k, False: 15.7k]
  |  Branch (1935:18): [True: 129, False: 49.1k]
  ------------------
 1936|    281|      error(errSyntaxError, getPos(), "Too few quant steps in JPX tile part");
 1937|    281|      return gFalse;
  ------------------
  |  |   18|    281|#define gFalse 0
  ------------------
 1938|    281|    }
 1939|  65.1k|  }
 1940|       |
 1941|       |  //----- initialize the tile, precincts, and code-blocks
 1942|  11.6k|  if (tilePartIdx == 0) {
  ------------------
  |  Branch (1942:7): [True: 11.5k, False: 157]
  ------------------
 1943|  11.5k|    tile = &img.tiles[tileIdx];
 1944|  11.5k|    i = tileIdx / img.nXTiles;
 1945|  11.5k|    j = tileIdx % img.nXTiles;
 1946|  11.5k|    if ((tile->x0 = img.xTileOffset + j * img.xTileSize) < img.xOffset) {
  ------------------
  |  Branch (1946:9): [True: 8.12k, False: 3.38k]
  ------------------
 1947|  8.12k|      tile->x0 = img.xOffset;
 1948|  8.12k|    }
 1949|  11.5k|    if ((tile->y0 = img.yTileOffset + i * img.yTileSize) < img.yOffset) {
  ------------------
  |  Branch (1949:9): [True: 10.2k, False: 1.21k]
  ------------------
 1950|  10.2k|      tile->y0 = img.yOffset;
 1951|  10.2k|    }
 1952|  11.5k|    if ((tile->x1 = img.xTileOffset + (j + 1) * img.xTileSize) > img.xSize) {
  ------------------
  |  Branch (1952:9): [True: 10.9k, False: 576]
  ------------------
 1953|  10.9k|      tile->x1 = img.xSize;
 1954|  10.9k|    }
 1955|  11.5k|    if ((tile->y1 = img.yTileOffset + (i + 1) * img.yTileSize) > img.ySize) {
  ------------------
  |  Branch (1955:9): [True: 11.1k, False: 385]
  ------------------
 1956|  11.1k|      tile->y1 = img.ySize;
 1957|  11.1k|    }
 1958|  11.5k|    tile->comp = 0;
 1959|  11.5k|    tile->res = 0;
 1960|  11.5k|    tile->precinct = 0;
 1961|  11.5k|    tile->layer = 0;
 1962|  11.5k|    tile->done = gFalse;
  ------------------
  |  |   18|  11.5k|#define gFalse 0
  ------------------
 1963|  11.5k|    tile->maxNDecompLevels = 0;
 1964|  11.5k|    tile->maxNPrecincts = 0;
 1965|  72.2k|    for (comp = 0; comp < img.nComps; ++comp) {
  ------------------
  |  Branch (1965:20): [True: 61.6k, False: 10.6k]
  ------------------
 1966|  61.6k|      tileComp = &tile->tileComps[comp];
 1967|  61.6k|      if (tileComp->nDecompLevels > tile->maxNDecompLevels) {
  ------------------
  |  Branch (1967:11): [True: 11.5k, False: 50.1k]
  ------------------
 1968|  11.5k|	tile->maxNDecompLevels = tileComp->nDecompLevels;
 1969|  11.5k|      }
 1970|  61.6k|      tileComp->x0 = jpxCeilDiv(tile->x0, tileComp->hSep);
  ------------------
  |  |  164|  61.6k|#define jpxCeilDiv(x, y) (((x) + (y) - 1) / (y))
  ------------------
 1971|  61.6k|      tileComp->y0 = jpxCeilDiv(tile->y0, tileComp->vSep);
  ------------------
  |  |  164|  61.6k|#define jpxCeilDiv(x, y) (((x) + (y) - 1) / (y))
  ------------------
 1972|  61.6k|      tileComp->x1 = jpxCeilDiv(tile->x1, tileComp->hSep);
  ------------------
  |  |  164|  61.6k|#define jpxCeilDiv(x, y) (((x) + (y) - 1) / (y))
  ------------------
 1973|  61.6k|      tileComp->y1 = jpxCeilDiv(tile->y1, tileComp->vSep);
  ------------------
  |  |  164|  61.6k|#define jpxCeilDiv(x, y) (((x) + (y) - 1) / (y))
  ------------------
 1974|  61.6k|      tileComp->x0r = jpxCeilDivPow2(tileComp->x0, reduction);
  ------------------
  |  |  167|  61.6k|#define jpxCeilDivPow2(x, y) (((x) + (1 << (y)) - 1) >> (y))
  ------------------
 1975|  61.6k|      tileComp->w = jpxCeilDivPow2(tileComp->x1, reduction) - tileComp->x0r;
  ------------------
  |  |  167|  61.6k|#define jpxCeilDivPow2(x, y) (((x) + (1 << (y)) - 1) >> (y))
  ------------------
 1976|  61.6k|      tileComp->y0r = jpxCeilDivPow2(tileComp->y0, reduction);
  ------------------
  |  |  167|  61.6k|#define jpxCeilDivPow2(x, y) (((x) + (1 << (y)) - 1) >> (y))
  ------------------
 1977|  61.6k|      tileComp->h = jpxCeilDivPow2(tileComp->y1, reduction) - tileComp->y0r;
  ------------------
  |  |  167|  61.6k|#define jpxCeilDivPow2(x, y) (((x) + (1 << (y)) - 1) >> (y))
  ------------------
 1978|  61.6k|      if (tileComp->w == 0 || tileComp->h == 0 ||
  ------------------
  |  Branch (1978:11): [True: 544, False: 61.0k]
  |  Branch (1978:31): [True: 135, False: 60.9k]
  ------------------
 1979|  60.9k|	  tileComp->w > INT_MAX / tileComp->h) {
  ------------------
  |  Branch (1979:4): [True: 224, False: 60.7k]
  ------------------
 1980|    903|	error(errSyntaxError, getPos(),
 1981|    903|	      "Invalid tile size or sample separation in JPX stream");
 1982|    903|	return gFalse;
  ------------------
  |  |   18|    903|#define gFalse 0
  ------------------
 1983|    903|      }
 1984|  60.7k|      tileComp->data = (int *)gmallocn(tileComp->w * tileComp->h, sizeof(int));
 1985|  60.7k|      if (tileComp->x1 - tileComp->x0 > tileComp->y1 - tileComp->y0) {
  ------------------
  |  Branch (1985:11): [True: 17.9k, False: 42.7k]
  ------------------
 1986|  17.9k|	n = tileComp->x1 - tileComp->x0;
 1987|  42.7k|      } else {
 1988|  42.7k|	n = tileComp->y1 - tileComp->y0;
 1989|  42.7k|      }
 1990|  60.7k|      tileComp->buf = (int *)gmallocn(n + 8, sizeof(int));
 1991|   409k|      for (r = 0; r <= tileComp->nDecompLevels; ++r) {
  ------------------
  |  Branch (1991:19): [True: 348k, False: 60.7k]
  ------------------
 1992|   348k|	resLevel = &tileComp->resLevels[r];
 1993|   348k|	resLevel->x0 = jpxCeilDivPow2(tileComp->x0,
  ------------------
  |  |  167|   348k|#define jpxCeilDivPow2(x, y) (((x) + (1 << (y)) - 1) >> (y))
  ------------------
 1994|   348k|				      tileComp->nDecompLevels - r);
 1995|   348k|	resLevel->y0 = jpxCeilDivPow2(tileComp->y0,
  ------------------
  |  |  167|   348k|#define jpxCeilDivPow2(x, y) (((x) + (1 << (y)) - 1) >> (y))
  ------------------
 1996|   348k|				      tileComp->nDecompLevels - r);
 1997|   348k|	resLevel->x1 = jpxCeilDivPow2(tileComp->x1,
  ------------------
  |  |  167|   348k|#define jpxCeilDivPow2(x, y) (((x) + (1 << (y)) - 1) >> (y))
  ------------------
 1998|   348k|				      tileComp->nDecompLevels - r);
 1999|   348k|	resLevel->y1 = jpxCeilDivPow2(tileComp->y1,
  ------------------
  |  |  167|   348k|#define jpxCeilDivPow2(x, y) (((x) + (1 << (y)) - 1) >> (y))
  ------------------
 2000|   348k|				      tileComp->nDecompLevels - r);
 2001|   348k|	resLevel->codeBlockW = r == 0 ? resLevel->precinctWidth
  ------------------
  |  Branch (2001:25): [True: 60.7k, False: 288k]
  ------------------
 2002|   348k|	                              : resLevel->precinctWidth - 1;
 2003|   348k|	if (resLevel->codeBlockW > tileComp->codeBlockW) {
  ------------------
  |  Branch (2003:6): [True: 346k, False: 2.53k]
  ------------------
 2004|   346k|	  resLevel->codeBlockW = tileComp->codeBlockW;
 2005|   346k|	}
 2006|   348k|	resLevel->cbW = 1 << resLevel->codeBlockW;
 2007|   348k|	resLevel->codeBlockH = r == 0 ? resLevel->precinctHeight
  ------------------
  |  Branch (2007:25): [True: 60.7k, False: 288k]
  ------------------
 2008|   348k|	                              : resLevel->precinctHeight - 1;
 2009|   348k|	if (resLevel->codeBlockH > tileComp->codeBlockH) {
  ------------------
  |  Branch (2009:6): [True: 346k, False: 2.72k]
  ------------------
 2010|   346k|	  resLevel->codeBlockH = tileComp->codeBlockH;
 2011|   346k|	}
 2012|   348k|	resLevel->cbH = 1 << resLevel->codeBlockH;
 2013|       |	// the JPEG 2000 spec says that packets for empty res levels
 2014|       |	// should all be present in the codestream (B.6, B.9, B.10),
 2015|       |	// but it appears that encoders drop packets if the res level
 2016|       |	// AND the subbands are all completely empty
 2017|   348k|	resLevel->empty = resLevel->x0 == resLevel->x1 ||
  ------------------
  |  Branch (2017:20): [True: 134k, False: 214k]
  ------------------
 2018|   214k|	                  resLevel->y0 == resLevel->y1;
  ------------------
  |  Branch (2018:20): [True: 31.7k, False: 182k]
  ------------------
 2019|   348k|	if (r == 0) {
  ------------------
  |  Branch (2019:6): [True: 60.7k, False: 288k]
  ------------------
 2020|  60.7k|	  nSBs = 1;
 2021|  60.7k|	  resLevel->bx0[0] = resLevel->x0;
 2022|  60.7k|	  resLevel->by0[0] = resLevel->y0;
 2023|  60.7k|	  resLevel->bx1[0] = resLevel->x1;
 2024|  60.7k|	  resLevel->by1[0] = resLevel->y1;
 2025|  60.7k|	  resLevel->empty = resLevel->empty &&
  ------------------
  |  Branch (2025:22): [True: 47.0k, False: 13.6k]
  ------------------
 2026|  47.0k|	                    (resLevel->bx0[0] == resLevel->bx1[0] ||
  ------------------
  |  Branch (2026:23): [True: 35.8k, False: 11.1k]
  ------------------
 2027|  11.1k|			     resLevel->by0[0] == resLevel->by1[0]);
  ------------------
  |  Branch (2027:9): [True: 11.1k, False: 0]
  ------------------
 2028|   288k|	} else {
 2029|   288k|	  nSBs = 3;
 2030|   288k|	  resLevel->bx0[0] = jpxCeilDivPow2(resLevel->x0 - 1, 1);
  ------------------
  |  |  167|   288k|#define jpxCeilDivPow2(x, y) (((x) + (1 << (y)) - 1) >> (y))
  ------------------
 2031|   288k|	  resLevel->by0[0] = jpxCeilDivPow2(resLevel->y0, 1);
  ------------------
  |  |  167|   288k|#define jpxCeilDivPow2(x, y) (((x) + (1 << (y)) - 1) >> (y))
  ------------------
 2032|   288k|	  resLevel->bx1[0] = jpxCeilDivPow2(resLevel->x1 - 1, 1);
  ------------------
  |  |  167|   288k|#define jpxCeilDivPow2(x, y) (((x) + (1 << (y)) - 1) >> (y))
  ------------------
 2033|   288k|	  resLevel->by1[0] = jpxCeilDivPow2(resLevel->y1, 1);
  ------------------
  |  |  167|   288k|#define jpxCeilDivPow2(x, y) (((x) + (1 << (y)) - 1) >> (y))
  ------------------
 2034|   288k|	  resLevel->bx0[1] = jpxCeilDivPow2(resLevel->x0, 1);
  ------------------
  |  |  167|   288k|#define jpxCeilDivPow2(x, y) (((x) + (1 << (y)) - 1) >> (y))
  ------------------
 2035|   288k|	  resLevel->by0[1] = jpxCeilDivPow2(resLevel->y0 - 1, 1);
  ------------------
  |  |  167|   288k|#define jpxCeilDivPow2(x, y) (((x) + (1 << (y)) - 1) >> (y))
  ------------------
 2036|   288k|	  resLevel->bx1[1] = jpxCeilDivPow2(resLevel->x1, 1);
  ------------------
  |  |  167|   288k|#define jpxCeilDivPow2(x, y) (((x) + (1 << (y)) - 1) >> (y))
  ------------------
 2037|   288k|	  resLevel->by1[1] = jpxCeilDivPow2(resLevel->y1 - 1, 1);
  ------------------
  |  |  167|   288k|#define jpxCeilDivPow2(x, y) (((x) + (1 << (y)) - 1) >> (y))
  ------------------
 2038|   288k|	  resLevel->bx0[2] = jpxCeilDivPow2(resLevel->x0 - 1, 1);
  ------------------
  |  |  167|   288k|#define jpxCeilDivPow2(x, y) (((x) + (1 << (y)) - 1) >> (y))
  ------------------
 2039|   288k|	  resLevel->by0[2] = jpxCeilDivPow2(resLevel->y0 - 1, 1);
  ------------------
  |  |  167|   288k|#define jpxCeilDivPow2(x, y) (((x) + (1 << (y)) - 1) >> (y))
  ------------------
 2040|   288k|	  resLevel->bx1[2] = jpxCeilDivPow2(resLevel->x1 - 1, 1);
  ------------------
  |  |  167|   288k|#define jpxCeilDivPow2(x, y) (((x) + (1 << (y)) - 1) >> (y))
  ------------------
 2041|   288k|	  resLevel->by1[2] = jpxCeilDivPow2(resLevel->y1 - 1, 1);
  ------------------
  |  |  167|   288k|#define jpxCeilDivPow2(x, y) (((x) + (1 << (y)) - 1) >> (y))
  ------------------
 2042|   288k|	  resLevel->empty = resLevel->empty &&
  ------------------
  |  Branch (2042:22): [True: 119k, False: 168k]
  ------------------
 2043|   119k|	                    (resLevel->bx0[0] == resLevel->bx1[0] ||
  ------------------
  |  Branch (2043:23): [True: 99.9k, False: 19.3k]
  ------------------
 2044|  19.3k|			     resLevel->by0[0] == resLevel->by1[0]) &&
  ------------------
  |  Branch (2044:9): [True: 19.3k, False: 0]
  ------------------
 2045|   119k|	                    (resLevel->bx0[1] == resLevel->bx1[1] ||
  ------------------
  |  Branch (2045:23): [True: 99.4k, False: 19.7k]
  ------------------
 2046|  19.7k|			     resLevel->by0[1] == resLevel->by1[1]) &&
  ------------------
  |  Branch (2046:9): [True: 19.7k, False: 0]
  ------------------
 2047|   119k|	                    (resLevel->bx0[2] == resLevel->bx1[2] ||
  ------------------
  |  Branch (2047:23): [True: 99.9k, False: 19.3k]
  ------------------
 2048|  19.3k|			     resLevel->by0[2] == resLevel->by1[2]);
  ------------------
  |  Branch (2048:9): [True: 19.3k, False: 0]
  ------------------
 2049|   288k|	}
 2050|   348k|	preCol0 = jpxFloorDivPow2(resLevel->x0, resLevel->precinctWidth);
  ------------------
  |  |  161|   348k|#define jpxFloorDivPow2(x, y) ((x) >> (y))
  ------------------
 2051|   348k|	preCol1 = jpxCeilDivPow2(resLevel->x1, resLevel->precinctWidth);
  ------------------
  |  |  167|   348k|#define jpxCeilDivPow2(x, y) (((x) + (1 << (y)) - 1) >> (y))
  ------------------
 2052|   348k|	preRow0 = jpxFloorDivPow2(resLevel->y0, resLevel->precinctHeight);
  ------------------
  |  |  161|   348k|#define jpxFloorDivPow2(x, y) ((x) >> (y))
  ------------------
 2053|   348k|	preRow1 = jpxCeilDivPow2(resLevel->y1, resLevel->precinctHeight);
  ------------------
  |  |  167|   348k|#define jpxCeilDivPow2(x, y) (((x) + (1 << (y)) - 1) >> (y))
  ------------------
 2054|   348k|	resLevel->nPrecincts = (preCol1 - preCol0) * (preRow1 - preRow0);
 2055|   348k|	resLevel->precincts = (JPXPrecinct *)gmallocn(resLevel->nPrecincts,
 2056|   348k|						      sizeof(JPXPrecinct));
 2057|   348k|	if (resLevel->nPrecincts > tile->maxNPrecincts) {
  ------------------
  |  Branch (2057:6): [True: 11.3k, False: 337k]
  ------------------
 2058|  11.3k|	  tile->maxNPrecincts = resLevel->nPrecincts;
 2059|  11.3k|	}
 2060|   845k|	for (pre = 0; pre < resLevel->nPrecincts; ++pre) {
  ------------------
  |  Branch (2060:16): [True: 496k, False: 348k]
  ------------------
 2061|   496k|	  resLevel->precincts[pre].subbands = NULL;
 2062|   496k|	}
 2063|   348k|	precinct = resLevel->precincts;
 2064|   709k|	for (preRow = preRow0; preRow < preRow1; ++preRow) {
  ------------------
  |  Branch (2064:25): [True: 360k, False: 348k]
  ------------------
 2065|   857k|	  for (preCol = preCol0; preCol < preCol1; ++preCol) {
  ------------------
  |  Branch (2065:27): [True: 496k, False: 360k]
  ------------------
 2066|   496k|	    precinct->subbands =
 2067|   496k|	        (JPXSubband *)gmallocn(nSBs, sizeof(JPXSubband));
 2068|  1.82M|	    for (sb = 0; sb < nSBs; ++sb) {
  ------------------
  |  Branch (2068:19): [True: 1.33M, False: 496k]
  ------------------
 2069|  1.33M|	      precinct->subbands[sb].inclusion = NULL;
 2070|  1.33M|	      precinct->subbands[sb].zeroBitPlane = NULL;
 2071|  1.33M|	      precinct->subbands[sb].cbs = NULL;
 2072|  1.33M|	    }
 2073|  1.82M|	    for (sb = 0; sb < nSBs; ++sb) {
  ------------------
  |  Branch (2073:19): [True: 1.33M, False: 496k]
  ------------------
 2074|  1.33M|	      subband = &precinct->subbands[sb];
 2075|  1.33M|	      if (r == 0) {
  ------------------
  |  Branch (2075:12): [True: 79.6k, False: 1.25M]
  ------------------
 2076|  79.6k|		px0 = preCol << resLevel->precinctWidth;
 2077|  79.6k|		px1 = (preCol + 1) << resLevel->precinctWidth;
 2078|  79.6k|		py0 = preRow << resLevel->precinctHeight;
 2079|  79.6k|		py1 = (preRow + 1) << resLevel->precinctHeight;
 2080|  1.25M|	      } else {
 2081|  1.25M|		px0 = preCol << (resLevel->precinctWidth - 1);
 2082|  1.25M|		px1 = (preCol + 1) << (resLevel->precinctWidth - 1);
 2083|  1.25M|		py0 = preRow << (resLevel->precinctHeight - 1);
 2084|  1.25M|		py1 = (preRow + 1) << (resLevel->precinctHeight - 1);
 2085|  1.25M|	      }
 2086|  1.33M|	      if (px0 < resLevel->bx0[sb]) {
  ------------------
  |  Branch (2086:12): [True: 319k, False: 1.01M]
  ------------------
 2087|   319k|		px0 = resLevel->bx0[sb];
 2088|   319k|	      }
 2089|  1.33M|	      if (px1 > resLevel->bx1[sb]) {
  ------------------
  |  Branch (2089:12): [True: 955k, False: 374k]
  ------------------
 2090|   955k|		px1 = resLevel->bx1[sb];
 2091|   955k|	      }
 2092|  1.33M|	      if (py0 < resLevel->by0[sb]) {
  ------------------
  |  Branch (2092:12): [True: 425k, False: 905k]
  ------------------
 2093|   425k|		py0 = resLevel->by0[sb];
 2094|   425k|	      }
 2095|  1.33M|	      if (py1 > resLevel->by1[sb]) {
  ------------------
  |  Branch (2095:12): [True: 931k, False: 399k]
  ------------------
 2096|   931k|		py1 = resLevel->by1[sb];
 2097|   931k|	      }
 2098|  1.33M|	      if (r == 0) { // (NL)LL
  ------------------
  |  Branch (2098:12): [True: 79.6k, False: 1.25M]
  ------------------
 2099|  79.6k|		sbCoeffs = tileComp->data;
 2100|  1.25M|	      } else if (sb == 0) { // (NL-r+1)HL
  ------------------
  |  Branch (2100:19): [True: 417k, False: 834k]
  ------------------
 2101|   417k|		sbCoeffs = tileComp->data
 2102|   417k|                           + resLevel->bx1[1] - resLevel->bx0[1];
 2103|   834k|	      } else if (sb == 1) { // (NL-r+1)LH
  ------------------
  |  Branch (2103:19): [True: 417k, False: 417k]
  ------------------
 2104|   417k|		sbCoeffs = tileComp->data
 2105|   417k|		           + (resLevel->by1[0] - resLevel->by0[0]) * tileComp->w;
 2106|   417k|	      } else { // (NL-r+1)HH
 2107|   417k|		sbCoeffs = tileComp->data
 2108|   417k|		           + (resLevel->by1[0] - resLevel->by0[0]) * tileComp->w
 2109|   417k|		           + (resLevel->bx1[1] - resLevel->bx0[1]);
 2110|   417k|	      }
 2111|  1.33M|	      cbCol0 = jpxFloorDivPow2(px0, resLevel->codeBlockW);
  ------------------
  |  |  161|  1.33M|#define jpxFloorDivPow2(x, y) ((x) >> (y))
  ------------------
 2112|  1.33M|	      cbCol1 = jpxCeilDivPow2(px1, resLevel->codeBlockW);
  ------------------
  |  |  167|  1.33M|#define jpxCeilDivPow2(x, y) (((x) + (1 << (y)) - 1) >> (y))
  ------------------
 2113|  1.33M|	      cbRow0 = jpxFloorDivPow2(py0, resLevel->codeBlockH);
  ------------------
  |  |  161|  1.33M|#define jpxFloorDivPow2(x, y) ((x) >> (y))
  ------------------
 2114|  1.33M|	      cbRow1 = jpxCeilDivPow2(py1, resLevel->codeBlockH);
  ------------------
  |  |  167|  1.33M|#define jpxCeilDivPow2(x, y) (((x) + (1 << (y)) - 1) >> (y))
  ------------------
 2115|  1.33M|	      subband->nXCBs = cbCol1 - cbCol0;
 2116|  1.33M|	      subband->nYCBs = cbRow1 - cbRow0;
 2117|  1.33M|	      n = subband->nXCBs > subband->nYCBs ? subband->nXCBs
  ------------------
  |  Branch (2117:12): [True: 220k, False: 1.11M]
  ------------------
 2118|  1.33M|	                                          : subband->nYCBs;
 2119|  1.33M|	      for (subband->maxTTLevel = 0, --n;
 2120|  3.93M|		   n;
  ------------------
  |  Branch (2120:6): [True: 2.60M, False: 1.33M]
  ------------------
 2121|  2.60M|		   ++subband->maxTTLevel, n >>= 1) ;
 2122|  1.33M|	      n = 0;
 2123|  5.26M|	      for (level = subband->maxTTLevel; level >= 0; --level) {
  ------------------
  |  Branch (2123:42): [True: 3.93M, False: 1.33M]
  ------------------
 2124|  3.93M|		nx = jpxCeilDivPow2(subband->nXCBs, level);
  ------------------
  |  |  167|  3.93M|#define jpxCeilDivPow2(x, y) (((x) + (1 << (y)) - 1) >> (y))
  ------------------
 2125|  3.93M|		ny = jpxCeilDivPow2(subband->nYCBs, level);
  ------------------
  |  |  167|  3.93M|#define jpxCeilDivPow2(x, y) (((x) + (1 << (y)) - 1) >> (y))
  ------------------
 2126|  3.93M|		n += nx * ny;
 2127|  3.93M|	      }
 2128|  1.33M|	      subband->inclusion =
 2129|  1.33M|	          (JPXTagTreeNode *)gmallocn(n, sizeof(JPXTagTreeNode));
 2130|  1.33M|	      subband->zeroBitPlane =
 2131|  1.33M|	          (JPXTagTreeNode *)gmallocn(n, sizeof(JPXTagTreeNode));
 2132|  9.54M|	      for (k = 0; k < n; ++k) {
  ------------------
  |  Branch (2132:20): [True: 8.21M, False: 1.33M]
  ------------------
 2133|  8.21M|		subband->inclusion[k].finished = gFalse;
  ------------------
  |  |   18|  8.21M|#define gFalse 0
  ------------------
 2134|  8.21M|		subband->inclusion[k].val = 0;
 2135|  8.21M|		subband->zeroBitPlane[k].finished = gFalse;
  ------------------
  |  |   18|  8.21M|#define gFalse 0
  ------------------
 2136|  8.21M|		subband->zeroBitPlane[k].val = 0;
 2137|  8.21M|	      }
 2138|  1.33M|	      subband->cbs = (JPXCodeBlock *)gmallocn(subband->nXCBs *
 2139|  1.33M|						        subband->nYCBs,
 2140|  1.33M|						      sizeof(JPXCodeBlock));
 2141|  6.62M|	      for (k = 0; k < subband->nXCBs * subband->nYCBs; ++k) {
  ------------------
  |  Branch (2141:20): [True: 5.29M, False: 1.33M]
  ------------------
 2142|  5.29M|		subband->cbs[k].dataLen = NULL;
 2143|  5.29M|		subband->cbs[k].touched = NULL;
 2144|  5.29M|		subband->cbs[k].arithDecoder = NULL;
 2145|  5.29M|		subband->cbs[k].stats = NULL;
 2146|  5.29M|	      }
 2147|  1.33M|	      cb = subband->cbs;
 2148|  3.84M|	      for (cbY = cbRow0; cbY < cbRow1; ++cbY) {
  ------------------
  |  Branch (2148:27): [True: 2.51M, False: 1.33M]
  ------------------
 2149|  7.80M|		for (cbX = cbCol0; cbX < cbCol1; ++cbX) {
  ------------------
  |  Branch (2149:22): [True: 5.29M, False: 2.51M]
  ------------------
 2150|  5.29M|		  cb->x0 = cbX << resLevel->codeBlockW;
 2151|  5.29M|		  cb->x1 = cb->x0 + resLevel->cbW;
 2152|  5.29M|		  if (cb->x0 < px0) {
  ------------------
  |  Branch (2152:9): [True: 685k, False: 4.60M]
  ------------------
 2153|   685k|		    cb->x0 = px0;
 2154|   685k|		  }
 2155|  5.29M|		  if (cb->x1 > px1) {
  ------------------
  |  Branch (2155:9): [True: 1.68M, False: 3.60M]
  ------------------
 2156|  1.68M|		    cb->x1 = px1;
 2157|  1.68M|		  }
 2158|  5.29M|		  cb->y0 = cbY << resLevel->codeBlockH;
 2159|  5.29M|		  cb->y1 = cb->y0 + resLevel->cbH;
 2160|  5.29M|		  if (cb->y0 < py0) {
  ------------------
  |  Branch (2160:9): [True: 933k, False: 4.35M]
  ------------------
 2161|   933k|		    cb->y0 = py0;
 2162|   933k|		  }
 2163|  5.29M|		  if (cb->y1 > py1) {
  ------------------
  |  Branch (2163:9): [True: 1.69M, False: 3.60M]
  ------------------
 2164|  1.69M|		    cb->y1 = py1;
 2165|  1.69M|		  }
 2166|  5.29M|		  cb->seen = gFalse;
  ------------------
  |  |   18|  5.29M|#define gFalse 0
  ------------------
 2167|  5.29M|		  cb->lBlock = 3;
 2168|  5.29M|		  cb->nextPass = jpxPassCleanup;
  ------------------
  |  |   48|  5.29M|#define jpxPassCleanup       2
  ------------------
 2169|  5.29M|		  cb->nZeroBitPlanes = 0;
 2170|  5.29M|		  cb->dataLenSize = 1;
 2171|  5.29M|		  cb->dataLen = (Guint *)gmalloc(sizeof(Guint));
 2172|  5.29M|		  if (r <= tileComp->nDecompLevels - reduction) {
  ------------------
  |  Branch (2172:9): [True: 5.29M, False: 0]
  ------------------
 2173|  5.29M|		    cb->coeffs = sbCoeffs
 2174|  5.29M|		                 + (cb->y0 - resLevel->by0[sb]) * tileComp->w
 2175|  5.29M|		                 + (cb->x0 - resLevel->bx0[sb]);
 2176|  5.29M|		    cb->touched = (char *)gmalloc(1 << (resLevel->codeBlockW
 2177|  5.29M|							+ resLevel->codeBlockH));
 2178|  5.29M|		    cb->len = 0;
 2179|  34.1M|		    for (cbj = 0; cbj < cb->y1 - cb->y0; ++cbj) {
  ------------------
  |  Branch (2179:21): [True: 28.8M, False: 5.29M]
  ------------------
 2180|   192M|		      for (cbi = 0; cbi < cb->x1 - cb->x0; ++cbi) {
  ------------------
  |  Branch (2180:23): [True: 163M, False: 28.8M]
  ------------------
 2181|   163M|			cb->coeffs[cbj * tileComp->w + cbi] = 0;
 2182|   163M|		      }
 2183|  28.8M|		    }
 2184|  5.29M|		    memset(cb->touched, 0,
 2185|  5.29M|			   ((size_t)1 << (resLevel->codeBlockW
 2186|  5.29M|					  + resLevel->codeBlockH)));
 2187|  5.29M|		  } else {
 2188|      0|		    cb->coeffs = NULL;
 2189|      0|		    cb->touched = NULL;
 2190|      0|		    cb->len = 0;
 2191|      0|		  }
 2192|  5.29M|		  ++cb;
 2193|  5.29M|		}
 2194|  2.51M|	      }
 2195|  1.33M|	    }
 2196|   496k|	    ++precinct;
 2197|   496k|	  }
 2198|   360k|	}
 2199|   348k|      }
 2200|  60.7k|    }
 2201|  10.6k|    tile->init = gTrue;
  ------------------
  |  |   17|  10.6k|#define gTrue 1
  ------------------
 2202|  10.6k|  }
 2203|       |
 2204|  10.7k|  return readTilePartData(tileIdx, tilePartLen, tilePartToEOC);
 2205|  11.6k|}
_ZN9JPXStream16readTilePartDataEjji:
 2208|  10.7k|				  Guint tilePartLen, GBool tilePartToEOC) {
 2209|  10.7k|  JPXTile *tile;
 2210|  10.7k|  JPXTileComp *tileComp;
 2211|  10.7k|  JPXResLevel *resLevel;
 2212|  10.7k|  JPXPrecinct *precinct;
 2213|  10.7k|  JPXSubband *subband;
 2214|  10.7k|  JPXCodeBlock *cb;
 2215|  10.7k|  Guint ttVal;
 2216|  10.7k|  Guint bits, cbX, cbY, nx, ny, i, j, n, sb;
 2217|  10.7k|  int level;
 2218|       |
 2219|  10.7k|  tile = &img.tiles[tileIdx];
 2220|       |
 2221|       |  // read all packets from this tile-part
 2222|  15.3M|  while (1) {
  ------------------
  |  Branch (2222:10): [True: 15.3M, Folded]
  ------------------
 2223|       |
 2224|       |    // if the tile is finished, skip any remaining data
 2225|  15.3M|    if (tile->done) {
  ------------------
  |  Branch (2225:9): [True: 2.62k, False: 15.3M]
  ------------------
 2226|  2.62k|      bufStr->discardChars(tilePartLen);
 2227|  2.62k|      return gTrue;
  ------------------
  |  |   17|  2.62k|#define gTrue 1
  ------------------
 2228|  2.62k|    }
 2229|       |
 2230|  15.3M|    if (tilePartToEOC) {
  ------------------
  |  Branch (2230:9): [True: 80.7k, False: 15.2M]
  ------------------
 2231|       |      //~ peek for an EOC marker
 2232|  80.7k|      cover(93);
 2233|  15.2M|    } else if (tilePartLen == 0) {
  ------------------
  |  Branch (2233:16): [True: 1.77k, False: 15.2M]
  ------------------
 2234|  1.77k|      break;
 2235|  1.77k|    }
 2236|       |
 2237|  15.3M|    tileComp = &tile->tileComps[tile->comp];
 2238|  15.3M|    resLevel = &tileComp->resLevels[tile->res];
 2239|  15.3M|    precinct = &resLevel->precincts[tile->precinct];
 2240|       |
 2241|  15.3M|    if (resLevel->empty) {
  ------------------
  |  Branch (2241:9): [True: 14.6M, False: 723k]
  ------------------
 2242|  14.6M|      goto nextPacket;
 2243|  14.6M|    }
 2244|       |
 2245|       |    //----- packet header
 2246|       |
 2247|       |    // setup
 2248|   723k|    startBitBuf(tilePartLen);
 2249|   723k|    if (tileComp->style & 0x02) {
  ------------------
  |  Branch (2249:9): [True: 162k, False: 561k]
  ------------------
 2250|   162k|      skipSOP();
 2251|   162k|    }
 2252|       |
 2253|       |    // zero-length flag
 2254|   723k|    if (!readBits(1, &bits)) {
  ------------------
  |  Branch (2254:9): [True: 1.43k, False: 722k]
  ------------------
 2255|  1.43k|      goto err;
 2256|  1.43k|    }
 2257|   722k|    if (!bits) {
  ------------------
  |  Branch (2257:9): [True: 651k, False: 70.6k]
  ------------------
 2258|       |      // packet is empty -- clear all code-block inclusion flags
 2259|   651k|      cover(45);
 2260|  2.36M|      for (sb = 0; sb < (Guint)(tile->res == 0 ? 1 : 3); ++sb) {
  ------------------
  |  Branch (2260:20): [True: 1.71M, False: 651k]
  |  Branch (2260:33): [True: 240k, False: 2.12M]
  ------------------
 2261|  1.71M|	subband = &precinct->subbands[sb];
 2262|  20.7M|	for (cbY = 0; cbY < subband->nYCBs; ++cbY) {
  ------------------
  |  Branch (2262:16): [True: 19.0M, False: 1.71M]
  ------------------
 2263|  63.4M|	  for (cbX = 0; cbX < subband->nXCBs; ++cbX) {
  ------------------
  |  Branch (2263:18): [True: 44.4M, False: 19.0M]
  ------------------
 2264|  44.4M|	    cb = &subband->cbs[cbY * subband->nXCBs + cbX];
 2265|  44.4M|	    cb->included = gFalse;
  ------------------
  |  |   18|  44.4M|#define gFalse 0
  ------------------
 2266|  44.4M|	  }
 2267|  19.0M|	}
 2268|  1.71M|      }
 2269|   651k|    } else {
 2270|       |
 2271|   226k|      for (sb = 0; sb < (Guint)(tile->res == 0 ? 1 : 3); ++sb) {
  ------------------
  |  Branch (2271:20): [True: 161k, False: 65.6k]
  |  Branch (2271:33): [True: 43.6k, False: 183k]
  ------------------
 2272|   161k|	subband = &precinct->subbands[sb];
 2273|   698k|	for (cbY = 0; cbY < subband->nYCBs; ++cbY) {
  ------------------
  |  Branch (2273:16): [True: 542k, False: 156k]
  ------------------
 2274|  2.58M|	  for (cbX = 0; cbX < subband->nXCBs; ++cbX) {
  ------------------
  |  Branch (2274:18): [True: 2.04M, False: 537k]
  ------------------
 2275|  2.04M|	    cb = &subband->cbs[cbY * subband->nXCBs + cbX];
 2276|       |
 2277|       |	    // skip code-blocks with no coefficients
 2278|  2.04M|	    if (cb->x0 >= cb->x1 || cb->y0 >= cb->y1) {
  ------------------
  |  Branch (2278:10): [True: 13.5k, False: 2.03M]
  |  Branch (2278:30): [True: 5.60k, False: 2.02M]
  ------------------
 2279|  19.1k|	      cover(46);
 2280|  19.1k|	      cb->included = gFalse;
  ------------------
  |  |   18|  19.1k|#define gFalse 0
  ------------------
 2281|  19.1k|	      continue;
 2282|  19.1k|	    }
 2283|       |
 2284|       |	    // code-block inclusion
 2285|  2.02M|	    if (cb->seen) {
  ------------------
  |  Branch (2285:10): [True: 67.3k, False: 1.95M]
  ------------------
 2286|  67.3k|	      cover(47);
 2287|  67.3k|	      if (!readBits(1, &cb->included)) {
  ------------------
  |  Branch (2287:12): [True: 371, False: 66.9k]
  ------------------
 2288|    371|		goto err;
 2289|    371|	      }
 2290|  1.95M|	    } else {
 2291|  1.95M|	      cover(48);
 2292|  1.95M|	      ttVal = 0;
 2293|  1.95M|	      i = 0;
 2294|  6.97M|	      for (level = subband->maxTTLevel; level >= 0; --level) {
  ------------------
  |  Branch (2294:42): [True: 6.50M, False: 470k]
  ------------------
 2295|  6.50M|		nx = jpxCeilDivPow2(subband->nXCBs, level);
  ------------------
  |  |  167|  6.50M|#define jpxCeilDivPow2(x, y) (((x) + (1 << (y)) - 1) >> (y))
  ------------------
 2296|  6.50M|		ny = jpxCeilDivPow2(subband->nYCBs, level);
  ------------------
  |  |  167|  6.50M|#define jpxCeilDivPow2(x, y) (((x) + (1 << (y)) - 1) >> (y))
  ------------------
 2297|  6.50M|		j = i + (cbY >> level) * nx + (cbX >> level);
 2298|  6.50M|		if (!subband->inclusion[j].finished &&
  ------------------
  |  Branch (2298:7): [True: 2.27M, False: 4.22M]
  ------------------
 2299|  2.27M|		    !subband->inclusion[j].val) {
  ------------------
  |  Branch (2299:7): [True: 899k, False: 1.37M]
  ------------------
 2300|   899k|		  subband->inclusion[j].val = ttVal;
 2301|  5.60M|		} else {
 2302|  5.60M|		  ttVal = subband->inclusion[j].val;
 2303|  5.60M|		}
 2304|  8.12M|		while (!subband->inclusion[j].finished &&
  ------------------
  |  Branch (2304:10): [True: 3.11M, False: 5.01M]
  ------------------
 2305|  3.11M|		       ttVal <= tile->layer) {
  ------------------
  |  Branch (2305:10): [True: 1.62M, False: 1.48M]
  ------------------
 2306|  1.62M|		  if (!readBits(1, &bits)) {
  ------------------
  |  Branch (2306:9): [True: 280, False: 1.62M]
  ------------------
 2307|    280|		    goto err;
 2308|    280|		  }
 2309|  1.62M|		  if (bits == 1) {
  ------------------
  |  Branch (2309:9): [True: 791k, False: 834k]
  ------------------
 2310|   791k|		    subband->inclusion[j].finished = gTrue;
  ------------------
  |  |   17|   791k|#define gTrue 1
  ------------------
 2311|   834k|		  } else {
 2312|   834k|		    ++ttVal;
 2313|   834k|		  }
 2314|  1.62M|		}
 2315|  6.50M|		subband->inclusion[j].val = ttVal;
 2316|  6.50M|		if (ttVal > tile->layer) {
  ------------------
  |  Branch (2316:7): [True: 1.48M, False: 5.01M]
  ------------------
 2317|  1.48M|		  break;
 2318|  1.48M|		}
 2319|  5.01M|		i += nx * ny;
 2320|  5.01M|	      }
 2321|  1.95M|	      cb->included = level < 0;
 2322|  1.95M|	    }
 2323|       |
 2324|  2.02M|	    if (cb->included) {
  ------------------
  |  Branch (2324:10): [True: 502k, False: 1.52M]
  ------------------
 2325|   502k|	      cover(49);
 2326|       |
 2327|       |	      // zero bit-plane count
 2328|   502k|	      if (!cb->seen) {
  ------------------
  |  Branch (2328:12): [True: 470k, False: 32.1k]
  ------------------
 2329|   470k|		cover(50);
 2330|   470k|		ttVal = 0;
 2331|   470k|		i = 0;
 2332|  3.11M|		for (level = subband->maxTTLevel; level >= 0; --level) {
  ------------------
  |  Branch (2332:37): [True: 2.64M, False: 470k]
  ------------------
 2333|  2.64M|		  nx = jpxCeilDivPow2(subband->nXCBs, level);
  ------------------
  |  |  167|  2.64M|#define jpxCeilDivPow2(x, y) (((x) + (1 << (y)) - 1) >> (y))
  ------------------
 2334|  2.64M|		  ny = jpxCeilDivPow2(subband->nYCBs, level);
  ------------------
  |  |  167|  2.64M|#define jpxCeilDivPow2(x, y) (((x) + (1 << (y)) - 1) >> (y))
  ------------------
 2335|  2.64M|		  j = i + (cbY >> level) * nx + (cbX >> level);
 2336|  2.64M|		  if (!subband->zeroBitPlane[j].finished &&
  ------------------
  |  Branch (2336:9): [True: 773k, False: 1.87M]
  ------------------
 2337|   773k|		      !subband->zeroBitPlane[j].val) {
  ------------------
  |  Branch (2337:9): [True: 773k, False: 0]
  ------------------
 2338|   773k|		    subband->zeroBitPlane[j].val = ttVal;
 2339|  1.87M|		  } else {
 2340|  1.87M|		    ttVal = subband->zeroBitPlane[j].val;
 2341|  1.87M|		  }
 2342|  4.21M|		  while (!subband->zeroBitPlane[j].finished) {
  ------------------
  |  Branch (2342:12): [True: 1.57M, False: 2.64M]
  ------------------
 2343|  1.57M|		    if (!readBits(1, &bits)) {
  ------------------
  |  Branch (2343:11): [True: 508, False: 1.56M]
  ------------------
 2344|    508|		      goto err;
 2345|    508|		    }
 2346|  1.56M|		    if (bits == 1) {
  ------------------
  |  Branch (2346:11): [True: 773k, False: 796k]
  ------------------
 2347|   773k|		      subband->zeroBitPlane[j].finished = gTrue;
  ------------------
  |  |   17|   773k|#define gTrue 1
  ------------------
 2348|   796k|		    } else {
 2349|   796k|		      ++ttVal;
 2350|   796k|		    }
 2351|  1.56M|		  }
 2352|  2.64M|		  subband->zeroBitPlane[j].val = ttVal;
 2353|  2.64M|		  i += nx * ny;
 2354|  2.64M|		}
 2355|   470k|		cb->nZeroBitPlanes = ttVal;
 2356|   470k|	      }
 2357|       |
 2358|       |	      // number of coding passes
 2359|   502k|	      if (!readBits(1, &bits)) {
  ------------------
  |  Branch (2359:12): [True: 262, False: 501k]
  ------------------
 2360|    262|		goto err;
 2361|    262|	      }
 2362|   501k|	      if (bits == 0) {
  ------------------
  |  Branch (2362:12): [True: 267k, False: 234k]
  ------------------
 2363|   267k|		cover(51);
 2364|   267k|		cb->nCodingPasses = 1;
 2365|   267k|	      } else {
 2366|   234k|		if (!readBits(1, &bits)) {
  ------------------
  |  Branch (2366:7): [True: 390, False: 233k]
  ------------------
 2367|    390|		  goto err;
 2368|    390|		}
 2369|   233k|		if (bits == 0) {
  ------------------
  |  Branch (2369:7): [True: 131k, False: 102k]
  ------------------
 2370|   131k|		  cover(52);
 2371|   131k|		  cb->nCodingPasses = 2;
 2372|   131k|		} else {
 2373|   102k|		  cover(53);
 2374|   102k|		  if (!readBits(2, &bits)) {
  ------------------
  |  Branch (2374:9): [True: 391, False: 102k]
  ------------------
 2375|    391|		    goto err;
 2376|    391|		  }
 2377|   102k|		  if (bits < 3) {
  ------------------
  |  Branch (2377:9): [True: 65.5k, False: 36.4k]
  ------------------
 2378|  65.5k|		    cover(54);
 2379|  65.5k|		    cb->nCodingPasses = 3 + bits;
 2380|  65.5k|		  } else {
 2381|  36.4k|		    cover(55);
 2382|  36.4k|		    if (!readBits(5, &bits)) {
  ------------------
  |  Branch (2382:11): [True: 537, False: 35.9k]
  ------------------
 2383|    537|		      goto err;
 2384|    537|		    }
 2385|  35.9k|		    if (bits < 31) {
  ------------------
  |  Branch (2385:11): [True: 30.4k, False: 5.54k]
  ------------------
 2386|  30.4k|		      cover(56);
 2387|  30.4k|		      cb->nCodingPasses = 6 + bits;
 2388|  30.4k|		    } else {
 2389|  5.54k|		      cover(57);
 2390|  5.54k|		      if (!readBits(7, &bits)) {
  ------------------
  |  Branch (2390:13): [True: 560, False: 4.98k]
  ------------------
 2391|    560|			goto err;
 2392|    560|		      }
 2393|  4.98k|		      cb->nCodingPasses = 37 + bits;
 2394|  4.98k|		    }
 2395|  35.9k|		  }
 2396|   102k|		}
 2397|   233k|	      }
 2398|       |
 2399|       |	      // update Lblock
 2400|  1.09M|	      while (1) {
  ------------------
  |  Branch (2400:15): [True: 1.09M, Folded]
  ------------------
 2401|  1.09M|		if (!readBits(1, &bits)) {
  ------------------
  |  Branch (2401:7): [True: 580, False: 1.09M]
  ------------------
 2402|    580|		  goto err;
 2403|    580|		}
 2404|  1.09M|		if (!bits) {
  ------------------
  |  Branch (2404:7): [True: 499k, False: 596k]
  ------------------
 2405|   499k|		  break;
 2406|   499k|		}
 2407|   596k|		++cb->lBlock;
 2408|   596k|	      }
 2409|       |
 2410|       |	      // one codeword segment for each of the coding passes
 2411|   499k|	      if (tileComp->codeBlockStyle & 0x04) {
  ------------------
  |  Branch (2411:12): [True: 245k, False: 253k]
  ------------------
 2412|   245k|		if (cb->nCodingPasses > cb->dataLenSize) {
  ------------------
  |  Branch (2412:7): [True: 118k, False: 127k]
  ------------------
 2413|   118k|		  cb->dataLenSize = cb->nCodingPasses;
 2414|   118k|		  cb->dataLen = (Guint *)greallocn(cb->dataLen,
 2415|   118k|						   cb->dataLenSize,
 2416|   118k|						   sizeof(Guint));
 2417|   118k|		}
 2418|       |
 2419|       |		// read the lengths
 2420|   926k|		for (i = 0; i < cb->nCodingPasses; ++i) {
  ------------------
  |  Branch (2420:15): [True: 680k, False: 245k]
  ------------------
 2421|   680k|		  if (!readBits(cb->lBlock, &cb->dataLen[i])) {
  ------------------
  |  Branch (2421:9): [True: 350, False: 680k]
  ------------------
 2422|    350|		    goto err;
 2423|    350|		  }
 2424|   680k|		}
 2425|       |
 2426|       |	      // one codeword segment for all of the coding passes
 2427|   253k|	      } else {
 2428|       |
 2429|       |		// read the length
 2430|   253k|		for (n = cb->lBlock, i = cb->nCodingPasses >> 1;
 2431|   437k|		     i;
  ------------------
  |  Branch (2431:8): [True: 184k, False: 253k]
  ------------------
 2432|   253k|		     ++n, i >>= 1) ;
 2433|   253k|		if (!readBits(n, &cb->dataLen[0])) {
  ------------------
  |  Branch (2433:7): [True: 698, False: 252k]
  ------------------
 2434|    698|		  goto err;
 2435|    698|		}
 2436|   253k|	      }
 2437|   499k|	    }
 2438|  2.02M|	  }
 2439|   542k|	}
 2440|   161k|      }
 2441|  70.6k|    }
 2442|   717k|    if (tileComp->style & 0x04) {
  ------------------
  |  Branch (2442:9): [True: 225k, False: 492k]
  ------------------
 2443|   225k|      skipEPH();
 2444|   225k|    }
 2445|   717k|    tilePartLen = finishBitBuf();
 2446|       |
 2447|       |    //----- packet data
 2448|       |
 2449|  2.58M|    for (sb = 0; sb < (Guint)(tile->res == 0 ? 1 : 3); ++sb) {
  ------------------
  |  Branch (2449:18): [True: 1.86M, False: 717k]
  |  Branch (2449:31): [True: 283k, False: 2.30M]
  ------------------
 2450|  1.86M|      subband = &precinct->subbands[sb];
 2451|  21.4M|      for (cbY = 0; cbY < subband->nYCBs; ++cbY) {
  ------------------
  |  Branch (2451:21): [True: 19.5M, False: 1.86M]
  ------------------
 2452|  65.8M|	for (cbX = 0; cbX < subband->nXCBs; ++cbX) {
  ------------------
  |  Branch (2452:16): [True: 46.2M, False: 19.5M]
  ------------------
 2453|  46.2M|	  cb = &subband->cbs[cbY * subband->nXCBs + cbX];
 2454|  46.2M|	  if (cb->included) {
  ------------------
  |  Branch (2454:8): [True: 375k, False: 45.8M]
  ------------------
 2455|   375k|	    if (!readCodeBlockData(tileComp, resLevel, precinct, subband,
  ------------------
  |  Branch (2455:10): [True: 0, False: 375k]
  ------------------
 2456|   375k|				   tile->res, sb, cb)) {
 2457|      0|	      return gFalse;
  ------------------
  |  |   18|      0|#define gFalse 0
  ------------------
 2458|      0|	    }
 2459|   375k|	    if (tileComp->codeBlockStyle & 0x04) {
  ------------------
  |  Branch (2459:10): [True: 231k, False: 143k]
  ------------------
 2460|   875k|	      for (i = 0; i < cb->nCodingPasses; ++i) {
  ------------------
  |  Branch (2460:20): [True: 644k, False: 231k]
  ------------------
 2461|   644k|		tilePartLen -= cb->dataLen[i];
 2462|   644k|	      }
 2463|   231k|	    } else {
 2464|   143k|	      tilePartLen -= cb->dataLen[0];
 2465|   143k|	    }
 2466|   375k|	    cb->seen = gTrue;
  ------------------
  |  |   17|   375k|#define gTrue 1
  ------------------
 2467|   375k|	  }
 2468|  46.2M|	}
 2469|  19.5M|      }
 2470|  1.86M|    }
 2471|       |
 2472|       |    //----- next packet
 2473|       |
 2474|  15.3M|  nextPacket:
 2475|  15.3M|    switch (tile->progOrder) {
  ------------------
  |  Branch (2475:13): [True: 15.3M, False: 17.8k]
  ------------------
 2476|   659k|    case 0: // layer, resolution level, component, precinct
  ------------------
  |  Branch (2476:5): [True: 659k, False: 14.6M]
  ------------------
 2477|   659k|      cover(58);
 2478|  1.01M|      do {
 2479|  1.01M|	if (++tile->precinct == tile->maxNPrecincts) {
  ------------------
  |  Branch (2479:6): [True: 646k, False: 367k]
  ------------------
 2480|   646k|	  tile->precinct = 0;
 2481|   646k|	  if (++tile->comp == img.nComps) {
  ------------------
  |  Branch (2481:8): [True: 234k, False: 412k]
  ------------------
 2482|   234k|	    tile->comp = 0;
 2483|   234k|	    if (++tile->res == tile->maxNDecompLevels + 1) {
  ------------------
  |  Branch (2483:10): [True: 48.8k, False: 185k]
  ------------------
 2484|  48.8k|	      tile->res = 0;
 2485|  48.8k|	      if (++tile->layer == tile->nLayers) {
  ------------------
  |  Branch (2485:12): [True: 198, False: 48.6k]
  ------------------
 2486|    198|		tile->layer = 0;
 2487|    198|		tile->done = gTrue;
  ------------------
  |  |   17|    198|#define gTrue 1
  ------------------
 2488|    198|	      }
 2489|  48.8k|	    }
 2490|   234k|	  }
 2491|   646k|	}
 2492|  1.01M|      } while (!tile->done &&
  ------------------
  |  Branch (2492:16): [True: 1.01M, False: 198]
  ------------------
 2493|  1.01M|	       (tile->res > tile->tileComps[tile->comp].nDecompLevels ||
  ------------------
  |  Branch (2493:10): [True: 37.3k, False: 975k]
  ------------------
 2494|   975k|		tile->precinct >= tile->tileComps[tile->comp]
  ------------------
  |  Branch (2494:3): [True: 317k, False: 658k]
  ------------------
 2495|   975k|	                                  .resLevels[tile->res].nPrecincts));
 2496|   659k|      break;
 2497|  1.28M|    case 1: // resolution level, layer, component, precinct
  ------------------
  |  Branch (2497:5): [True: 1.28M, False: 14.0M]
  ------------------
 2498|  1.28M|      cover(59);
 2499|  1.28M|      do {
 2500|  1.28M|	if (++tile->precinct == tile->maxNPrecincts) {
  ------------------
  |  Branch (2500:6): [True: 1.28M, False: 0]
  ------------------
 2501|  1.28M|	  tile->precinct = 0;
 2502|  1.28M|	  if (++tile->comp == img.nComps) {
  ------------------
  |  Branch (2502:8): [True: 1.19M, False: 85.5k]
  ------------------
 2503|  1.19M|	    tile->comp = 0;
 2504|  1.19M|	    if (++tile->layer == tile->nLayers) {
  ------------------
  |  Branch (2504:10): [True: 4.55k, False: 1.19M]
  ------------------
 2505|  4.55k|	      tile->layer = 0;
 2506|  4.55k|	      if (++tile->res == tile->maxNDecompLevels + 1) {
  ------------------
  |  Branch (2506:12): [True: 632, False: 3.92k]
  ------------------
 2507|    632|		tile->res = 0;
 2508|    632|		tile->done = gTrue;
  ------------------
  |  |   17|    632|#define gTrue 1
  ------------------
 2509|    632|	      }
 2510|  4.55k|	    }
 2511|  1.19M|	  }
 2512|  1.28M|	}
 2513|  1.28M|      } while (!tile->done &&
  ------------------
  |  Branch (2513:16): [True: 1.28M, False: 632]
  ------------------
 2514|  1.28M|	       (tile->res > tile->tileComps[tile->comp].nDecompLevels ||
  ------------------
  |  Branch (2514:10): [True: 0, False: 1.28M]
  ------------------
 2515|  1.28M|		tile->precinct >= tile->tileComps[tile->comp]
  ------------------
  |  Branch (2515:3): [True: 0, False: 1.28M]
  ------------------
 2516|  1.28M|	                                  .resLevels[tile->res].nPrecincts));
 2517|  1.28M|      break;
 2518|  56.8k|    case 2: // resolution level, precinct, component, layer
  ------------------
  |  Branch (2518:5): [True: 56.8k, False: 15.2M]
  ------------------
 2519|  56.8k|      cover(60);
 2520|       |      //~ this is incorrect if there are subsampled components (?)
 2521|  56.8k|      do {
 2522|  56.8k|	if (++tile->layer == tile->nLayers) {
  ------------------
  |  Branch (2522:6): [True: 11.1k, False: 45.6k]
  ------------------
 2523|  11.1k|	  tile->layer = 0;
 2524|  11.1k|	  if (++tile->comp == img.nComps) {
  ------------------
  |  Branch (2524:8): [True: 3.54k, False: 7.64k]
  ------------------
 2525|  3.54k|	    tile->comp = 0;
 2526|  3.54k|	    if (++tile->precinct == tile->maxNPrecincts) {
  ------------------
  |  Branch (2526:10): [True: 3.54k, False: 0]
  ------------------
 2527|  3.54k|	      tile->precinct = 0;
 2528|  3.54k|	      if (++tile->res == tile->maxNDecompLevels + 1) {
  ------------------
  |  Branch (2528:12): [True: 161, False: 3.38k]
  ------------------
 2529|    161|		tile->res = 0;
 2530|    161|		tile->done = gTrue;
  ------------------
  |  |   17|    161|#define gTrue 1
  ------------------
 2531|    161|	      }
 2532|  3.54k|	    }
 2533|  3.54k|	  }
 2534|  11.1k|	}
 2535|  56.8k|      } while (!tile->done &&
  ------------------
  |  Branch (2535:16): [True: 56.6k, False: 161]
  ------------------
 2536|  56.6k|	       (tile->res > tile->tileComps[tile->comp].nDecompLevels ||
  ------------------
  |  Branch (2536:10): [True: 0, False: 56.6k]
  ------------------
 2537|  56.6k|		tile->precinct >= tile->tileComps[tile->comp]
  ------------------
  |  Branch (2537:3): [True: 0, False: 56.6k]
  ------------------
 2538|  56.6k|	                                  .resLevels[tile->res].nPrecincts));
 2539|  56.8k|      break;
 2540|  13.3M|    case 3: // precinct, component, resolution level, layer
  ------------------
  |  Branch (2540:5): [True: 13.3M, False: 2.05M]
  ------------------
 2541|  13.3M|      cover(61);
 2542|       |      //~ this is incorrect if there are subsampled components (?)
 2543|  13.3M|      do {
 2544|  13.3M|	if (++tile->layer == tile->nLayers) {
  ------------------
  |  Branch (2544:6): [True: 50.1k, False: 13.2M]
  ------------------
 2545|  50.1k|	  tile->layer = 0;
 2546|  50.1k|	  if (++tile->res == tile->maxNDecompLevels + 1) {
  ------------------
  |  Branch (2546:8): [True: 6.25k, False: 43.9k]
  ------------------
 2547|  6.25k|	    tile->res = 0;
 2548|  6.25k|	    if (++tile->comp == img.nComps) {
  ------------------
  |  Branch (2548:10): [True: 1.49k, False: 4.75k]
  ------------------
 2549|  1.49k|	      tile->comp = 0;
 2550|  1.49k|	      if (++tile->precinct == tile->maxNPrecincts) {
  ------------------
  |  Branch (2550:12): [True: 1.31k, False: 180]
  ------------------
 2551|  1.31k|		tile->precinct = 0;
 2552|  1.31k|		tile->done = gTrue;
  ------------------
  |  |   17|  1.31k|#define gTrue 1
  ------------------
 2553|  1.31k|	      }
 2554|  1.49k|	    }
 2555|  6.25k|	  }
 2556|  50.1k|	}
 2557|  13.3M|      } while (!tile->done &&
  ------------------
  |  Branch (2557:16): [True: 13.3M, False: 1.31k]
  ------------------
 2558|  13.3M|	       (tile->res > tile->tileComps[tile->comp].nDecompLevels ||
  ------------------
  |  Branch (2558:10): [True: 1.17k, False: 13.3M]
  ------------------
 2559|  13.3M|		tile->precinct >= tile->tileComps[tile->comp]
  ------------------
  |  Branch (2559:3): [True: 1.31k, False: 13.3M]
  ------------------
 2560|  13.3M|	                                  .resLevels[tile->res].nPrecincts));
 2561|  13.3M|      break;
 2562|  33.2k|    case 4: // component, precinct, resolution level, layer
  ------------------
  |  Branch (2562:5): [True: 33.2k, False: 15.3M]
  ------------------
 2563|  33.2k|      cover(62);
 2564|  35.4k|      do {
 2565|  35.4k|	if (++tile->layer == tile->nLayers) {
  ------------------
  |  Branch (2565:6): [True: 8.34k, False: 27.1k]
  ------------------
 2566|  8.34k|	  tile->layer = 0;
 2567|  8.34k|	  if (++tile->res == tile->maxNDecompLevels + 1) {
  ------------------
  |  Branch (2567:8): [True: 1.50k, False: 6.84k]
  ------------------
 2568|  1.50k|	    tile->res = 0;
 2569|  1.50k|	    if (++tile->precinct == tile->maxNPrecincts) {
  ------------------
  |  Branch (2569:10): [True: 681, False: 823]
  ------------------
 2570|    681|	      tile->precinct = 0;
 2571|    681|	      if (++tile->comp == img.nComps) {
  ------------------
  |  Branch (2571:12): [True: 157, False: 524]
  ------------------
 2572|    157|		tile->comp = 0;
 2573|    157|		tile->done = gTrue;
  ------------------
  |  |   17|    157|#define gTrue 1
  ------------------
 2574|    157|	      }
 2575|    681|	    }
 2576|  1.50k|	  }
 2577|  8.34k|	}
 2578|  35.4k|      } while (!tile->done &&
  ------------------
  |  Branch (2578:16): [True: 35.3k, False: 157]
  ------------------
 2579|  35.3k|	       (tile->res > tile->tileComps[tile->comp].nDecompLevels ||
  ------------------
  |  Branch (2579:10): [True: 314, False: 35.0k]
  ------------------
 2580|  35.0k|		tile->precinct >= tile->tileComps[tile->comp]
  ------------------
  |  Branch (2580:3): [True: 1.86k, False: 33.1k]
  ------------------
 2581|  35.0k|	                                  .resLevels[tile->res].nPrecincts));
 2582|  33.2k|      break;
 2583|  15.3M|    }
 2584|  15.3M|  }
 2585|       |
 2586|  1.77k|  return gTrue;
  ------------------
  |  |   17|  1.77k|#define gTrue 1
  ------------------
 2587|       |
 2588|  6.35k| err:
 2589|  6.35k|  error(errSyntaxError, getPos(), "Error in JPX stream");
 2590|  6.35k|  return gFalse;
  ------------------
  |  |   18|  6.35k|#define gFalse 0
  ------------------
 2591|  10.7k|}
_ZN9JPXStream17readCodeBlockDataEP11JPXTileCompP11JPXResLevelP11JPXPrecinctP10JPXSubbandjjP12JPXCodeBlock:
 2598|   375k|				   JPXCodeBlock *cb) {
 2599|   375k|  int *coeff0, *coeff1, *coeff;
 2600|   375k|  char *touched0, *touched1, *touched;
 2601|   375k|  Guint horiz, vert, diag, all, cx, xorBit;
 2602|   375k|  int horizSign, vertSign, bit;
 2603|   375k|  int segSym;
 2604|   375k|  Guint n, i, x, y0, y1;
 2605|       |
 2606|   375k|  if (res > tileComp->nDecompLevels - reduction) {
  ------------------
  |  Branch (2606:7): [True: 0, False: 375k]
  ------------------
 2607|       |    // skip the codeblock data
 2608|      0|    if (tileComp->codeBlockStyle & 0x04) {
  ------------------
  |  Branch (2608:9): [True: 0, False: 0]
  ------------------
 2609|      0|      n = 0;
 2610|      0|      for (i = 0; i < cb->nCodingPasses; ++i) {
  ------------------
  |  Branch (2610:19): [True: 0, False: 0]
  ------------------
 2611|      0|	n += cb->dataLen[i];
 2612|      0|      }
 2613|      0|    } else {
 2614|      0|      n = cb->dataLen[0];
 2615|      0|    }
 2616|      0|    bufStr->discardChars(n);
 2617|      0|    return gTrue;
  ------------------
  |  |   17|      0|#define gTrue 1
  ------------------
 2618|      0|  }
 2619|       |
 2620|   375k|  if (cb->arithDecoder) {
  ------------------
  |  Branch (2620:7): [True: 30.3k, False: 345k]
  ------------------
 2621|  30.3k|    cover(63);
 2622|  30.3k|    if (tileComp->codeBlockStyle & 0x04) {
  ------------------
  |  Branch (2622:9): [True: 3.95k, False: 26.3k]
  ------------------
 2623|  3.95k|      cb->arithDecoder->setStream(bufStr, cb->dataLen[0]);
 2624|  3.95k|      cb->arithDecoder->start();
 2625|  26.3k|    } else {
 2626|  26.3k|      cb->arithDecoder->restart(cb->dataLen[0]);
 2627|  26.3k|    }
 2628|   345k|  } else {
 2629|   345k|    cover(64);
 2630|   345k|    cb->arithDecoder = new JArithmeticDecoder();
 2631|   345k|    cb->arithDecoder->setStream(bufStr, cb->dataLen[0]);
 2632|   345k|    cb->arithDecoder->start();
 2633|   345k|    cb->stats = new JArithmeticDecoderStats(jpxNContexts);
  ------------------
  |  |   36|   345k|#define jpxNContexts        19
  ------------------
 2634|   345k|    cb->stats->setEntry(jpxContextSigProp, 4, 0);
  ------------------
  |  |   38|   345k|#define jpxContextSigProp    0	// 0 - 8: significance prop and cleanup
  ------------------
 2635|   345k|    cb->stats->setEntry(jpxContextRunLength, 3, 0);
  ------------------
  |  |   41|   345k|#define jpxContextRunLength 17	// cleanup: run length
  ------------------
 2636|   345k|    cb->stats->setEntry(jpxContextUniform, 46, 0);
  ------------------
  |  |   42|   345k|#define jpxContextUniform   18	// cleanup: first signif coeff
  ------------------
 2637|   345k|  }
 2638|       |
 2639|  1.63M|  for (i = 0; i < cb->nCodingPasses; ++i) {
  ------------------
  |  Branch (2639:15): [True: 1.26M, False: 375k]
  ------------------
 2640|  1.26M|    if ((tileComp->codeBlockStyle & 0x04) && i > 0) {
  ------------------
  |  Branch (2640:9): [True: 644k, False: 617k]
  |  Branch (2640:46): [True: 412k, False: 231k]
  ------------------
 2641|   412k|      cb->arithDecoder->setStream(bufStr, cb->dataLen[i]);
 2642|   412k|      cb->arithDecoder->start();
 2643|   412k|    }
 2644|       |
 2645|  1.26M|    switch (cb->nextPass) {
  ------------------
  |  Branch (2645:13): [True: 1.26M, False: 0]
  ------------------
 2646|       |
 2647|       |    //----- significance propagation pass
 2648|   394k|    case jpxPassSigProp:
  ------------------
  |  |   46|   394k|#define jpxPassSigProp       0
  ------------------
  |  Branch (2648:5): [True: 394k, False: 866k]
  ------------------
 2649|   394k|      cover(65);
 2650|   394k|      for (y0 = cb->y0, coeff0 = cb->coeffs, touched0 = cb->touched;
 2651|  1.47M|	   y0 < cb->y1;
  ------------------
  |  Branch (2651:5): [True: 1.07M, False: 394k]
  ------------------
 2652|  1.07M|	   y0 += 4, coeff0 += 4 * tileComp->w,
 2653|  1.07M|	     touched0 += 4 << resLevel->codeBlockW) {
 2654|  1.07M|	for (x = cb->x0, coeff1 = coeff0, touched1 = touched0;
 2655|  7.29M|	     x < cb->x1;
  ------------------
  |  Branch (2655:7): [True: 6.21M, False: 1.07M]
  ------------------
 2656|  6.21M|	     ++x, ++coeff1, ++touched1) {
 2657|  6.21M|	  for (y1 = 0, coeff = coeff1, touched = touched1;
 2658|  27.3M|	       y1 < 4 && y0+y1 < cb->y1;
  ------------------
  |  Branch (2658:9): [True: 22.8M, False: 4.45M]
  |  Branch (2658:19): [True: 21.1M, False: 1.76M]
  ------------------
 2659|  21.1M|	       ++y1, coeff += tileComp->w, touched += resLevel->cbW) {
 2660|  21.1M|	    if (!*coeff) {
  ------------------
  |  Branch (2660:10): [True: 10.3M, False: 10.8M]
  ------------------
 2661|  10.3M|	      horiz = vert = diag = 0;
 2662|  10.3M|	      horizSign = vertSign = 2;
 2663|  10.3M|	      if (x > cb->x0) {
  ------------------
  |  Branch (2663:12): [True: 8.91M, False: 1.40M]
  ------------------
 2664|  8.91M|		if (coeff[-1]) {
  ------------------
  |  Branch (2664:7): [True: 1.17M, False: 7.73M]
  ------------------
 2665|  1.17M|		  ++horiz;
 2666|  1.17M|		  horizSign += coeff[-1] < 0 ? -1 : 1;
  ------------------
  |  Branch (2666:18): [True: 573k, False: 604k]
  ------------------
 2667|  1.17M|		}
 2668|  8.91M|		if (y0+y1 > cb->y0) {
  ------------------
  |  Branch (2668:7): [True: 7.63M, False: 1.27M]
  ------------------
 2669|  7.63M|		  diag += coeff[-(int)tileComp->w - 1] ? 1 : 0;
  ------------------
  |  Branch (2669:13): [True: 990k, False: 6.64M]
  ------------------
 2670|  7.63M|		}
 2671|  8.91M|		if (y0+y1 < cb->y1 - 1 &&
  ------------------
  |  Branch (2671:7): [True: 7.77M, False: 1.13M]
  ------------------
 2672|  7.77M|		    (!(tileComp->codeBlockStyle & 0x08) || y1 < 3)) {
  ------------------
  |  Branch (2672:8): [True: 7.44M, False: 338k]
  |  Branch (2672:46): [True: 267k, False: 70.9k]
  ------------------
 2673|  7.70M|		  diag += coeff[tileComp->w - 1] ? 1 : 0;
  ------------------
  |  Branch (2673:13): [True: 1.04M, False: 6.66M]
  ------------------
 2674|  7.70M|		}
 2675|  8.91M|	      }
 2676|  10.3M|	      if (x < cb->x1 - 1) {
  ------------------
  |  Branch (2676:12): [True: 9.05M, False: 1.26M]
  ------------------
 2677|  9.05M|		if (coeff[1]) {
  ------------------
  |  Branch (2677:7): [True: 839k, False: 8.21M]
  ------------------
 2678|   839k|		  ++horiz;
 2679|   839k|		  horizSign += coeff[1] < 0 ? -1 : 1;
  ------------------
  |  Branch (2679:18): [True: 426k, False: 412k]
  ------------------
 2680|   839k|		}
 2681|  9.05M|		if (y0+y1 > cb->y0) {
  ------------------
  |  Branch (2681:7): [True: 7.75M, False: 1.30M]
  ------------------
 2682|  7.75M|		  diag += coeff[-(int)tileComp->w + 1] ? 1 : 0;
  ------------------
  |  Branch (2682:13): [True: 798k, False: 6.95M]
  ------------------
 2683|  7.75M|		}
 2684|  9.05M|		if (y0+y1 < cb->y1 - 1 &&
  ------------------
  |  Branch (2684:7): [True: 7.89M, False: 1.15M]
  ------------------
 2685|  7.89M|		    (!(tileComp->codeBlockStyle & 0x08) || y1 < 3)) {
  ------------------
  |  Branch (2685:8): [True: 7.54M, False: 353k]
  |  Branch (2685:46): [True: 279k, False: 73.6k]
  ------------------
 2686|  7.82M|		  diag += coeff[tileComp->w + 1] ? 1 : 0;
  ------------------
  |  Branch (2686:13): [True: 845k, False: 6.97M]
  ------------------
 2687|  7.82M|		}
 2688|  9.05M|	      }
 2689|  10.3M|	      if (y0+y1 > cb->y0) {
  ------------------
  |  Branch (2689:12): [True: 8.73M, False: 1.57M]
  ------------------
 2690|  8.73M|		if (coeff[-(int)tileComp->w]) {
  ------------------
  |  Branch (2690:7): [True: 1.19M, False: 7.53M]
  ------------------
 2691|  1.19M|		  ++vert;
 2692|  1.19M|		  vertSign += coeff[-(int)tileComp->w] < 0 ? -1 : 1;
  ------------------
  |  Branch (2692:17): [True: 601k, False: 595k]
  ------------------
 2693|  1.19M|		}
 2694|  8.73M|	      }
 2695|  10.3M|	      if (y0+y1 < cb->y1 - 1 &&
  ------------------
  |  Branch (2695:12): [True: 8.90M, False: 1.40M]
  ------------------
 2696|  8.90M|		  (!(tileComp->codeBlockStyle & 0x08) || y1 < 3)) {
  ------------------
  |  Branch (2696:6): [True: 8.44M, False: 461k]
  |  Branch (2696:44): [True: 373k, False: 87.9k]
  ------------------
 2697|  8.81M|		if (coeff[tileComp->w]) {
  ------------------
  |  Branch (2697:7): [True: 852k, False: 7.96M]
  ------------------
 2698|   852k|		  ++vert;
 2699|   852k|		  vertSign += coeff[tileComp->w] < 0 ? -1 : 1;
  ------------------
  |  Branch (2699:17): [True: 432k, False: 419k]
  ------------------
 2700|   852k|		}
 2701|  8.81M|	      }
 2702|  10.3M|	      cx = sigPropContext[horiz][vert][diag][res == 0 ? 1 : sb];
  ------------------
  |  Branch (2702:47): [True: 714k, False: 9.59M]
  ------------------
 2703|  10.3M|	      if (cx != 0) {
  ------------------
  |  Branch (2703:12): [True: 2.19M, False: 8.11M]
  ------------------
 2704|  2.19M|		if (cb->arithDecoder->decodeBit(cx, cb->stats)) {
  ------------------
  |  Branch (2704:7): [True: 981k, False: 1.21M]
  ------------------
 2705|   981k|		  cx = signContext[horizSign][vertSign][0];
 2706|   981k|		  xorBit = signContext[horizSign][vertSign][1];
 2707|   981k|		  if (cb->arithDecoder->decodeBit(cx, cb->stats) ^ xorBit) {
  ------------------
  |  Branch (2707:9): [True: 502k, False: 479k]
  ------------------
 2708|   502k|		    *coeff = -1;
 2709|   502k|		  } else {
 2710|   479k|		    *coeff = 1;
 2711|   479k|		  }
 2712|   981k|		}
 2713|  2.19M|		*touched = 1;
 2714|  2.19M|	      }
 2715|  10.3M|	    }
 2716|  21.1M|	  }
 2717|  6.21M|	}
 2718|  1.07M|      }
 2719|   394k|      ++cb->nextPass;
 2720|   394k|      break;
 2721|       |
 2722|       |    //----- magnitude refinement pass
 2723|   284k|    case jpxPassMagRef:
  ------------------
  |  |   47|   284k|#define jpxPassMagRef        1
  ------------------
  |  Branch (2723:5): [True: 284k, False: 976k]
  ------------------
 2724|   284k|      cover(66);
 2725|   284k|      for (y0 = cb->y0, coeff0 = cb->coeffs, touched0 = cb->touched;
 2726|  1.19M|	   y0 < cb->y1;
  ------------------
  |  Branch (2726:5): [True: 907k, False: 284k]
  ------------------
 2727|   907k|	   y0 += 4, coeff0 += 4 * tileComp->w,
 2728|   907k|	     touched0 += 4 << resLevel->codeBlockW) {
 2729|   907k|	for (x = cb->x0, coeff1 = coeff0, touched1 = touched0;
 2730|  6.01M|	     x < cb->x1;
  ------------------
  |  Branch (2730:7): [True: 5.10M, False: 907k]
  ------------------
 2731|  5.10M|	     ++x, ++coeff1, ++touched1) {
 2732|  5.10M|	  for (y1 = 0, coeff = coeff1, touched = touched1;
 2733|  22.8M|	       y1 < 4 && y0+y1 < cb->y1;
  ------------------
  |  Branch (2733:9): [True: 18.9M, False: 3.82M]
  |  Branch (2733:19): [True: 17.7M, False: 1.27M]
  ------------------
 2734|  17.7M|	       ++y1, coeff += tileComp->w, touched += resLevel->cbW) {
 2735|  17.7M|	    if (*coeff && !*touched) {
  ------------------
  |  Branch (2735:10): [True: 10.7M, False: 6.96M]
  |  Branch (2735:20): [True: 10.0M, False: 655k]
  ------------------
 2736|  10.0M|	      if (*coeff == 1 || *coeff == -1) {
  ------------------
  |  Branch (2736:12): [True: 452k, False: 9.64M]
  |  Branch (2736:27): [True: 435k, False: 9.20M]
  ------------------
 2737|   888k|		all = 0;
 2738|   888k|		if (x > cb->x0) {
  ------------------
  |  Branch (2738:7): [True: 795k, False: 92.6k]
  ------------------
 2739|   795k|		  all += coeff[-1] ? 1 : 0;
  ------------------
  |  Branch (2739:12): [True: 610k, False: 184k]
  ------------------
 2740|   795k|		  if (y0+y1 > cb->y0) {
  ------------------
  |  Branch (2740:9): [True: 718k, False: 77.0k]
  ------------------
 2741|   718k|		    all += coeff[-(int)tileComp->w - 1] ? 1 : 0;
  ------------------
  |  Branch (2741:14): [True: 521k, False: 197k]
  ------------------
 2742|   718k|		  }
 2743|   795k|		  if (y0+y1 < cb->y1 - 1 &&
  ------------------
  |  Branch (2743:9): [True: 679k, False: 115k]
  ------------------
 2744|   679k|		      (!(tileComp->codeBlockStyle & 0x08) || y1 < 3)) {
  ------------------
  |  Branch (2744:10): [True: 611k, False: 67.8k]
  |  Branch (2744:48): [True: 56.0k, False: 11.8k]
  ------------------
 2745|   667k|		    all += coeff[tileComp->w - 1] ? 1 : 0;
  ------------------
  |  Branch (2745:14): [True: 523k, False: 144k]
  ------------------
 2746|   667k|		  }
 2747|   795k|		}
 2748|   888k|		if (x < cb->x1 - 1) {
  ------------------
  |  Branch (2748:7): [True: 755k, False: 132k]
  ------------------
 2749|   755k|		  all += coeff[1] ? 1 : 0;
  ------------------
  |  Branch (2749:12): [True: 609k, False: 146k]
  ------------------
 2750|   755k|		  if (y0+y1 > cb->y0) {
  ------------------
  |  Branch (2750:9): [True: 687k, False: 68.4k]
  ------------------
 2751|   687k|		    all += coeff[-(int)tileComp->w + 1] ? 1 : 0;
  ------------------
  |  Branch (2751:14): [True: 534k, False: 152k]
  ------------------
 2752|   687k|		  }
 2753|   755k|		  if (y0+y1 < cb->y1 - 1 &&
  ------------------
  |  Branch (2753:9): [True: 647k, False: 107k]
  ------------------
 2754|   647k|		      (!(tileComp->codeBlockStyle & 0x08) || y1 < 3)) {
  ------------------
  |  Branch (2754:10): [True: 582k, False: 65.6k]
  |  Branch (2754:48): [True: 54.0k, False: 11.6k]
  ------------------
 2755|   636k|		    all += coeff[tileComp->w + 1] ? 1 : 0;
  ------------------
  |  Branch (2755:14): [True: 517k, False: 118k]
  ------------------
 2756|   636k|		  }
 2757|   755k|		}
 2758|   888k|		if (y0+y1 > cb->y0) {
  ------------------
  |  Branch (2758:7): [True: 803k, False: 84.3k]
  ------------------
 2759|   803k|		  all += coeff[-(int)tileComp->w] ? 1 : 0;
  ------------------
  |  Branch (2759:12): [True: 632k, False: 171k]
  ------------------
 2760|   803k|		}
 2761|   888k|		if (y0+y1 < cb->y1 - 1 &&
  ------------------
  |  Branch (2761:7): [True: 756k, False: 131k]
  ------------------
 2762|   756k|		    (!(tileComp->codeBlockStyle & 0x08) || y1 < 3)) {
  ------------------
  |  Branch (2762:8): [True: 679k, False: 77.2k]
  |  Branch (2762:46): [True: 63.8k, False: 13.4k]
  ------------------
 2763|   742k|		  all += coeff[tileComp->w] ? 1 : 0;
  ------------------
  |  Branch (2763:12): [True: 613k, False: 129k]
  ------------------
 2764|   742k|		}
 2765|   888k|		cx = all ? 15 : 14;
  ------------------
  |  Branch (2765:8): [True: 885k, False: 3.17k]
  ------------------
 2766|  9.20M|	      } else {
 2767|  9.20M|		cx = 16;
 2768|  9.20M|	      }
 2769|  10.0M|	      bit = cb->arithDecoder->decodeBit(cx, cb->stats);
 2770|  10.0M|	      if (*coeff < 0) {
  ------------------
  |  Branch (2770:12): [True: 5.03M, False: 5.05M]
  ------------------
 2771|  5.03M|		*coeff = (*coeff << 1) - bit;
 2772|  5.05M|	      } else {
 2773|  5.05M|		*coeff = (*coeff << 1) + bit;
 2774|  5.05M|	      }
 2775|  10.0M|	      *touched = 1;
 2776|  10.0M|	    }
 2777|  17.7M|	  }
 2778|  5.10M|	}
 2779|   907k|      }
 2780|   284k|      ++cb->nextPass;
 2781|   284k|      break;
 2782|       |
 2783|       |    //----- cleanup pass
 2784|   581k|    case jpxPassCleanup:
  ------------------
  |  |   48|   581k|#define jpxPassCleanup       2
  ------------------
  |  Branch (2784:5): [True: 581k, False: 679k]
  ------------------
 2785|   581k|      cover(67);
 2786|   581k|      for (y0 = cb->y0, coeff0 = cb->coeffs, touched0 = cb->touched;
 2787|  1.97M|	   y0 < cb->y1;
  ------------------
  |  Branch (2787:5): [True: 1.38M, False: 581k]
  ------------------
 2788|  1.38M|	   y0 += 4, coeff0 += 4 * tileComp->w,
 2789|  1.38M|	     touched0 += 4 << resLevel->codeBlockW) {
 2790|  1.38M|	for (x = cb->x0, coeff1 = coeff0, touched1 = touched0;
 2791|  9.69M|	     x < cb->x1;
  ------------------
  |  Branch (2791:7): [True: 8.30M, False: 1.38M]
  ------------------
 2792|  8.30M|	     ++x, ++coeff1, ++touched1) {
 2793|  8.30M|	  y1 = 0;
 2794|  8.30M|	  if (y0 + 3 < cb->y1 &&
  ------------------
  |  Branch (2794:8): [True: 5.60M, False: 2.69M]
  ------------------
 2795|  5.60M|	      !(*touched1) &&
  ------------------
  |  Branch (2795:8): [True: 3.28M, False: 2.32M]
  ------------------
 2796|  3.28M|	      !(touched1[resLevel->cbW]) &&
  ------------------
  |  Branch (2796:8): [True: 3.25M, False: 23.6k]
  ------------------
 2797|  3.25M|	      !(touched1[2 * resLevel->cbW]) &&
  ------------------
  |  Branch (2797:8): [True: 3.22M, False: 28.7k]
  ------------------
 2798|  3.22M|	      !(touched1[3 * resLevel->cbW]) &&
  ------------------
  |  Branch (2798:8): [True: 3.20M, False: 24.7k]
  ------------------
 2799|  3.20M|	      (x == cb->x0 || y0 == cb->y0 ||
  ------------------
  |  Branch (2799:9): [True: 407k, False: 2.79M]
  |  Branch (2799:24): [True: 1.68M, False: 1.11M]
  ------------------
 2800|  1.11M|	       !coeff1[-(int)tileComp->w - 1]) &&
  ------------------
  |  Branch (2800:9): [True: 1.02M, False: 85.7k]
  ------------------
 2801|  3.11M|	      (y0 == cb->y0 ||
  ------------------
  |  Branch (2801:9): [True: 2.00M, False: 1.11M]
  ------------------
 2802|  1.11M|	       !coeff1[-(int)tileComp->w]) &&
  ------------------
  |  Branch (2802:9): [True: 1.06M, False: 46.4k]
  ------------------
 2803|  3.07M|	      (x == cb->x1 - 1 || y0 == cb->y0 ||
  ------------------
  |  Branch (2803:9): [True: 381k, False: 2.68M]
  |  Branch (2803:28): [True: 1.68M, False: 1.00M]
  ------------------
 2804|  1.00M|	       !coeff1[-(int)tileComp->w + 1]) &&
  ------------------
  |  Branch (2804:9): [True: 968k, False: 31.8k]
  ------------------
 2805|  3.03M|	      (x == cb->x0 ||
  ------------------
  |  Branch (2805:9): [True: 398k, False: 2.64M]
  ------------------
 2806|  2.64M|	       (!coeff1[-1] &&
  ------------------
  |  Branch (2806:10): [True: 2.48M, False: 152k]
  ------------------
 2807|  2.48M|		!coeff1[tileComp->w - 1] &&
  ------------------
  |  Branch (2807:3): [True: 2.41M, False: 78.5k]
  ------------------
 2808|  2.41M|		!coeff1[2 * tileComp->w - 1] && 
  ------------------
  |  Branch (2808:3): [True: 2.33M, False: 70.8k]
  ------------------
 2809|  2.33M|		!coeff1[3 * tileComp->w - 1])) &&
  ------------------
  |  Branch (2809:3): [True: 2.25M, False: 81.9k]
  ------------------
 2810|  2.65M|	      (x == cb->x1 - 1 ||
  ------------------
  |  Branch (2810:9): [True: 318k, False: 2.33M]
  ------------------
 2811|  2.33M|	       (!coeff1[1] &&
  ------------------
  |  Branch (2811:10): [True: 2.33M, False: 1.19k]
  ------------------
 2812|  2.33M|		!coeff1[tileComp->w + 1] &&
  ------------------
  |  Branch (2812:3): [True: 2.33M, False: 842]
  ------------------
 2813|  2.33M|		!coeff1[2 * tileComp->w + 1] &&
  ------------------
  |  Branch (2813:3): [True: 2.33M, False: 875]
  ------------------
 2814|  2.33M|		!coeff1[3 * tileComp->w + 1])) &&
  ------------------
  |  Branch (2814:3): [True: 2.33M, False: 2.18k]
  ------------------
 2815|  2.65M|	      ((tileComp->codeBlockStyle & 0x08) ||
  ------------------
  |  Branch (2815:9): [True: 138k, False: 2.51M]
  ------------------
 2816|  2.51M|	       ((x == cb->x0 || y0+4 == cb->y1 ||
  ------------------
  |  Branch (2816:11): [True: 353k, False: 2.15M]
  |  Branch (2816:26): [True: 399k, False: 1.75M]
  ------------------
 2817|  1.75M|		 !coeff1[4 * tileComp->w - 1]) &&
  ------------------
  |  Branch (2817:4): [True: 1.75M, False: 4.25k]
  ------------------
 2818|  2.50M|		(y0+4 == cb->y1 ||
  ------------------
  |  Branch (2818:4): [True: 498k, False: 2.00M]
  ------------------
 2819|  2.00M|		 !coeff1[4 * tileComp->w]) &&
  ------------------
  |  Branch (2819:4): [True: 2.00M, False: 1.92k]
  ------------------
 2820|  2.50M|		(x == cb->x1 - 1 || y0+4 == cb->y1 ||
  ------------------
  |  Branch (2820:4): [True: 280k, False: 2.22M]
  |  Branch (2820:23): [True: 405k, False: 1.81M]
  ------------------
 2821|  2.63M|		 !coeff1[4 * tileComp->w + 1])))) {
  ------------------
  |  Branch (2821:4): [True: 1.81M, False: 7.31k]
  ------------------
 2822|  2.63M|	    if (cb->arithDecoder->decodeBit(jpxContextRunLength, cb->stats)) {
  ------------------
  |  |   41|  2.63M|#define jpxContextRunLength 17	// cleanup: run length
  ------------------
  |  Branch (2822:10): [True: 98.4k, False: 2.53M]
  ------------------
 2823|  98.4k|	      y1 = cb->arithDecoder->decodeBit(jpxContextUniform, cb->stats);
  ------------------
  |  |   42|  98.4k|#define jpxContextUniform   18	// cleanup: first signif coeff
  ------------------
 2824|  98.4k|	      y1 = (y1 << 1) |
 2825|  98.4k|		   cb->arithDecoder->decodeBit(jpxContextUniform, cb->stats);
  ------------------
  |  |   42|  98.4k|#define jpxContextUniform   18	// cleanup: first signif coeff
  ------------------
 2826|  98.4k|	      coeff = &coeff1[y1 * tileComp->w];
 2827|  98.4k|	      cx = signContext[2][2][0];
 2828|  98.4k|	      xorBit = signContext[2][2][1];
 2829|  98.4k|	      if (cb->arithDecoder->decodeBit(cx, cb->stats) ^ xorBit) {
  ------------------
  |  Branch (2829:12): [True: 74.6k, False: 23.8k]
  ------------------
 2830|  74.6k|		*coeff = -1;
 2831|  74.6k|	      } else {
 2832|  23.8k|		*coeff = 1;
 2833|  23.8k|	      }
 2834|  98.4k|	      ++y1;
 2835|  2.53M|	    } else {
 2836|  2.53M|	      y1 = 4;
 2837|  2.53M|	    }
 2838|  2.63M|	  }
 2839|  8.30M|	  for (coeff = &coeff1[y1 * tileComp->w],
 2840|  8.30M|		 touched = &touched1[y1 << resLevel->codeBlockW];
 2841|  25.3M|	       y1 < 4 && y0 + y1 < cb->y1;
  ------------------
  |  Branch (2841:9): [True: 19.7M, False: 5.60M]
  |  Branch (2841:19): [True: 17.0M, False: 2.69M]
  ------------------
 2842|  17.0M|	       ++y1, coeff += tileComp->w, touched += resLevel->cbW) {
 2843|  17.0M|	    if (!*touched) {
  ------------------
  |  Branch (2843:10): [True: 6.32M, False: 10.6M]
  ------------------
 2844|  6.32M|	      horiz = vert = diag = 0;
 2845|  6.32M|	      horizSign = vertSign = 2;
 2846|  6.32M|	      if (x > cb->x0) {
  ------------------
  |  Branch (2846:12): [True: 5.60M, False: 723k]
  ------------------
 2847|  5.60M|		if (coeff[-1]) {
  ------------------
  |  Branch (2847:7): [True: 1.55M, False: 4.04M]
  ------------------
 2848|  1.55M|		  ++horiz;
 2849|  1.55M|		  horizSign += coeff[-1] < 0 ? -1 : 1;
  ------------------
  |  Branch (2849:18): [True: 772k, False: 786k]
  ------------------
 2850|  1.55M|		}
 2851|  5.60M|		if (y0+y1 > cb->y0) {
  ------------------
  |  Branch (2851:7): [True: 4.73M, False: 867k]
  ------------------
 2852|  4.73M|		  diag += coeff[-(int)tileComp->w - 1] ? 1 : 0;
  ------------------
  |  Branch (2852:13): [True: 1.20M, False: 3.52M]
  ------------------
 2853|  4.73M|		}
 2854|  5.60M|		if (y0+y1 < cb->y1 - 1 &&
  ------------------
  |  Branch (2854:7): [True: 3.87M, False: 1.73M]
  ------------------
 2855|  3.87M|		    (!(tileComp->codeBlockStyle & 0x08) || y1 < 3)) {
  ------------------
  |  Branch (2855:8): [True: 3.70M, False: 166k]
  |  Branch (2855:46): [True: 133k, False: 32.4k]
  ------------------
 2856|  3.83M|		  diag += coeff[tileComp->w - 1] ? 1 : 0;
  ------------------
  |  Branch (2856:13): [True: 1.04M, False: 2.78M]
  ------------------
 2857|  3.83M|		}
 2858|  5.60M|	      }
 2859|  6.32M|	      if (x < cb->x1 - 1) {
  ------------------
  |  Branch (2859:12): [True: 5.38M, False: 944k]
  ------------------
 2860|  5.38M|		if (coeff[1]) {
  ------------------
  |  Branch (2860:7): [True: 44.5k, False: 5.33M]
  ------------------
 2861|  44.5k|		  ++horiz;
 2862|  44.5k|		  horizSign += coeff[1] < 0 ? -1 : 1;
  ------------------
  |  Branch (2862:18): [True: 21.7k, False: 22.8k]
  ------------------
 2863|  44.5k|		}
 2864|  5.38M|		if (y0+y1 > cb->y0) {
  ------------------
  |  Branch (2864:7): [True: 4.56M, False: 815k]
  ------------------
 2865|  4.56M|		  diag += coeff[-(int)tileComp->w + 1] ? 1 : 0;
  ------------------
  |  Branch (2865:13): [True: 287k, False: 4.27M]
  ------------------
 2866|  4.56M|		}
 2867|  5.38M|		if (y0+y1 < cb->y1 - 1 &&
  ------------------
  |  Branch (2867:7): [True: 3.64M, False: 1.73M]
  ------------------
 2868|  3.64M|		    (!(tileComp->codeBlockStyle & 0x08) || y1 < 3)) {
  ------------------
  |  Branch (2868:8): [True: 3.49M, False: 155k]
  |  Branch (2868:46): [True: 125k, False: 30.1k]
  ------------------
 2869|  3.61M|		  diag += coeff[tileComp->w + 1] ? 1 : 0;
  ------------------
  |  Branch (2869:13): [True: 71.2k, False: 3.54M]
  ------------------
 2870|  3.61M|		}
 2871|  5.38M|	      }
 2872|  6.32M|	      if (y0+y1 > cb->y0) {
  ------------------
  |  Branch (2872:12): [True: 5.29M, False: 1.03M]
  ------------------
 2873|  5.29M|		if (coeff[-(int)tileComp->w]) {
  ------------------
  |  Branch (2873:7): [True: 1.42M, False: 3.86M]
  ------------------
 2874|  1.42M|		  ++vert;
 2875|  1.42M|		  vertSign += coeff[-(int)tileComp->w] < 0 ? -1 : 1;
  ------------------
  |  Branch (2875:17): [True: 705k, False: 723k]
  ------------------
 2876|  1.42M|		}
 2877|  5.29M|	      }
 2878|  6.32M|	      if (y0+y1 < cb->y1 - 1 &&
  ------------------
  |  Branch (2878:12): [True: 4.23M, False: 2.08M]
  ------------------
 2879|  4.23M|		  (!(tileComp->codeBlockStyle & 0x08) || y1 < 3)) {
  ------------------
  |  Branch (2879:6): [True: 4.05M, False: 188k]
  |  Branch (2879:44): [True: 153k, False: 34.7k]
  ------------------
 2880|  4.20M|		if (coeff[tileComp->w]) {
  ------------------
  |  Branch (2880:7): [True: 38.7k, False: 4.16M]
  ------------------
 2881|  38.7k|		  ++vert;
 2882|  38.7k|		  vertSign += coeff[tileComp->w] < 0 ? -1 : 1;
  ------------------
  |  Branch (2882:17): [True: 18.8k, False: 19.8k]
  ------------------
 2883|  38.7k|		}
 2884|  4.20M|	      }
 2885|  6.32M|	      cx = sigPropContext[horiz][vert][diag][res == 0 ? 1 : sb];
  ------------------
  |  Branch (2885:47): [True: 196k, False: 6.12M]
  ------------------
 2886|  6.32M|	      if (cb->arithDecoder->decodeBit(cx, cb->stats)) {
  ------------------
  |  Branch (2886:12): [True: 1.77M, False: 4.55M]
  ------------------
 2887|  1.77M|		cx = signContext[horizSign][vertSign][0];
 2888|  1.77M|		xorBit = signContext[horizSign][vertSign][1];
 2889|  1.77M|		if (cb->arithDecoder->decodeBit(cx, cb->stats) ^ xorBit) {
  ------------------
  |  Branch (2889:7): [True: 843k, False: 930k]
  ------------------
 2890|   843k|		  *coeff = -1;
 2891|   930k|		} else {
 2892|   930k|		  *coeff = 1;
 2893|   930k|		}
 2894|  1.77M|	      }
 2895|  10.6M|	    } else {
 2896|  10.6M|	      *touched = 0;
 2897|  10.6M|	    }
 2898|  17.0M|	  }
 2899|  8.30M|	}
 2900|  1.38M|      }
 2901|   581k|      ++cb->len;
 2902|       |      // look for a segmentation symbol
 2903|   581k|      if (tileComp->codeBlockStyle & 0x20) {
  ------------------
  |  Branch (2903:11): [True: 51.2k, False: 530k]
  ------------------
 2904|  51.2k|	segSym = cb->arithDecoder->decodeBit(jpxContextUniform,
  ------------------
  |  |   42|  51.2k|#define jpxContextUniform   18	// cleanup: first signif coeff
  ------------------
 2905|  51.2k|					     cb->stats) << 3;
 2906|  51.2k|	segSym |= cb->arithDecoder->decodeBit(jpxContextUniform,
  ------------------
  |  |   42|  51.2k|#define jpxContextUniform   18	// cleanup: first signif coeff
  ------------------
 2907|  51.2k|					      cb->stats) << 2;
 2908|  51.2k|	segSym |= cb->arithDecoder->decodeBit(jpxContextUniform,
  ------------------
  |  |   42|  51.2k|#define jpxContextUniform   18	// cleanup: first signif coeff
  ------------------
 2909|  51.2k|					      cb->stats) << 1;
 2910|  51.2k|	segSym |= cb->arithDecoder->decodeBit(jpxContextUniform,
  ------------------
  |  |   42|  51.2k|#define jpxContextUniform   18	// cleanup: first signif coeff
  ------------------
 2911|  51.2k|					      cb->stats);
 2912|  51.2k|	if (segSym != 0x0a) {
  ------------------
  |  Branch (2912:6): [True: 48.9k, False: 2.29k]
  ------------------
 2913|       |	  // in theory this should be a fatal error, but it seems to
 2914|       |	  // be problematic
 2915|  48.9k|	  error(errSyntaxWarning, getPos(),
 2916|  48.9k|		"Missing or invalid segmentation symbol in JPX stream");
 2917|  48.9k|	}
 2918|  51.2k|      }
 2919|   581k|      cb->nextPass = jpxPassSigProp;
  ------------------
  |  |   46|   581k|#define jpxPassSigProp       0
  ------------------
 2920|   581k|      break;
 2921|  1.26M|    }
 2922|       |
 2923|  1.26M|    if (tileComp->codeBlockStyle & 0x02) {
  ------------------
  |  Branch (2923:9): [True: 731k, False: 529k]
  ------------------
 2924|   731k|      cb->stats->reset();
 2925|   731k|      cb->stats->setEntry(jpxContextSigProp, 4, 0);
  ------------------
  |  |   38|   731k|#define jpxContextSigProp    0	// 0 - 8: significance prop and cleanup
  ------------------
 2926|   731k|      cb->stats->setEntry(jpxContextRunLength, 3, 0);
  ------------------
  |  |   41|   731k|#define jpxContextRunLength 17	// cleanup: run length
  ------------------
 2927|   731k|      cb->stats->setEntry(jpxContextUniform, 46, 0);
  ------------------
  |  |   42|   731k|#define jpxContextUniform   18	// cleanup: first signif coeff
  ------------------
 2928|   731k|    }
 2929|       |
 2930|  1.26M|    if (tileComp->codeBlockStyle & 0x04) {
  ------------------
  |  Branch (2930:9): [True: 644k, False: 617k]
  ------------------
 2931|   644k|      cb->arithDecoder->cleanup();
 2932|   644k|    }
 2933|  1.26M|  }
 2934|       |
 2935|   375k|  cb->arithDecoder->cleanup();
 2936|   375k|  return gTrue;
  ------------------
  |  |   17|   375k|#define gTrue 1
  ------------------
 2937|   375k|}
_ZN9JPXStream16inverseTransformEP11JPXTileComp:
 2941|  60.2k|void JPXStream::inverseTransform(JPXTileComp *tileComp) {
 2942|  60.2k|  JPXResLevel *resLevel;
 2943|  60.2k|  JPXPrecinct *precinct;
 2944|  60.2k|  JPXSubband *subband;
 2945|  60.2k|  JPXCodeBlock *cb;
 2946|  60.2k|  int *coeff0, *coeff;
 2947|  60.2k|  char *touched0, *touched;
 2948|  60.2k|  Guint qStyle, guard, eps, shift;
 2949|  60.2k|  int shift2;
 2950|  60.2k|  double mu;
 2951|  60.2k|  int val;
 2952|  60.2k|  Guint r, pre, cbX, cbY, x, y;
 2953|       |
 2954|  60.2k|  cover(68);
 2955|       |
 2956|       |  //----- (NL)LL subband (resolution level 0)
 2957|       |
 2958|  60.2k|  resLevel = &tileComp->resLevels[0];
 2959|       |
 2960|       |  // i-quant parameters
 2961|  60.2k|  qStyle = tileComp->quantStyle & 0x1f;
 2962|  60.2k|  guard = (tileComp->quantStyle >> 5) & 7;
 2963|  60.2k|  if (qStyle == 0) {
  ------------------
  |  Branch (2963:7): [True: 11.7k, False: 48.4k]
  ------------------
 2964|  11.7k|    cover(69);
 2965|  11.7k|    eps = (tileComp->quantSteps[0] >> 3) & 0x1f;
 2966|  11.7k|    shift = guard + eps - 1;
 2967|  11.7k|    mu = 0; // make gcc happy
 2968|  48.4k|  } else {
 2969|  48.4k|    cover(70);
 2970|  48.4k|    shift = guard - 1 + tileComp->prec;
 2971|  48.4k|    mu = (double)(0x800 + (tileComp->quantSteps[0] & 0x7ff)) / 2048.0;
 2972|  48.4k|  }
 2973|  60.2k|  if (tileComp->transform == 0) {
  ------------------
  |  Branch (2973:7): [True: 21.0k, False: 39.1k]
  ------------------
 2974|  21.0k|    cover(71);
 2975|  21.0k|    shift += fracBits - tileComp->prec;
  ------------------
  |  |  153|  21.0k|#define fracBits 24
  ------------------
 2976|  21.0k|  }
 2977|       |
 2978|       |  // do fixed point adjustment and dequantization on (NL)LL
 2979|   139k|  for (pre = 0; pre < resLevel->nPrecincts; ++pre) {
  ------------------
  |  Branch (2979:17): [True: 79.1k, False: 60.2k]
  ------------------
 2980|  79.1k|    precinct = &resLevel->precincts[pre];
 2981|  79.1k|    subband = &precinct->subbands[0];
 2982|  79.1k|    cb = subband->cbs;
 2983|   274k|    for (cbY = 0; cbY < subband->nYCBs; ++cbY) {
  ------------------
  |  Branch (2983:19): [True: 194k, False: 79.1k]
  ------------------
 2984|   920k|      for (cbX = 0; cbX < subband->nXCBs; ++cbX) {
  ------------------
  |  Branch (2984:21): [True: 726k, False: 194k]
  ------------------
 2985|   726k|	for (y = cb->y0, coeff0 = cb->coeffs, touched0 = cb->touched;
 2986|  3.34M|	     y < cb->y1;
  ------------------
  |  Branch (2986:7): [True: 2.61M, False: 726k]
  ------------------
 2987|  2.61M|	     ++y, coeff0 += tileComp->w, touched0 += resLevel->cbW) {
 2988|  2.61M|	  for (x = cb->x0, coeff = coeff0, touched = touched0;
 2989|  11.1M|	       x < cb->x1;
  ------------------
  |  Branch (2989:9): [True: 8.48M, False: 2.61M]
  ------------------
 2990|  8.48M|	       ++x, ++coeff, ++touched) {
 2991|  8.48M|	    val = *coeff;
 2992|  8.48M|	    if (val != 0) {
  ------------------
  |  Branch (2992:10): [True: 54.6k, False: 8.43M]
  ------------------
 2993|  54.6k|	      shift2 = shift - (cb->nZeroBitPlanes + cb->len + *touched);
 2994|  54.6k|	      if (shift2 > 0) {
  ------------------
  |  Branch (2994:12): [True: 41.0k, False: 13.6k]
  ------------------
 2995|  41.0k|		cover(94);
 2996|  41.0k|		if (val < 0) {
  ------------------
  |  Branch (2996:7): [True: 22.7k, False: 18.3k]
  ------------------
 2997|  22.7k|		  val = (val << shift2) - (1 << (shift2 - 1));
 2998|  22.7k|		} else {
 2999|  18.3k|		  val = (val << shift2) + (1 << (shift2 - 1));
 3000|  18.3k|		}
 3001|  41.0k|	      } else {
 3002|  13.6k|		cover(95);
 3003|  13.6k|		val >>= -shift2;
 3004|  13.6k|	      }
 3005|  54.6k|	      if (qStyle == 0) {
  ------------------
  |  Branch (3005:12): [True: 45.9k, False: 8.70k]
  ------------------
 3006|  45.9k|		cover(96);
 3007|  45.9k|		if (tileComp->transform == 0) {
  ------------------
  |  Branch (3007:7): [True: 441, False: 45.4k]
  ------------------
 3008|    441|		  cover(97);
 3009|    441|		  val &= -1 << (fracBits - tileComp->prec);
  ------------------
  |  |  153|    441|#define fracBits 24
  ------------------
 3010|    441|		}
 3011|  45.9k|	      } else {
 3012|  8.70k|		cover(98);
 3013|  8.70k|		val = (int)((double)val * mu);
 3014|  8.70k|	      }
 3015|  54.6k|	    }
 3016|  8.48M|	    *coeff = val;
 3017|  8.48M|	  }
 3018|  2.61M|	}
 3019|   726k|	++cb;
 3020|   726k|      }
 3021|   194k|    }
 3022|  79.1k|  }
 3023|       |
 3024|       |  //----- IDWT for each level
 3025|       |
 3026|   345k|  for (r = 1; r <= tileComp->nDecompLevels - reduction; ++r) {
  ------------------
  |  Branch (3026:15): [True: 285k, False: 60.2k]
  ------------------
 3027|   285k|    resLevel = &tileComp->resLevels[r];
 3028|       |
 3029|       |    // (n)LL is already in the upper-left corner of the
 3030|       |    // tile-component data array -- interleave with (n)HL/LH/HH
 3031|       |    // and inverse transform to get (n-1)LL, which will be stored
 3032|       |    // in the upper-left corner of the tile-component data array
 3033|   285k|    inverseTransformLevel(tileComp, r, resLevel);
 3034|   285k|  }
 3035|  60.2k|}
_ZN9JPXStream21inverseTransformLevelEP11JPXTileCompjP11JPXResLevel:
 3042|   285k|				      Guint r, JPXResLevel *resLevel) {
 3043|   285k|  JPXPrecinct *precinct;
 3044|   285k|  JPXSubband *subband;
 3045|   285k|  JPXCodeBlock *cb;
 3046|   285k|  int *coeff0, *coeff;
 3047|   285k|  char *touched0, *touched;
 3048|   285k|  Guint qStyle, guard, eps, shift, t;
 3049|   285k|  int shift2;
 3050|   285k|  double mu;
 3051|   285k|  int val;
 3052|   285k|  int *dataPtr, *bufPtr;
 3053|   285k|  Guint nx1, nx2, ny1, ny2, offset;
 3054|   285k|  Guint x, y, sb, pre, cbX, cbY;
 3055|       |
 3056|   285k|  qStyle = tileComp->quantStyle & 0x1f;
 3057|   285k|  guard = (tileComp->quantStyle >> 5) & 7;
 3058|       |
 3059|       |  //----- compute subband bounds
 3060|       |
 3061|       |  //    0   nx1  nx2
 3062|       |  //    |    |    |
 3063|       |  //    v    v    v
 3064|       |  //   +----+----+
 3065|       |  //   | LL | HL | <- 0
 3066|       |  //   +----+----+
 3067|       |  //   | LH | HH | <- ny1
 3068|       |  //   +----+----+
 3069|       |  //               <- ny2
 3070|   285k|  nx1 = resLevel->bx1[1] - resLevel->bx0[1];
 3071|   285k|  nx2 = nx1 + resLevel->bx1[0] - resLevel->bx0[0];
 3072|   285k|  ny1 = resLevel->by1[0] - resLevel->by0[0];
 3073|   285k|  ny2 = ny1 + resLevel->by1[1] - resLevel->by0[1];
 3074|   285k|  if (nx2 == 0 || ny2 == 0) {
  ------------------
  |  Branch (3074:7): [True: 97.7k, False: 187k]
  |  Branch (3074:19): [True: 20.6k, False: 167k]
  ------------------
 3075|   118k|    return;
 3076|   118k|  }
 3077|       |
 3078|       |  //----- fixed-point adjustment and dequantization
 3079|       |
 3080|   669k|  for (sb = 0; sb < 3; ++sb) {
  ------------------
  |  Branch (3080:16): [True: 501k, False: 167k]
  ------------------
 3081|       |
 3082|       |    // i-quant parameters
 3083|   501k|    if (qStyle == 0) {
  ------------------
  |  Branch (3083:9): [True: 76.9k, False: 424k]
  ------------------
 3084|  76.9k|      cover(100);
 3085|  76.9k|      eps = (tileComp->quantSteps[3*r - 2 + sb] >> 3) & 0x1f;
 3086|  76.9k|      shift = guard + eps - 1;
 3087|  76.9k|      mu = 0; // make gcc happy
 3088|   424k|    } else {
 3089|   424k|      cover(101);
 3090|   424k|      shift = guard + tileComp->prec;
 3091|   424k|      if (sb == 2) {
  ------------------
  |  Branch (3091:11): [True: 141k, False: 283k]
  ------------------
 3092|   141k|	cover(102);
 3093|   141k|	++shift;
 3094|   141k|      }
 3095|   424k|      t = tileComp->quantSteps[qStyle == 1 ? 0 : (3*r - 2 + sb)];
  ------------------
  |  Branch (3095:32): [True: 4.63k, False: 420k]
  ------------------
 3096|   424k|      mu = (double)(0x800 + (t & 0x7ff)) / 2048.0;
 3097|   424k|    }
 3098|   501k|    if (tileComp->transform == 0) {
  ------------------
  |  Branch (3098:9): [True: 240k, False: 261k]
  ------------------
 3099|   240k|      cover(103);
 3100|   240k|      shift += fracBits - tileComp->prec;
  ------------------
  |  |  153|   240k|#define fracBits 24
  ------------------
 3101|   240k|    }
 3102|       |
 3103|       |    // fixed point adjustment and dequantization
 3104|       |
 3105|  1.38M|    for (pre = 0; pre < resLevel->nPrecincts; ++pre) {
  ------------------
  |  Branch (3105:19): [True: 885k, False: 501k]
  ------------------
 3106|   885k|      precinct = &resLevel->precincts[pre];
 3107|   885k|      subband = &precinct->subbands[sb];
 3108|   885k|      cb = subband->cbs;
 3109|  2.78M|      for (cbY = 0; cbY < subband->nYCBs; ++cbY) {
  ------------------
  |  Branch (3109:21): [True: 1.89M, False: 885k]
  ------------------
 3110|  6.20M|	for (cbX = 0; cbX < subband->nXCBs; ++cbX) {
  ------------------
  |  Branch (3110:16): [True: 4.30M, False: 1.89M]
  ------------------
 3111|  4.30M|	  for (y = cb->y0, coeff0 = cb->coeffs, touched0 = cb->touched;
 3112|  24.5M|	       y < cb->y1;
  ------------------
  |  Branch (3112:9): [True: 20.2M, False: 4.30M]
  ------------------
 3113|  20.2M|	       ++y, coeff0 += tileComp->w, touched0 += resLevel->cbW) {
 3114|  20.2M|	    for (x = cb->x0, coeff = coeff0, touched = touched0;
 3115|   162M|		 x < cb->x1;
  ------------------
  |  Branch (3115:4): [True: 141M, False: 20.2M]
  ------------------
 3116|   141M|		 ++x, ++coeff, ++touched) {
 3117|   141M|	      val = *coeff;
 3118|   141M|	      if (val != 0) {
  ------------------
  |  Branch (3118:12): [True: 2.46M, False: 139M]
  ------------------
 3119|  2.46M|		shift2 = shift - (cb->nZeroBitPlanes + cb->len + *touched);
 3120|  2.46M|		if (shift2 > 0) {
  ------------------
  |  Branch (3120:7): [True: 884k, False: 1.57M]
  ------------------
 3121|   884k|		  cover(74);
 3122|   884k|		  if (val < 0) {
  ------------------
  |  Branch (3122:9): [True: 440k, False: 444k]
  ------------------
 3123|   440k|		    val = (val << shift2) - (1 << (shift2 - 1));
 3124|   444k|		  } else {
 3125|   444k|		    val = (val << shift2) + (1 << (shift2 - 1));
 3126|   444k|		  }
 3127|  1.57M|		} else {
 3128|  1.57M|		  cover(75);
 3129|  1.57M|		  val >>= -shift2;
 3130|  1.57M|		}
 3131|  2.46M|		if (qStyle == 0) {
  ------------------
  |  Branch (3131:7): [True: 1.85M, False: 608k]
  ------------------
 3132|  1.85M|		  cover(76);
 3133|  1.85M|		  if (tileComp->transform == 0) {
  ------------------
  |  Branch (3133:9): [True: 6.33k, False: 1.84M]
  ------------------
 3134|  6.33k|		    val &= -1 << (fracBits - tileComp->prec);
  ------------------
  |  |  153|  6.33k|#define fracBits 24
  ------------------
 3135|  6.33k|		  }
 3136|  1.85M|		} else {
 3137|   608k|		  cover(77);
 3138|   608k|		  val = (int)((double)val * mu);
 3139|   608k|		}
 3140|  2.46M|	      }
 3141|   141M|	      *coeff = val;
 3142|   141M|	    }
 3143|  20.2M|	  }
 3144|  4.30M|	  ++cb;
 3145|  4.30M|	}
 3146|  1.89M|      }
 3147|   885k|    }
 3148|   501k|  }
 3149|       |
 3150|       |  //----- inverse transform
 3151|       |
 3152|       |  // horizontal (row) transforms
 3153|   167k|  offset = 3 + (resLevel->x0 & 1);
 3154|  5.67M|  for (y = 0, dataPtr = tileComp->data; y < ny2; ++y, dataPtr += tileComp->w) {
  ------------------
  |  Branch (3154:41): [True: 5.50M, False: 167k]
  ------------------
 3155|  5.50M|    if (resLevel->bx0[0] == resLevel->bx0[1]) {
  ------------------
  |  Branch (3155:9): [True: 3.94M, False: 1.55M]
  ------------------
 3156|       |      // fetch LL/LH
 3157|  3.94M|      for (x = 0, bufPtr = tileComp->buf + offset;
 3158|  65.6M|	   x < nx1;
  ------------------
  |  Branch (3158:5): [True: 61.7M, False: 3.94M]
  ------------------
 3159|  61.7M|	   ++x, bufPtr += 2) {
 3160|  61.7M|	*bufPtr = dataPtr[x];
 3161|  61.7M|      }
 3162|       |      // fetch HL/HH
 3163|  3.94M|      for (x = nx1, bufPtr = tileComp->buf + offset + 1;
 3164|  63.9M|	   x < nx2;
  ------------------
  |  Branch (3164:5): [True: 60.0M, False: 3.94M]
  ------------------
 3165|  60.0M|	   ++x, bufPtr += 2) {
 3166|  60.0M|	*bufPtr = dataPtr[x];
 3167|  60.0M|      }
 3168|  3.94M|    } else {
 3169|       |      // fetch LL/LH
 3170|  1.55M|      for (x = 0, bufPtr = tileComp->buf + offset + 1;
 3171|  34.5M|	   x < nx1;
  ------------------
  |  Branch (3171:5): [True: 33.0M, False: 1.55M]
  ------------------
 3172|  33.0M|	   ++x, bufPtr += 2) {
 3173|  33.0M|	*bufPtr = dataPtr[x];
 3174|  33.0M|      }
 3175|       |      // fetch HL/HH
 3176|  1.55M|      for (x = nx1, bufPtr = tileComp->buf + offset;
 3177|  35.5M|	   x < nx2;
  ------------------
  |  Branch (3177:5): [True: 33.9M, False: 1.55M]
  ------------------
 3178|  33.9M|	   ++x, bufPtr += 2) {
 3179|  33.9M|	*bufPtr = dataPtr[x];
 3180|  33.9M|      }
 3181|  1.55M|    }
 3182|  5.50M|    inverseTransform1D(tileComp, tileComp->buf, offset, nx2);
 3183|   194M|    for (x = 0, bufPtr = tileComp->buf + offset; x < nx2; ++x, ++bufPtr) {
  ------------------
  |  Branch (3183:50): [True: 188M, False: 5.50M]
  ------------------
 3184|   188M|      dataPtr[x] = *bufPtr;
 3185|   188M|    }
 3186|  5.50M|  }
 3187|       |
 3188|       |  // vertical (column) transforms
 3189|   167k|  offset = 3 + (resLevel->y0 & 1);
 3190|  8.99M|  for (x = 0, dataPtr = tileComp->data; x < nx2; ++x, ++dataPtr) {
  ------------------
  |  Branch (3190:41): [True: 8.82M, False: 167k]
  ------------------
 3191|  8.82M|    if (resLevel->by0[0] == resLevel->by0[1]) {
  ------------------
  |  Branch (3191:9): [True: 1.85M, False: 6.97M]
  ------------------
 3192|       |      // fetch LL/HL
 3193|  1.85M|      for (y = 0, bufPtr = tileComp->buf + offset;
 3194|  19.6M|	   y < ny1;
  ------------------
  |  Branch (3194:5): [True: 17.8M, False: 1.85M]
  ------------------
 3195|  17.8M|	   ++y, bufPtr += 2) {
 3196|  17.8M|	*bufPtr = dataPtr[y * tileComp->w];
 3197|  17.8M|      }
 3198|       |      // fetch LH/HH
 3199|  1.85M|      for (y = ny1, bufPtr = tileComp->buf + offset + 1;
 3200|  18.6M|	   y < ny2;
  ------------------
  |  Branch (3200:5): [True: 16.7M, False: 1.85M]
  ------------------
 3201|  16.7M|	   ++y, bufPtr += 2) {
 3202|  16.7M|	*bufPtr = dataPtr[y * tileComp->w];
 3203|  16.7M|      }
 3204|  6.97M|    } else {
 3205|       |      // fetch LL/HL
 3206|  6.97M|      for (y = 0, bufPtr = tileComp->buf + offset + 1;
 3207|  82.3M|	   y < ny1;
  ------------------
  |  Branch (3207:5): [True: 75.4M, False: 6.97M]
  ------------------
 3208|  75.4M|	   ++y, bufPtr += 2) {
 3209|  75.4M|	*bufPtr = dataPtr[y * tileComp->w];
 3210|  75.4M|      }
 3211|       |      // fetch LH/HH
 3212|  6.97M|      for (y = ny1, bufPtr = tileComp->buf + offset;
 3213|  85.6M|	   y < ny2;
  ------------------
  |  Branch (3213:5): [True: 78.7M, False: 6.97M]
  ------------------
 3214|  78.7M|	   ++y, bufPtr += 2) {
 3215|  78.7M|	*bufPtr = dataPtr[y * tileComp->w];
 3216|  78.7M|      }
 3217|  6.97M|    }
 3218|  8.82M|    inverseTransform1D(tileComp, tileComp->buf, offset, ny2);
 3219|   197M|    for (y = 0, bufPtr = tileComp->buf + offset; y < ny2; ++y, ++bufPtr) {
  ------------------
  |  Branch (3219:50): [True: 188M, False: 8.82M]
  ------------------
 3220|   188M|      dataPtr[y * tileComp->w] = *bufPtr;
 3221|   188M|    }
 3222|  8.82M|  }
 3223|   167k|}
_ZN9JPXStream18inverseTransform1DEP11JPXTileCompPijj:
 3226|  14.3M|				   Guint offset, Guint n) {
 3227|  14.3M|  Guint end, i;
 3228|       |
 3229|       |  //----- special case for length = 1
 3230|  14.3M|  if (n == 1) {
  ------------------
  |  Branch (3230:7): [True: 2.61M, False: 11.7M]
  ------------------
 3231|  2.61M|    cover(79);
 3232|  2.61M|    if (offset == 4) {
  ------------------
  |  Branch (3232:9): [True: 1.19M, False: 1.42M]
  ------------------
 3233|  1.19M|      cover(104);
 3234|  1.19M|      *data >>= 1;
 3235|  1.19M|    }
 3236|       |
 3237|  11.7M|  } else {
 3238|  11.7M|    cover(80);
 3239|       |
 3240|  11.7M|    end = offset + n;
 3241|       |
 3242|       |    //----- extend right
 3243|  11.7M|    data[end] = data[end - 2];
 3244|  11.7M|    if (n == 2) {
  ------------------
  |  Branch (3244:9): [True: 2.35M, False: 9.36M]
  ------------------
 3245|  2.35M|      cover(81);
 3246|  2.35M|      data[end+1] = data[offset + 1];
 3247|  2.35M|      data[end+2] = data[offset];
 3248|  2.35M|      data[end+3] = data[offset + 1];
 3249|  9.36M|    } else {
 3250|  9.36M|      cover(82);
 3251|  9.36M|      data[end+1] = data[end - 3];
 3252|  9.36M|      if (n == 3) {
  ------------------
  |  Branch (3252:11): [True: 630k, False: 8.73M]
  ------------------
 3253|   630k|	cover(105);
 3254|   630k|	data[end+2] = data[offset + 1];
 3255|   630k|	data[end+3] = data[offset + 2];
 3256|  8.73M|      } else {
 3257|  8.73M|	cover(106);
 3258|  8.73M|	data[end+2] = data[end - 4];
 3259|  8.73M|	if (n == 4) {
  ------------------
  |  Branch (3259:6): [True: 207k, False: 8.52M]
  ------------------
 3260|   207k|	  cover(107);
 3261|   207k|	  data[end+3] = data[offset + 1];
 3262|  8.52M|	} else {
 3263|  8.52M|	  cover(108);
 3264|  8.52M|	  data[end+3] = data[end - 5];
 3265|  8.52M|	}
 3266|  8.73M|      }
 3267|  9.36M|    }
 3268|       |
 3269|       |    //----- extend left
 3270|  11.7M|    data[offset - 1] = data[offset + 1];
 3271|  11.7M|    data[offset - 2] = data[offset + 2];
 3272|  11.7M|    data[offset - 3] = data[offset + 3];
 3273|  11.7M|    if (offset == 4) {
  ------------------
  |  Branch (3273:9): [True: 7.33M, False: 4.37M]
  ------------------
 3274|  7.33M|      cover(83);
 3275|  7.33M|      data[0] = data[offset + 4];
 3276|  7.33M|    }
 3277|       |
 3278|       |    //----- 9-7 irreversible filter
 3279|       |
 3280|  11.7M|    if (tileComp->transform == 0) {
  ------------------
  |  Branch (3280:9): [True: 6.36M, False: 5.34M]
  ------------------
 3281|  6.36M|      cover(84);
 3282|       |      // step 1 (even)
 3283|   122M|      for (i = 1; i <= end + 2; i += 2) {
  ------------------
  |  Branch (3283:19): [True: 116M, False: 6.36M]
  ------------------
 3284|   116M|	data[i] = (int)(idwtKappa * data[i]);
  ------------------
  |  |  147|   116M|#define idwtKappa   1.230174104914001
  ------------------
 3285|   116M|      }
 3286|       |      // step 2 (odd)
 3287|   128M|      for (i = 0; i <= end + 3; i += 2) {
  ------------------
  |  Branch (3287:19): [True: 122M, False: 6.36M]
  ------------------
 3288|   122M|	data[i] = (int)(idwtIKappa * data[i]);
  ------------------
  |  |  148|   122M|#define idwtIKappa  (1.0 / idwtKappa)
  |  |  ------------------
  |  |  |  |  147|   122M|#define idwtKappa   1.230174104914001
  |  |  ------------------
  ------------------
 3289|   122M|      }
 3290|       |      // step 3 (even)
 3291|   122M|      for (i = 1; i <= end + 2; i += 2) {
  ------------------
  |  Branch (3291:19): [True: 116M, False: 6.36M]
  ------------------
 3292|   116M|	data[i] = (int)(data[i] - idwtDelta * (data[i-1] + data[i+1]));
  ------------------
  |  |  146|   116M|#define idwtDelta   0.443506852043971
  ------------------
 3293|   116M|      }
 3294|       |      // step 4 (odd)
 3295|   116M|      for (i = 2; i <= end + 1; i += 2) {
  ------------------
  |  Branch (3295:19): [True: 109M, False: 6.36M]
  ------------------
 3296|   109M|	data[i] = (int)(data[i] - idwtGamma * (data[i-1] + data[i+1]));
  ------------------
  |  |  145|   109M|#define idwtGamma   0.882911075530934
  ------------------
 3297|   109M|      }
 3298|       |      // step 5 (even)
 3299|   109M|      for (i = 3; i <= end; i += 2) {
  ------------------
  |  Branch (3299:19): [True: 103M, False: 6.36M]
  ------------------
 3300|   103M|	data[i] = (int)(data[i] - idwtBeta * (data[i-1] + data[i+1]));
  ------------------
  |  |  144|   103M|#define idwtBeta   -0.052980118572961
  ------------------
 3301|   103M|      }
 3302|       |      // step 6 (odd)
 3303|   103M|      for (i = 4; i <= end - 1; i += 2) {
  ------------------
  |  Branch (3303:19): [True: 97.0M, False: 6.36M]
  ------------------
 3304|  97.0M|	data[i] = (int)(data[i] - idwtAlpha * (data[i-1] + data[i+1]));
  ------------------
  |  |  143|  97.0M|#define idwtAlpha  -1.586134342059924
  ------------------
 3305|  97.0M|      }
 3306|       |
 3307|       |    //----- 5-3 reversible filter
 3308|       |
 3309|  6.36M|    } else {
 3310|  5.34M|      cover(85);
 3311|       |      // step 1 (even)
 3312|   101M|      for (i = 3; i <= end; i += 2) {
  ------------------
  |  Branch (3312:19): [True: 96.5M, False: 5.34M]
  ------------------
 3313|  96.5M|	data[i] -= (data[i-1] + data[i+1] + 2) >> 2;
 3314|  96.5M|      }
 3315|       |      // step 2 (odd)
 3316|  96.5M|      for (i = 4; i < end; i += 2) {
  ------------------
  |  Branch (3316:19): [True: 91.2M, False: 5.34M]
  ------------------
 3317|  91.2M|	data[i] += (data[i-1] + data[i+1]) >> 1;
 3318|  91.2M|      }
 3319|  5.34M|    }
 3320|  11.7M|  }
 3321|  14.3M|}
_ZN9JPXStream21inverseMultiCompAndDCEP7JPXTile:
 3325|  10.4k|GBool JPXStream::inverseMultiCompAndDC(JPXTile *tile) {
 3326|  10.4k|  JPXTileComp *tileComp;
 3327|  10.4k|  int coeff, d0, d1, d2, t, minVal, maxVal, zeroVal, shift, rounding;
 3328|  10.4k|  int *dataPtr;
 3329|  10.4k|  Guint j, comp, x, y;
 3330|       |
 3331|       |  //----- inverse multi-component transform
 3332|       |
 3333|  10.4k|  if (tile->multiComp == 1) {
  ------------------
  |  Branch (3333:7): [True: 5.93k, False: 4.52k]
  ------------------
 3334|  5.93k|    cover(86);
 3335|  5.93k|    if (img.nComps < 3 ||
  ------------------
  |  Branch (3335:9): [True: 1.58k, False: 4.35k]
  ------------------
 3336|  4.35k|	tile->tileComps[0].hSep != tile->tileComps[1].hSep ||
  ------------------
  |  Branch (3336:2): [True: 1.52k, False: 2.82k]
  ------------------
 3337|  2.82k|	tile->tileComps[0].vSep != tile->tileComps[1].vSep ||
  ------------------
  |  Branch (3337:2): [True: 446, False: 2.38k]
  ------------------
 3338|  2.38k|	tile->tileComps[1].hSep != tile->tileComps[2].hSep ||
  ------------------
  |  Branch (3338:2): [True: 261, False: 2.12k]
  ------------------
 3339|  4.08k|	tile->tileComps[1].vSep != tile->tileComps[2].vSep) {
  ------------------
  |  Branch (3339:2): [True: 268, False: 1.85k]
  ------------------
 3340|  4.08k|      return gFalse;
  ------------------
  |  |   18|  4.08k|#define gFalse 0
  ------------------
 3341|  4.08k|    }
 3342|       |
 3343|       |    // inverse irreversible multiple component transform
 3344|  1.85k|    if (tile->tileComps[0].transform == 0) {
  ------------------
  |  Branch (3344:9): [True: 1.18k, False: 667]
  ------------------
 3345|  1.18k|      cover(87);
 3346|  1.18k|      j = 0;
 3347|  9.28k|      for (y = 0; y < tile->tileComps[0].h; ++y) {
  ------------------
  |  Branch (3347:19): [True: 8.09k, False: 1.18k]
  ------------------
 3348|  3.18M|	for (x = 0; x < tile->tileComps[0].w; ++x) {
  ------------------
  |  Branch (3348:14): [True: 3.17M, False: 8.09k]
  ------------------
 3349|  3.17M|	  d0 = tile->tileComps[0].data[j];
 3350|  3.17M|	  d1 = tile->tileComps[1].data[j];
 3351|  3.17M|	  d2 = tile->tileComps[2].data[j];
 3352|  3.17M|	  tile->tileComps[0].data[j] = (int)(d0 + 1.402 * d2 + 0.5);
 3353|  3.17M|	  tile->tileComps[1].data[j] =
 3354|  3.17M|	      (int)(d0 - 0.34413 * d1 - 0.71414 * d2 + 0.5);
 3355|  3.17M|	  tile->tileComps[2].data[j] = (int)(d0 + 1.772 * d1 + 0.5);
 3356|  3.17M|	  ++j;
 3357|  3.17M|	}
 3358|  8.09k|      }
 3359|       |
 3360|       |    // inverse reversible multiple component transform
 3361|  1.18k|    } else {
 3362|    667|      cover(88);
 3363|    667|      j = 0;
 3364|  2.18k|      for (y = 0; y < tile->tileComps[0].h; ++y) {
  ------------------
  |  Branch (3364:19): [True: 1.51k, False: 667]
  ------------------
 3365|   249k|	for (x = 0; x < tile->tileComps[0].w; ++x) {
  ------------------
  |  Branch (3365:14): [True: 247k, False: 1.51k]
  ------------------
 3366|   247k|	  d0 = tile->tileComps[0].data[j];
 3367|   247k|	  d1 = tile->tileComps[1].data[j];
 3368|   247k|	  d2 = tile->tileComps[2].data[j];
 3369|   247k|	  tile->tileComps[1].data[j] = t = d0 - ((d2 + d1) >> 2);
 3370|   247k|	  tile->tileComps[0].data[j] = d2 + t;
 3371|   247k|	  tile->tileComps[2].data[j] = d1 + t;
 3372|   247k|	  ++j;
 3373|   247k|	}
 3374|  1.51k|      }
 3375|    667|    }
 3376|  1.85k|  }
 3377|       |
 3378|       |  //----- DC level shift
 3379|  42.3k|  for (comp = 0; comp < img.nComps; ++comp) {
  ------------------
  |  Branch (3379:18): [True: 35.9k, False: 6.37k]
  ------------------
 3380|  35.9k|    tileComp = &tile->tileComps[comp];
 3381|       |
 3382|       |    // signed: clip
 3383|  35.9k|    if (tileComp->sgned) {
  ------------------
  |  Branch (3383:9): [True: 25.6k, False: 10.3k]
  ------------------
 3384|  25.6k|      cover(89);
 3385|  25.6k|      minVal = -(1 << (tileComp->prec - 1));
 3386|  25.6k|      maxVal = (1 << (tileComp->prec - 1)) - 1;
 3387|  25.6k|      dataPtr = tileComp->data;
 3388|   702k|      for (y = 0; y < tileComp->h; ++y) {
  ------------------
  |  Branch (3388:19): [True: 676k, False: 25.6k]
  ------------------
 3389|  37.4M|	for (x = 0; x < tileComp->w; ++x) {
  ------------------
  |  Branch (3389:14): [True: 36.7M, False: 676k]
  ------------------
 3390|  36.7M|	  coeff = *dataPtr;
 3391|  36.7M|	  if (tileComp->transform == 0) {
  ------------------
  |  Branch (3391:8): [True: 14.6M, False: 22.0M]
  ------------------
 3392|  14.6M|	    cover(109);
 3393|  14.6M|	    coeff >>= fracBits - tileComp->prec;
  ------------------
  |  |  153|  14.6M|#define fracBits 24
  ------------------
 3394|  14.6M|	  }
 3395|  36.7M|	  if (coeff < minVal) {
  ------------------
  |  Branch (3395:8): [True: 106k, False: 36.6M]
  ------------------
 3396|   106k|	    cover(110);
 3397|   106k|	    coeff = minVal;
 3398|  36.6M|	  } else if (coeff > maxVal) {
  ------------------
  |  Branch (3398:15): [True: 22.5M, False: 14.0M]
  ------------------
 3399|  22.5M|	    cover(111);
 3400|  22.5M|	    coeff = maxVal;
 3401|  22.5M|	  }
 3402|  36.7M|	  *dataPtr++ = coeff;
 3403|  36.7M|	}
 3404|   676k|      }
 3405|       |
 3406|       |    // unsigned: inverse DC level shift and clip
 3407|  25.6k|    } else {
 3408|  10.3k|      cover(90);
 3409|  10.3k|      maxVal = (1 << tileComp->prec) - 1;
 3410|  10.3k|      zeroVal = 1 << (tileComp->prec - 1);
 3411|  10.3k|      dataPtr = tileComp->data;
 3412|  10.3k|      shift = fracBits - tileComp->prec;
  ------------------
  |  |  153|  10.3k|#define fracBits 24
  ------------------
 3413|  10.3k|      rounding = 1 << (shift - 1);
 3414|  1.61M|      for (y = 0; y < tileComp->h; ++y) {
  ------------------
  |  Branch (3414:19): [True: 1.60M, False: 10.3k]
  ------------------
 3415|  75.1M|	for (x = 0; x < tileComp->w; ++x) {
  ------------------
  |  Branch (3415:14): [True: 73.5M, False: 1.60M]
  ------------------
 3416|  73.5M|	  coeff = *dataPtr;
 3417|  73.5M|	  if (tileComp->transform == 0) {
  ------------------
  |  Branch (3417:8): [True: 30.1M, False: 43.3M]
  ------------------
 3418|  30.1M|	    cover(112);
 3419|  30.1M|	    coeff = (coeff + rounding) >> shift;
 3420|  30.1M|	  }
 3421|  73.5M|	  coeff += zeroVal;
 3422|  73.5M|	  if (coeff < 0) {
  ------------------
  |  Branch (3422:8): [True: 1.17M, False: 72.3M]
  ------------------
 3423|  1.17M|	    cover(113);
 3424|  1.17M|	    coeff = 0;
 3425|  72.3M|	  } else if (coeff > maxVal) {
  ------------------
  |  Branch (3425:15): [True: 893k, False: 71.4M]
  ------------------
 3426|   893k|	    cover(114);
 3427|   893k|	    coeff = maxVal;
 3428|   893k|	  }
 3429|  73.5M|	  *dataPtr++ = coeff;
 3430|  73.5M|	}
 3431|  1.60M|      }
 3432|  10.3k|    }
 3433|  35.9k|  }
 3434|       |
 3435|  6.37k|  return gTrue;
  ------------------
  |  |   17|  6.37k|#define gTrue 1
  ------------------
 3436|  10.4k|}
_ZN9JPXStream10readBoxHdrEPjS0_S0_:
 3438|   118k|GBool JPXStream::readBoxHdr(Guint *boxType, Guint *boxLen, Guint *dataLen) {
 3439|   118k|  Guint len, lenH;
 3440|       |
 3441|   118k|  if (!readULong(&len) ||
  ------------------
  |  Branch (3441:7): [True: 862, False: 117k]
  ------------------
 3442|   117k|      !readULong(boxType)) {
  ------------------
  |  Branch (3442:7): [True: 991, False: 116k]
  ------------------
 3443|  1.85k|    return gFalse;
  ------------------
  |  |   18|  1.85k|#define gFalse 0
  ------------------
 3444|  1.85k|  }
 3445|   116k|  if (len == 1) {
  ------------------
  |  Branch (3445:7): [True: 2.55k, False: 114k]
  ------------------
 3446|  2.55k|    if (!readULong(&lenH) || !readULong(&len)) {
  ------------------
  |  Branch (3446:9): [True: 1.12k, False: 1.43k]
  |  Branch (3446:30): [True: 882, False: 553]
  ------------------
 3447|  2.00k|      return gFalse;
  ------------------
  |  |   18|  2.00k|#define gFalse 0
  ------------------
 3448|  2.00k|    }
 3449|    553|    if (lenH) {
  ------------------
  |  Branch (3449:9): [True: 298, False: 255]
  ------------------
 3450|    298|      error(errSyntaxError, getPos(),
 3451|    298|	    "JPX stream contains a box larger than 2^32 bytes");
 3452|    298|      return gFalse;
  ------------------
  |  |   18|    298|#define gFalse 0
  ------------------
 3453|    298|    }
 3454|    255|    *boxLen = len;
 3455|    255|    *dataLen = len - 16;
 3456|   114k|  } else if (len == 0) {
  ------------------
  |  Branch (3456:14): [True: 2.53k, False: 111k]
  ------------------
 3457|  2.53k|    *boxLen = 0;
 3458|  2.53k|    *dataLen = 0;
 3459|   111k|  } else {
 3460|   111k|    *boxLen = len;
 3461|   111k|    *dataLen = len - 8;
 3462|   111k|  }
 3463|   114k|  return gTrue;
  ------------------
  |  |   17|   114k|#define gTrue 1
  ------------------
 3464|   116k|}
_ZN9JPXStream13readMarkerHdrEPiPj:
 3466|   575k|int JPXStream::readMarkerHdr(int *segType, Guint *segLen) {
 3467|   575k|  int c;
 3468|       |
 3469|   598k|  do {
 3470|  46.4M|    do {
 3471|  46.4M|      if ((c = bufStr->getChar()) == EOF) {
  ------------------
  |  Branch (3471:11): [True: 3.39k, False: 46.4M]
  ------------------
 3472|  3.39k|	return gFalse;
  ------------------
  |  |   18|  3.39k|#define gFalse 0
  ------------------
 3473|  3.39k|      }
 3474|  46.4M|    } while (c != 0xff);
  ------------------
  |  Branch (3474:14): [True: 45.8M, False: 595k]
  ------------------
 3475|   965k|    do {
 3476|   965k|      if ((c = bufStr->getChar()) == EOF) {
  ------------------
  |  Branch (3476:11): [True: 677, False: 964k]
  ------------------
 3477|    677|	return gFalse;
  ------------------
  |  |   18|    677|#define gFalse 0
  ------------------
 3478|    677|      }
 3479|   965k|    } while (c == 0xff);
  ------------------
  |  Branch (3479:14): [True: 370k, False: 594k]
  ------------------
 3480|   595k|  } while (c == 0x00);
  ------------------
  |  Branch (3480:12): [True: 23.2k, False: 571k]
  ------------------
 3481|   571k|  *segType = c;
 3482|   571k|  if ((c >= 0x30 && c <= 0x3f) ||
  ------------------
  |  Branch (3482:8): [True: 543k, False: 28.3k]
  |  Branch (3482:21): [True: 7.88k, False: 535k]
  ------------------
 3483|   563k|      c == 0x4f || c == 0x92 || c == 0x93 || c == 0xd9) {
  ------------------
  |  Branch (3483:7): [True: 54.2k, False: 509k]
  |  Branch (3483:20): [True: 668, False: 508k]
  |  Branch (3483:33): [True: 12.3k, False: 496k]
  |  Branch (3483:46): [True: 1.13k, False: 495k]
  ------------------
 3484|  76.2k|    *segLen = 0;
 3485|  76.2k|    return gTrue;
  ------------------
  |  |   17|  76.2k|#define gTrue 1
  ------------------
 3486|  76.2k|  }
 3487|   495k|  return readUWord(segLen);
 3488|   571k|}
_ZN9JPXStream9readUByteEPj:
 3490|  4.28M|GBool JPXStream::readUByte(Guint *x) {
 3491|  4.28M|  int c0;
 3492|       |
 3493|  4.28M|  if ((c0 = bufStr->getChar()) == EOF) {
  ------------------
  |  Branch (3493:7): [True: 13.2k, False: 4.27M]
  ------------------
 3494|  13.2k|    return gFalse;
  ------------------
  |  |   18|  13.2k|#define gFalse 0
  ------------------
 3495|  13.2k|  }
 3496|  4.27M|  *x = (Guint)c0;
 3497|  4.27M|  return gTrue;
  ------------------
  |  |   17|  4.27M|#define gTrue 1
  ------------------
 3498|  4.28M|}
_ZN9JPXStream8readByteEPi:
 3500|  12.4k|GBool JPXStream::readByte(int *x) {
 3501|  12.4k| int c0;
 3502|       |
 3503|  12.4k|  if ((c0 = bufStr->getChar()) == EOF) {
  ------------------
  |  Branch (3503:7): [True: 237, False: 12.2k]
  ------------------
 3504|    237|    return gFalse;
  ------------------
  |  |   18|    237|#define gFalse 0
  ------------------
 3505|    237|  }
 3506|  12.2k|  *x = c0;
 3507|  12.2k|  if (c0 & 0x80) {
  ------------------
  |  Branch (3507:7): [True: 7.59k, False: 4.61k]
  ------------------
 3508|  7.59k|    *x |= -1 - 0xff;
 3509|  7.59k|  }
 3510|  12.2k|  return gTrue;
  ------------------
  |  |   17|  12.2k|#define gTrue 1
  ------------------
 3511|  12.4k|}
_ZN9JPXStream9readUWordEPj:
 3513|  3.92M|GBool JPXStream::readUWord(Guint *x) {
 3514|  3.92M|  int c0, c1;
 3515|       |
 3516|  3.92M|  if ((c0 = bufStr->getChar()) == EOF ||
  ------------------
  |  Branch (3516:7): [True: 4.89k, False: 3.91M]
  ------------------
 3517|  3.91M|      (c1 = bufStr->getChar()) == EOF) {
  ------------------
  |  Branch (3517:7): [True: 4.40k, False: 3.91M]
  ------------------
 3518|  9.29k|    return gFalse;
  ------------------
  |  |   18|  9.29k|#define gFalse 0
  ------------------
 3519|  9.29k|  }
 3520|  3.91M|  *x = (Guint)((c0 << 8) | c1);
 3521|  3.91M|  return gTrue;
  ------------------
  |  |   17|  3.91M|#define gTrue 1
  ------------------
 3522|  3.92M|}
_ZN9JPXStream9readULongEPj:
 3524|   721k|GBool JPXStream::readULong(Guint *x) {
 3525|   721k|  int c0, c1, c2, c3;
 3526|       |
 3527|   721k|  if ((c0 = bufStr->getChar()) == EOF ||
  ------------------
  |  Branch (3527:7): [True: 4.48k, False: 716k]
  ------------------
 3528|   716k|      (c1 = bufStr->getChar()) == EOF ||
  ------------------
  |  Branch (3528:7): [True: 3.94k, False: 713k]
  ------------------
 3529|   713k|      (c2 = bufStr->getChar()) == EOF ||
  ------------------
  |  Branch (3529:7): [True: 3.82k, False: 709k]
  ------------------
 3530|   709k|      (c3 = bufStr->getChar()) == EOF) {
  ------------------
  |  Branch (3530:7): [True: 3.74k, False: 705k]
  ------------------
 3531|  15.9k|    return gFalse;
  ------------------
  |  |   18|  15.9k|#define gFalse 0
  ------------------
 3532|  15.9k|  }
 3533|   705k|  *x = (Guint)((c0 << 24) | (c1 << 16) | (c2 << 8) | c3);
 3534|   705k|  return gTrue;
  ------------------
  |  |   17|   705k|#define gTrue 1
  ------------------
 3535|   721k|}
_ZN9JPXStream10readNBytesEiiPi:
 3537|   116k|GBool JPXStream::readNBytes(int nBytes, GBool signd, int *x) {
 3538|   116k|  int y, c, i;
 3539|       |
 3540|   116k|  y = 0;
 3541|  1.04M|  for (i = 0; i < nBytes; ++i) {
  ------------------
  |  Branch (3541:15): [True: 929k, False: 116k]
  ------------------
 3542|   929k|    if ((c = bufStr->getChar()) == EOF) {
  ------------------
  |  Branch (3542:9): [True: 131, False: 929k]
  ------------------
 3543|    131|      return gFalse;
  ------------------
  |  |   18|    131|#define gFalse 0
  ------------------
 3544|    131|    }
 3545|   929k|    y = (y << 8) + c;
 3546|   929k|  }
 3547|   116k|  if (signd) {
  ------------------
  |  Branch (3547:7): [True: 57.8k, False: 58.3k]
  ------------------
 3548|  57.8k|    if (y & (1 << (8 * nBytes - 1))) {
  ------------------
  |  Branch (3548:9): [True: 3.06k, False: 54.8k]
  ------------------
 3549|  3.06k|      y |= -1 << (8 * nBytes);
 3550|  3.06k|    }
 3551|  57.8k|  }
 3552|   116k|  *x = y;
 3553|   116k|  return gTrue;
  ------------------
  |  |   17|   116k|#define gTrue 1
  ------------------
 3554|   116k|}
_ZN9JPXStream11startBitBufEj:
 3556|   723k|void JPXStream::startBitBuf(Guint byteCountA) {
 3557|   723k|  bitBufLen = 0;
 3558|   723k|  bitBufSkip = gFalse;
  ------------------
  |  |   18|   723k|#define gFalse 0
  ------------------
 3559|   723k|  byteCount = byteCountA;
 3560|   723k|}
_ZN9JPXStream8readBitsEiPj:
 3562|  6.89M|GBool JPXStream::readBits(int nBits, Guint *x) {
 3563|  6.89M|  int c;
 3564|       |
 3565|  8.86M|  while (bitBufLen < nBits) {
  ------------------
  |  Branch (3565:10): [True: 1.97M, False: 6.89M]
  ------------------
 3566|  1.97M|    if (byteCount == 0 || (c = bufStr->getChar()) == EOF) {
  ------------------
  |  Branch (3566:9): [True: 2.84k, False: 1.96M]
  |  Branch (3566:27): [True: 3.51k, False: 1.96M]
  ------------------
 3567|  6.35k|      return gFalse;
  ------------------
  |  |   18|  6.35k|#define gFalse 0
  ------------------
 3568|  6.35k|    }
 3569|  1.96M|    --byteCount;
 3570|  1.96M|    if (bitBufSkip) {
  ------------------
  |  Branch (3570:9): [True: 60.1k, False: 1.90M]
  ------------------
 3571|  60.1k|      bitBuf = (bitBuf << 7) | (c & 0x7f);
 3572|  60.1k|      bitBufLen += 7;
 3573|  1.90M|    } else {
 3574|  1.90M|      bitBuf = (bitBuf << 8) | (c & 0xff);
 3575|  1.90M|      bitBufLen += 8;
 3576|  1.90M|    }
 3577|  1.96M|    bitBufSkip = c == 0xff;
 3578|  1.96M|  }
 3579|  6.89M|  *x = (bitBuf >> (bitBufLen - nBits)) & ((1 << nBits) - 1);
 3580|  6.89M|  bitBufLen -= nBits;
 3581|  6.89M|  return gTrue;
  ------------------
  |  |   17|  6.89M|#define gTrue 1
  ------------------
 3582|  6.89M|}
_ZN9JPXStream7skipSOPEv:
 3584|   162k|void JPXStream::skipSOP() {
 3585|       |  // SOP occurs at the start of the packet header, so we don't need to
 3586|       |  // worry about bit-stuff prior to it
 3587|   162k|  if (byteCount >= 6 &&
  ------------------
  |  Branch (3587:7): [True: 161k, False: 1.06k]
  ------------------
 3588|   161k|      bufStr->lookChar(0) == 0xff &&
  ------------------
  |  Branch (3588:7): [True: 5.12k, False: 156k]
  ------------------
 3589|  5.12k|      bufStr->lookChar(1) == 0x91) {
  ------------------
  |  Branch (3589:7): [True: 485, False: 4.63k]
  ------------------
 3590|    485|    bufStr->discardChars(6);
 3591|    485|    byteCount -= 6;
 3592|    485|    bitBufLen = 0;
 3593|    485|    bitBufSkip = gFalse;
  ------------------
  |  |   18|    485|#define gFalse 0
  ------------------
 3594|    485|  }
 3595|   162k|}
_ZN9JPXStream7skipEPHEv:
 3597|   225k|void JPXStream::skipEPH() {
 3598|   225k|  int k;
 3599|       |
 3600|   225k|  k = bitBufSkip ? 1 : 0;
  ------------------
  |  Branch (3600:7): [True: 3.36k, False: 222k]
  ------------------
 3601|   225k|  if (byteCount >= (Guint)(k + 2) &&
  ------------------
  |  Branch (3601:7): [True: 222k, False: 2.88k]
  ------------------
 3602|   222k|      bufStr->lookChar(k) == 0xff &&
  ------------------
  |  Branch (3602:7): [True: 5.42k, False: 217k]
  ------------------
 3603|  5.42k|      bufStr->lookChar(k + 1) == 0x92) {
  ------------------
  |  Branch (3603:7): [True: 210, False: 5.21k]
  ------------------
 3604|    210|    bufStr->discardChars(k + 2);
 3605|    210|    byteCount -= k + 2;
 3606|    210|    bitBufLen = 0;
 3607|    210|    bitBufSkip = gFalse;
  ------------------
  |  |   18|    210|#define gFalse 0
  ------------------
 3608|    210|  }
 3609|   225k|}
_ZN9JPXStream12finishBitBufEv:
 3611|   717k|Guint JPXStream::finishBitBuf() {
 3612|   717k|  if (bitBufSkip) {
  ------------------
  |  Branch (3612:7): [True: 3.43k, False: 714k]
  ------------------
 3613|  3.43k|    bufStr->getChar();
 3614|  3.43k|    --byteCount;
 3615|  3.43k|  }
 3616|   717k|  return byteCount;
 3617|   717k|}

_ZN5LexerC2EP4XRefP6Stream:
   46|   363k|Lexer::Lexer(XRef *xref, Stream *str) {
   47|   363k|  Object obj;
   48|       |
   49|   363k|  curStr.initStream(str);
   50|   363k|  streams = new Array(xref);
   51|   363k|  streams->add(curStr.copy(&obj));
   52|   363k|  strPtr = 0;
   53|   363k|  freeArray = gTrue;
  ------------------
  |  |   17|   363k|#define gTrue 1
  ------------------
   54|   363k|  curStr.streamReset();
   55|   363k|}
_ZN5LexerD2Ev:
   75|   363k|Lexer::~Lexer() {
   76|   363k|  if (!curStr.isNone()) {
  ------------------
  |  Branch (76:7): [True: 122k, False: 240k]
  ------------------
   77|   122k|    curStr.streamClose();
   78|   122k|    curStr.free();
   79|   122k|  }
   80|   363k|  if (freeArray) {
  ------------------
  |  Branch (80:7): [True: 363k, False: 0]
  ------------------
   81|   363k|    delete streams;
   82|   363k|  }
   83|   363k|}
_ZN5Lexer7getCharEv:
   85|  1.16G|int Lexer::getChar() {
   86|  1.16G|  int c;
   87|       |
   88|  1.16G|  c = EOF;
   89|  1.16G|  while (!curStr.isNone() && (c = curStr.streamGetChar()) == EOF) {
  ------------------
  |  Branch (89:10): [True: 1.06G, False: 96.4M]
  |  Branch (89:30): [True: 240k, False: 1.06G]
  ------------------
   90|   240k|    curStr.streamClose();
   91|   240k|    curStr.free();
   92|   240k|    ++strPtr;
   93|   240k|    if (strPtr < streams->getLength()) {
  ------------------
  |  Branch (93:9): [True: 0, False: 240k]
  ------------------
   94|      0|      streams->get(strPtr, &curStr);
   95|      0|      curStr.streamReset();
   96|      0|    }
   97|   240k|  }
   98|  1.16G|  return c;
   99|  1.16G|}
_ZN5Lexer8lookCharEv:
  101|   264M|int Lexer::lookChar() {
  102|   264M|  if (curStr.isNone()) {
  ------------------
  |  Branch (102:7): [True: 3.04k, False: 264M]
  ------------------
  103|  3.04k|    return EOF;
  104|  3.04k|  }
  105|   264M|  return curStr.streamLookChar();
  106|   264M|}
_ZN5Lexer6getObjEP6Object:
  108|   141M|Object *Lexer::getObj(Object *obj) {
  109|   141M|  char *p;
  110|   141M|  int c, c2;
  111|   141M|  GBool comment, neg, doubleMinus, done, invalid;
  112|   141M|  int numParen, nErrors;
  113|   141M|  int xi;
  114|   141M|  double xf, scale;
  115|   141M|  GString *s;
  116|   141M|  int n, m;
  117|       |
  118|       |  // skip whitespace and comments
  119|   141M|  comment = gFalse;
  ------------------
  |  |   18|   141M|#define gFalse 0
  ------------------
  120|   594M|  while (1) {
  ------------------
  |  Branch (120:10): [True: 594M, Folded]
  ------------------
  121|   594M|    if ((c = getChar()) == EOF) {
  ------------------
  |  Branch (121:9): [True: 96.4M, False: 497M]
  ------------------
  122|  96.4M|      return obj->initEOF();
  123|  96.4M|    }
  124|   497M|    if (comment) {
  ------------------
  |  Branch (124:9): [True: 13.9M, False: 483M]
  ------------------
  125|  13.9M|      if (c == '\r' || c == '\n')
  ------------------
  |  Branch (125:11): [True: 107k, False: 13.8M]
  |  Branch (125:24): [True: 149k, False: 13.7M]
  ------------------
  126|   256k|	comment = gFalse;
  ------------------
  |  |   18|   256k|#define gFalse 0
  ------------------
  127|   483M|    } else if (c == '%') {
  ------------------
  |  Branch (127:16): [True: 258k, False: 483M]
  ------------------
  128|   258k|      comment = gTrue;
  ------------------
  |  |   17|   258k|#define gTrue 1
  ------------------
  129|   483M|    } else if (specialChars[c] != 1) {
  ------------------
  |  Branch (129:16): [True: 45.3M, False: 438M]
  ------------------
  130|  45.3M|      break;
  131|  45.3M|    }
  132|   497M|  }
  133|       |
  134|       |  // start reading token
  135|  45.3M|  switch (c) {
  136|       |
  137|       |  // number
  138|  5.49M|  case '0': case '1': case '2': case '3': case '4':
  ------------------
  |  Branch (138:3): [True: 2.88M, False: 42.4M]
  |  Branch (138:13): [True: 1.20M, False: 44.1M]
  |  Branch (138:23): [True: 786k, False: 44.5M]
  |  Branch (138:33): [True: 243k, False: 45.0M]
  |  Branch (138:43): [True: 381k, False: 44.9M]
  ------------------
  139|  7.16M|  case '5': case '6': case '7': case '8': case '9':
  ------------------
  |  Branch (139:3): [True: 257k, False: 45.0M]
  |  Branch (139:13): [True: 365k, False: 44.9M]
  |  Branch (139:23): [True: 193k, False: 45.1M]
  |  Branch (139:33): [True: 553k, False: 44.7M]
  |  Branch (139:43): [True: 297k, False: 45.0M]
  ------------------
  140|  7.67M|  case '+': case '-': case '.':
  ------------------
  |  Branch (140:3): [True: 34.7k, False: 45.2M]
  |  Branch (140:13): [True: 261k, False: 45.0M]
  |  Branch (140:23): [True: 211k, False: 45.1M]
  ------------------
  141|       |    // Adobe's number lexer has some "interesting" behavior:
  142|       |    // "--123" is interpreted as 0
  143|       |    // "--123.4" is interpreted as -123.4 [I've seen this in the wild]
  144|       |    // "50-100" is interpreted as 50 [I've seen this in the wild]
  145|       |    // "50--100" is interpreted as 50
  146|       |    // "50-100.0" is an error -- but older versions of Acrobat may
  147|       |    //   have interpreted it as 50100.0 (?)
  148|       |    // "50--100.0" is an error -- but older versions of Acrobat may
  149|       |    //   have interpreted it as 50100.0 (?)
  150|       |    // "50.0-100" is interpreted as 50.0 (or maybe 50.0100?)
  151|       |    // "50.0--100" is interpreted as 50.0 (or maybe 50.0100?)
  152|       |    // "-50-100" is interpreted as -50
  153|       |    // "-" is interpreted as 0
  154|       |    // "-." is interpreted as 0.0
  155|  7.67M|    neg = gFalse;
  ------------------
  |  |   18|  7.67M|#define gFalse 0
  ------------------
  156|  7.67M|    doubleMinus = gFalse;
  ------------------
  |  |   18|  7.67M|#define gFalse 0
  ------------------
  157|  7.67M|    xf = xi = 0;
  158|  7.67M|    if (c == '+') {
  ------------------
  |  Branch (158:9): [True: 34.7k, False: 7.63M]
  ------------------
  159|       |      // just ignore it
  160|  7.63M|    } else if (c == '-') {
  ------------------
  |  Branch (160:16): [True: 261k, False: 7.37M]
  ------------------
  161|   261k|      neg = gTrue;
  ------------------
  |  |   17|   261k|#define gTrue 1
  ------------------
  162|   261k|      if (lookChar() == '-') {
  ------------------
  |  Branch (162:11): [True: 10.7k, False: 250k]
  ------------------
  163|  10.7k|	doubleMinus = gTrue;
  ------------------
  |  |   17|  10.7k|#define gTrue 1
  ------------------
  164|  18.2k|	do {
  165|  18.2k|	  getChar();
  166|  18.2k|	} while (lookChar() == '-');
  ------------------
  |  Branch (166:11): [True: 7.47k, False: 10.7k]
  ------------------
  167|  10.7k|      }
  168|  7.37M|    } else if (c == '.') {
  ------------------
  |  Branch (168:16): [True: 211k, False: 7.16M]
  ------------------
  169|   211k|      goto doReal;
  170|  7.16M|    } else {
  171|  7.16M|      xf = xi = c - '0';
  172|  7.16M|    }
  173|  17.0M|    while (1) {
  ------------------
  |  Branch (173:12): [True: 17.0M, Folded]
  ------------------
  174|  17.0M|      c = lookChar();
  175|  17.0M|      if (isdigit(c)) {
  ------------------
  |  Branch (175:11): [True: 9.54M, False: 7.46M]
  ------------------
  176|  9.54M|	getChar();
  177|  9.54M|	xi = xi * 10 + (c - '0');
  178|  9.54M|	if (xf < 1e20) {
  ------------------
  |  Branch (178:6): [True: 8.60M, False: 938k]
  ------------------
  179|  8.60M|	  xf = xf * 10 + (c - '0');
  180|  8.60M|	}
  181|  9.54M|      } else if (c == '.') {
  ------------------
  |  Branch (181:18): [True: 408k, False: 7.05M]
  ------------------
  182|   408k|	getChar();
  183|   408k|	goto doReal;
  184|  7.05M|      } else {
  185|  7.05M|	break;
  186|  7.05M|      }
  187|  17.0M|    }
  188|  7.06M|    while ((c = lookChar()) == '-' || isdigit(c)) {
  ------------------
  |  Branch (188:12): [True: 5.65k, False: 7.06M]
  |  Branch (188:39): [True: 6.72k, False: 7.05M]
  ------------------
  189|  12.3k|      getChar();
  190|  12.3k|    }
  191|  7.05M|    if (neg) {
  ------------------
  |  Branch (191:9): [True: 256k, False: 6.79M]
  ------------------
  192|   256k|      xi = -xi;
  193|   256k|    }
  194|  7.05M|    if (doubleMinus) {
  ------------------
  |  Branch (194:9): [True: 10.6k, False: 7.04M]
  ------------------
  195|  10.6k|      xi = 0;
  196|  10.6k|    }
  197|  7.05M|    obj->initInt(xi);
  198|  7.05M|    break;
  199|   619k|  doReal:
  200|   619k|    scale = 0.1;
  201|  1.26M|    while (1) {
  ------------------
  |  Branch (201:12): [True: 1.26M, Folded]
  ------------------
  202|  1.26M|      c = lookChar();
  203|  1.26M|      if (c == '-') {
  ------------------
  |  Branch (203:11): [True: 31.7k, False: 1.23M]
  ------------------
  204|  31.7k|	error(errSyntaxWarning, getPos(), "Badly formatted number");
  205|  31.7k|	getChar();
  206|  31.7k|	continue;
  207|  31.7k|      }
  208|  1.23M|      if (!isdigit(c)) {
  ------------------
  |  Branch (208:11): [True: 619k, False: 612k]
  ------------------
  209|   619k|	break;
  210|   619k|      }
  211|   612k|      getChar();
  212|   612k|      xf = xf + scale * (c - '0');
  213|   612k|      scale *= 0.1;
  214|   612k|    }
  215|   619k|    while ((c = lookChar()) == '-' || isdigit(c)) {
  ------------------
  |  Branch (215:12): [True: 0, False: 619k]
  |  Branch (215:39): [True: 0, False: 619k]
  ------------------
  216|      0|      getChar();
  217|      0|    }
  218|   619k|    if (neg) {
  ------------------
  |  Branch (218:9): [True: 5.08k, False: 614k]
  ------------------
  219|  5.08k|      xf = -xf;
  220|  5.08k|    }
  221|   619k|    obj->initReal(xf);
  222|   619k|    break;
  223|       |
  224|       |  // string
  225|   204k|  case '(':
  ------------------
  |  Branch (225:3): [True: 204k, False: 45.1M]
  ------------------
  226|   204k|    p = tokBuf;
  227|   204k|    n = 0;
  228|   204k|    numParen = 1;
  229|   204k|    done = gFalse;
  ------------------
  |  |   18|   204k|#define gFalse 0
  ------------------
  230|   204k|    s = NULL;
  231|   286M|    do {
  232|   286M|      c2 = EOF;
  233|   286M|      switch (c = getChar()) {
  234|       |
  235|  9.66k|      case EOF:
  ------------------
  |  Branch (235:7): [True: 9.66k, False: 286M]
  ------------------
  236|  9.66k|	error(errSyntaxError, getPos(), "Unterminated string");
  237|  9.66k|	done = gTrue;
  ------------------
  |  |   17|  9.66k|#define gTrue 1
  ------------------
  238|  9.66k|	break;
  239|       |
  240|   437k|      case '(':
  ------------------
  |  Branch (240:7): [True: 437k, False: 285M]
  ------------------
  241|   437k|	++numParen;
  242|   437k|	c2 = c;
  243|   437k|	break;
  244|       |
  245|   599k|      case ')':
  ------------------
  |  Branch (245:7): [True: 599k, False: 285M]
  ------------------
  246|   599k|	if (--numParen == 0) {
  ------------------
  |  Branch (246:6): [True: 195k, False: 404k]
  ------------------
  247|   195k|	  done = gTrue;
  ------------------
  |  |   17|   195k|#define gTrue 1
  ------------------
  248|   404k|	} else {
  249|   404k|	  c2 = c;
  250|   404k|	}
  251|   599k|	break;
  252|       |
  253|  4.64M|      case '\r':
  ------------------
  |  Branch (253:7): [True: 4.64M, False: 281M]
  ------------------
  254|       |	// The PDF spec says that any literal end-of-line sequence
  255|       |	// (LF, CR, CR+LF) is translated to a single LF char.
  256|  4.64M|	c = lookChar();
  257|  4.64M|	if (c == '\n') {
  ------------------
  |  Branch (257:6): [True: 132k, False: 4.50M]
  ------------------
  258|   132k|	  getChar();
  259|   132k|	}
  260|  4.64M|	c2 = '\n';
  261|  4.64M|	break;
  262|       |
  263|   158k|      case '\\':
  ------------------
  |  Branch (263:7): [True: 158k, False: 285M]
  ------------------
  264|   158k|	switch (c = getChar()) {
  265|  2.68k|	case 'n':
  ------------------
  |  Branch (265:2): [True: 2.68k, False: 156k]
  ------------------
  266|  2.68k|	  c2 = '\n';
  267|  2.68k|	  break;
  268|  14.1k|	case 'r':
  ------------------
  |  Branch (268:2): [True: 14.1k, False: 144k]
  ------------------
  269|  14.1k|	  c2 = '\r';
  270|  14.1k|	  break;
  271|  22.2k|	case 't':
  ------------------
  |  Branch (271:2): [True: 22.2k, False: 136k]
  ------------------
  272|  22.2k|	  c2 = '\t';
  273|  22.2k|	  break;
  274|    473|	case 'b':
  ------------------
  |  Branch (274:2): [True: 473, False: 158k]
  ------------------
  275|    473|	  c2 = '\b';
  276|    473|	  break;
  277|    156|	case 'f':
  ------------------
  |  Branch (277:2): [True: 156, False: 158k]
  ------------------
  278|    156|	  c2 = '\f';
  279|    156|	  break;
  280|  2.28k|	case '\\':
  ------------------
  |  Branch (280:2): [True: 2.28k, False: 156k]
  ------------------
  281|  11.1k|	case '(':
  ------------------
  |  Branch (281:2): [True: 8.84k, False: 149k]
  ------------------
  282|  20.0k|	case ')':
  ------------------
  |  Branch (282:2): [True: 8.96k, False: 149k]
  ------------------
  283|  20.0k|	  c2 = c;
  284|  20.0k|	  break;
  285|  6.14k|	case '0': case '1': case '2': case '3':
  ------------------
  |  Branch (285:2): [True: 4.36k, False: 154k]
  |  Branch (285:12): [True: 1.09k, False: 157k]
  |  Branch (285:22): [True: 183, False: 158k]
  |  Branch (285:32): [True: 495, False: 158k]
  ------------------
  286|  28.7k|	case '4': case '5': case '6': case '7':
  ------------------
  |  Branch (286:2): [True: 4.11k, False: 154k]
  |  Branch (286:12): [True: 6.65k, False: 152k]
  |  Branch (286:22): [True: 6.34k, False: 152k]
  |  Branch (286:32): [True: 5.52k, False: 153k]
  ------------------
  287|  28.7k|	  c2 = c - '0';
  288|  28.7k|	  c = lookChar();
  289|  28.7k|	  if (c >= '0' && c <= '7') {
  ------------------
  |  Branch (289:8): [True: 13.5k, False: 15.2k]
  |  Branch (289:20): [True: 5.44k, False: 8.08k]
  ------------------
  290|  5.44k|	    getChar();
  291|  5.44k|	    c2 = (c2 << 3) + (c - '0');
  292|  5.44k|	    c = lookChar();
  293|  5.44k|	    if (c >= '0' && c <= '7') {
  ------------------
  |  Branch (293:10): [True: 1.32k, False: 4.12k]
  |  Branch (293:22): [True: 151, False: 1.16k]
  ------------------
  294|    151|	      getChar();
  295|    151|	      c2 = (c2 << 3) + (c - '0');
  296|    151|	    }
  297|  5.44k|	  }
  298|  28.7k|	  break;
  299|  1.42k|	case '\r':
  ------------------
  |  Branch (299:2): [True: 1.42k, False: 157k]
  ------------------
  300|  1.42k|	  c = lookChar();
  301|  1.42k|	  if (c == '\n') {
  ------------------
  |  Branch (301:8): [True: 1.09k, False: 329]
  ------------------
  302|  1.09k|	    getChar();
  303|  1.09k|	  }
  304|  1.42k|	  break;
  305|  6.63k|	case '\n':
  ------------------
  |  Branch (305:2): [True: 6.63k, False: 152k]
  ------------------
  306|  6.63k|	  break;
  307|    252|	case EOF:
  ------------------
  |  Branch (307:2): [True: 252, False: 158k]
  ------------------
  308|    252|	  error(errSyntaxError, getPos(), "Unterminated string");
  309|    252|	  done = gTrue;
  ------------------
  |  |   17|    252|#define gTrue 1
  ------------------
  310|    252|	  break;
  311|  61.9k|	default:
  ------------------
  |  Branch (311:2): [True: 61.9k, False: 96.9k]
  ------------------
  312|  61.9k|	  c2 = c;
  313|  61.9k|	  break;
  314|   158k|	}
  315|   158k|	break;
  316|       |
  317|   280M|      default:
  ------------------
  |  Branch (317:7): [True: 280M, False: 5.84M]
  ------------------
  318|   280M|	c2 = c;
  319|   280M|	break;
  320|   286M|      }
  321|       |
  322|   286M|      if (c2 != EOF) {
  ------------------
  |  Branch (322:11): [True: 285M, False: 212k]
  ------------------
  323|   285M|	if (n == tokBufSize) {
  ------------------
  |  |   19|   285M|#define tokBufSize 128		// size of token buffer
  ------------------
  |  Branch (323:6): [True: 2.16M, False: 283M]
  ------------------
  324|  2.16M|	  if (!s)
  ------------------
  |  Branch (324:8): [True: 60.1k, False: 2.10M]
  ------------------
  325|  60.1k|	    s = new GString(tokBuf, tokBufSize);
  ------------------
  |  |   19|  60.1k|#define tokBufSize 128		// size of token buffer
  ------------------
  326|  2.10M|	  else
  327|  2.10M|	    s->append(tokBuf, tokBufSize);
  ------------------
  |  |   19|  2.10M|#define tokBufSize 128		// size of token buffer
  ------------------
  328|  2.16M|	  p = tokBuf;
  329|  2.16M|	  n = 0;
  330|  2.16M|	}
  331|   285M|	*p++ = (char)c2;
  332|   285M|	++n;
  333|   285M|      }
  334|   286M|    } while (!done);
  ------------------
  |  Branch (334:14): [True: 285M, False: 204k]
  ------------------
  335|   204k|    if (!s)
  ------------------
  |  Branch (335:9): [True: 144k, False: 60.1k]
  ------------------
  336|   144k|      s = new GString(tokBuf, n);
  337|  60.1k|    else
  338|  60.1k|      s->append(tokBuf, n);
  339|   204k|    obj->initString(s);
  340|   204k|    break;
  341|       |
  342|       |  // name
  343|  6.76M|  case '/':
  ------------------
  |  Branch (343:3): [True: 6.76M, False: 38.5M]
  ------------------
  344|  6.76M|    p = tokBuf;
  345|  6.76M|    n = 0;
  346|  6.76M|    s = NULL;
  347|  6.76M|    invalid = gFalse;
  ------------------
  |  |   18|  6.76M|#define gFalse 0
  ------------------
  348|  28.7M|    while ((c = lookChar()) != EOF && !specialChars[c]) {
  ------------------
  |  Branch (348:12): [True: 28.7M, False: 3.07k]
  |  Branch (348:39): [True: 22.0M, False: 6.76M]
  ------------------
  349|  22.0M|      getChar();
  350|  22.0M|      if (c == '#') {
  ------------------
  |  Branch (350:11): [True: 819k, False: 21.1M]
  ------------------
  351|   819k|	c2 = lookChar();
  352|   819k|	if (c2 >= '0' && c2 <= '9') {
  ------------------
  |  Branch (352:6): [True: 401k, False: 417k]
  |  Branch (352:19): [True: 714, False: 401k]
  ------------------
  353|    714|	  c = c2 - '0';
  354|   818k|	} else if (c2 >= 'A' && c2 <= 'F') {
  ------------------
  |  Branch (354:13): [True: 400k, False: 417k]
  |  Branch (354:26): [True: 46.5k, False: 354k]
  ------------------
  355|  46.5k|	  c = c2 - 'A' + 10;
  356|   772k|	} else if (c2 >= 'a' && c2 <= 'f') {
  ------------------
  |  Branch (356:13): [True: 354k, False: 417k]
  |  Branch (356:26): [True: 96.9k, False: 257k]
  ------------------
  357|  96.9k|	  c = c2 - 'a' + 10;
  358|   675k|	} else {
  359|   675k|	  error(errSyntaxError, getPos(), "Invalid hex escape in name");
  360|   675k|	  goto notEscChar;
  361|   675k|	}
  362|   144k|	getChar();
  363|   144k|	c2 = lookChar();
  364|   144k|	if (c2 >= '0' && c2 <= '9') {
  ------------------
  |  Branch (364:6): [True: 142k, False: 1.36k]
  |  Branch (364:19): [True: 26.7k, False: 116k]
  ------------------
  365|  26.7k|	  c = (c << 4) + (c2 - '0');
  366|   117k|	} else if (c2 >= 'A' && c2 <= 'F') {
  ------------------
  |  Branch (366:13): [True: 93.6k, False: 23.7k]
  |  Branch (366:26): [True: 46.3k, False: 47.2k]
  ------------------
  367|  46.3k|	  c = (c << 4) + (c2 - 'A' + 10);
  368|  71.0k|	} else if (c2 >= 'a' && c2 <= 'f') {
  ------------------
  |  Branch (368:13): [True: 940, False: 70.0k]
  |  Branch (368:26): [True: 306, False: 634]
  ------------------
  369|    306|	  c = (c << 4) + (c2 - 'a' + 10);
  370|  70.7k|	} else {
  371|  70.7k|	  error(errSyntaxError, getPos(), "Invalid hex escape in name");
  372|  70.7k|	  goto notEscChar;
  373|  70.7k|	}
  374|  73.4k|	getChar();
  375|  73.4k|	if (c == 0) {
  ------------------
  |  Branch (375:6): [True: 379, False: 73.0k]
  ------------------
  376|    379|	  invalid = gTrue;
  ------------------
  |  |   17|    379|#define gTrue 1
  ------------------
  377|    379|	}
  378|  73.4k|      }
  379|  22.0M|     notEscChar:
  380|       |      // the PDF spec claims that names are limited to 127 chars, but
  381|       |      // Distiller 8 will produce longer names, and Acrobat 8 will
  382|       |      // accept longer names
  383|  22.0M|      ++n;
  384|  22.0M|      if (n < tokBufSize) {
  ------------------
  |  |   19|  22.0M|#define tokBufSize 128		// size of token buffer
  ------------------
  |  Branch (384:11): [True: 20.8M, False: 1.16M]
  ------------------
  385|  20.8M|	*p++ = (char)c;
  386|  20.8M|      } else if (n == tokBufSize) {
  ------------------
  |  |   19|  1.16M|#define tokBufSize 128		// size of token buffer
  ------------------
  |  Branch (386:18): [True: 1.45k, False: 1.16M]
  ------------------
  387|  1.45k|	*p = (char)c;
  388|  1.45k|	s = new GString(tokBuf, n);
  389|  1.16M|      } else {
  390|  1.16M|	s->append((char)c);
  391|  1.16M|      }
  392|  22.0M|    }
  393|  6.76M|    if (invalid) {
  ------------------
  |  Branch (393:9): [True: 379, False: 6.76M]
  ------------------
  394|    379|      error(errSyntaxError, getPos(), "Null character in name");
  395|    379|      obj->initError();
  396|    379|      if (s) {
  ------------------
  |  Branch (396:11): [True: 142, False: 237]
  ------------------
  397|    142|	delete s;
  398|    142|      }
  399|  6.76M|    } else if (n < tokBufSize) {
  ------------------
  |  |   19|  6.76M|#define tokBufSize 128		// size of token buffer
  ------------------
  |  Branch (399:16): [True: 6.76M, False: 1.31k]
  ------------------
  400|  6.76M|      *p = '\0';
  401|  6.76M|      obj->initName(tokBuf);
  402|  6.76M|    } else {
  403|  1.31k|      obj->initName(s->getCString());
  404|  1.31k|      delete s;
  405|  1.31k|    }
  406|  6.76M|    break;
  407|       |
  408|       |  // array punctuation
  409|  5.06M|  case '[':
  ------------------
  |  Branch (409:3): [True: 5.06M, False: 40.2M]
  ------------------
  410|  5.58M|  case ']':
  ------------------
  |  Branch (410:3): [True: 518k, False: 44.8M]
  ------------------
  411|  5.58M|    tokBuf[0] = (char)c;
  412|  5.58M|    tokBuf[1] = '\0';
  413|  5.58M|    obj->initCmd(tokBuf);
  414|  5.58M|    break;
  415|       |
  416|       |  // hex string or dict punctuation
  417|  3.95M|  case '<':
  ------------------
  |  Branch (417:3): [True: 3.95M, False: 41.3M]
  ------------------
  418|  3.95M|    c = lookChar();
  419|       |
  420|       |    // dict punctuation
  421|  3.95M|    if (c == '<') {
  ------------------
  |  Branch (421:9): [True: 3.21M, False: 743k]
  ------------------
  422|  3.21M|      getChar();
  423|  3.21M|      tokBuf[0] = tokBuf[1] = '<';
  424|  3.21M|      tokBuf[2] = '\0';
  425|  3.21M|      obj->initCmd(tokBuf);
  426|       |
  427|       |    // hex string
  428|  3.21M|    } else {
  429|   743k|      p = tokBuf;
  430|   743k|      m = n = 0;
  431|   743k|      c2 = 0;
  432|   743k|      s = NULL;
  433|   743k|      nErrors = 0;
  434|  60.0M|      while (nErrors < 100) {
  ------------------
  |  Branch (434:14): [True: 59.8M, False: 155k]
  ------------------
  435|  59.8M|	c = getChar();
  436|  59.8M|	if (c == '>') {
  ------------------
  |  Branch (436:6): [True: 584k, False: 59.3M]
  ------------------
  437|   584k|	  break;
  438|  59.3M|	} else if (c == EOF) {
  ------------------
  |  Branch (438:13): [True: 3.18k, False: 59.3M]
  ------------------
  439|  3.18k|	  error(errSyntaxError, getPos(), "Unterminated hex string");
  440|  3.18k|	  break;
  441|  59.3M|	} else if (specialChars[c] != 1) {
  ------------------
  |  Branch (441:13): [True: 45.9M, False: 13.3M]
  ------------------
  442|  45.9M|	  c2 = c2 << 4;
  443|  45.9M|	  if (c >= '0' && c <= '9') {
  ------------------
  |  Branch (443:8): [True: 41.3M, False: 4.60M]
  |  Branch (443:20): [True: 6.08M, False: 35.2M]
  ------------------
  444|  6.08M|	    c2 += c - '0';
  445|  39.9M|	  } else if (c >= 'A' && c <= 'F') {
  ------------------
  |  Branch (445:15): [True: 31.4M, False: 8.49M]
  |  Branch (445:27): [True: 756k, False: 30.6M]
  ------------------
  446|   756k|	    c2 += c - 'A' + 10;
  447|  39.1M|	  } else if (c >= 'a' && c <= 'f') {
  ------------------
  |  Branch (447:15): [True: 27.9M, False: 11.1M]
  |  Branch (447:27): [True: 6.35M, False: 21.6M]
  ------------------
  448|  6.35M|	    c2 += c - 'a' + 10;
  449|  32.7M|	  } else {
  450|  32.7M|	    error(errSyntaxError, getPos(),
  451|  32.7M|		  "Illegal character <{0:02x}> in hex string", c);
  452|  32.7M|	    ++nErrors;
  453|  32.7M|	  }
  454|  45.9M|	  if (++m == 2) {
  ------------------
  |  Branch (454:8): [True: 22.8M, False: 23.1M]
  ------------------
  455|  22.8M|	    if (n == tokBufSize) {
  ------------------
  |  |   19|  22.8M|#define tokBufSize 128		// size of token buffer
  ------------------
  |  Branch (455:10): [True: 4.84k, False: 22.8M]
  ------------------
  456|  4.84k|	      if (!s)
  ------------------
  |  Branch (456:12): [True: 1.57k, False: 3.27k]
  ------------------
  457|  1.57k|		s = new GString(tokBuf, tokBufSize);
  ------------------
  |  |   19|  1.57k|#define tokBufSize 128		// size of token buffer
  ------------------
  458|  3.27k|	      else
  459|  3.27k|		s->append(tokBuf, tokBufSize);
  ------------------
  |  |   19|  3.27k|#define tokBufSize 128		// size of token buffer
  ------------------
  460|  4.84k|	      p = tokBuf;
  461|  4.84k|	      n = 0;
  462|  4.84k|	    }
  463|  22.8M|	    *p++ = (char)c2;
  464|  22.8M|	    ++n;
  465|  22.8M|	    c2 = 0;
  466|  22.8M|	    m = 0;
  467|  22.8M|	  }
  468|  45.9M|	}
  469|  59.8M|      }
  470|   743k|      if (!s)
  ------------------
  |  Branch (470:11): [True: 741k, False: 1.57k]
  ------------------
  471|   741k|	s = new GString(tokBuf, n);
  472|  1.57k|      else
  473|  1.57k|	s->append(tokBuf, n);
  474|   743k|      if (m == 1)
  ------------------
  |  Branch (474:11): [True: 334k, False: 408k]
  ------------------
  475|   334k|	s->append((char)(c2 << 4));
  476|   743k|      obj->initString(s);
  477|   743k|    }
  478|  3.95M|    break;
  479|       |
  480|       |  // dict punctuation
  481|  2.94M|  case '>':
  ------------------
  |  Branch (481:3): [True: 2.94M, False: 42.3M]
  ------------------
  482|  2.94M|    c = lookChar();
  483|  2.94M|    if (c == '>') {
  ------------------
  |  Branch (483:9): [True: 1.88M, False: 1.05M]
  ------------------
  484|  1.88M|      getChar();
  485|  1.88M|      tokBuf[0] = tokBuf[1] = '>';
  486|  1.88M|      tokBuf[2] = '\0';
  487|  1.88M|      obj->initCmd(tokBuf);
  488|  1.88M|    } else {
  489|  1.05M|      error(errSyntaxError, getPos(), "Illegal character '>'");
  490|  1.05M|      obj->initError();
  491|  1.05M|    }
  492|  2.94M|    break;
  493|       |
  494|       |  // error
  495|   792k|  case ')':
  ------------------
  |  Branch (495:3): [True: 792k, False: 44.5M]
  ------------------
  496|   959k|  case '{':
  ------------------
  |  Branch (496:3): [True: 166k, False: 45.1M]
  ------------------
  497|  1.08M|  case '}':
  ------------------
  |  Branch (497:3): [True: 121k, False: 45.1M]
  ------------------
  498|  1.08M|    error(errSyntaxError, getPos(), "Illegal character '{0:c}'", c);
  499|  1.08M|    obj->initError();
  500|  1.08M|    break;
  501|       |
  502|       |  // command
  503|  17.1M|  default:
  ------------------
  |  Branch (503:3): [True: 17.1M, False: 28.2M]
  ------------------
  504|  17.1M|    p = tokBuf;
  505|  17.1M|    *p++ = (char)c;
  506|  17.1M|    n = 1;
  507|   197M|    while ((c = lookChar()) != EOF && !specialChars[c]) {
  ------------------
  |  Branch (507:12): [True: 197M, False: 20.2k]
  |  Branch (507:39): [True: 180M, False: 16.2M]
  ------------------
  508|   180M|      getChar();
  509|   180M|      if (++n == tokBufSize) {
  ------------------
  |  |   19|   180M|#define tokBufSize 128		// size of token buffer
  ------------------
  |  Branch (509:11): [True: 808k, False: 180M]
  ------------------
  510|   808k|	error(errSyntaxError, getPos(), "Command token too long");
  511|   808k|	break;
  512|   808k|      }
  513|   180M|      *p++ = (char)c;
  514|   180M|    }
  515|  17.1M|    *p = '\0';
  516|  17.1M|    if (tokBuf[0] == 't' && !strcmp(tokBuf, "true")) {
  ------------------
  |  Branch (516:9): [True: 2.00M, False: 15.1M]
  |  Branch (516:29): [True: 69.8k, False: 1.93M]
  ------------------
  517|  69.8k|      obj->initBool(gTrue);
  ------------------
  |  |   17|  69.8k|#define gTrue 1
  ------------------
  518|  17.0M|    } else if (tokBuf[0] == 'f' && !strcmp(tokBuf, "false")) {
  ------------------
  |  Branch (518:16): [True: 40.5k, False: 16.9M]
  |  Branch (518:36): [True: 1.11k, False: 39.4k]
  ------------------
  519|  1.11k|      obj->initBool(gFalse);
  ------------------
  |  |   18|  1.11k|#define gFalse 0
  ------------------
  520|  17.0M|    } else if (tokBuf[0] == 'n' && !strcmp(tokBuf, "null")) {
  ------------------
  |  Branch (520:16): [True: 210k, False: 16.8M]
  |  Branch (520:36): [True: 1.11k, False: 209k]
  ------------------
  521|  1.11k|      obj->initNull();
  522|  17.0M|    } else {
  523|  17.0M|      obj->initCmd(tokBuf);
  524|  17.0M|    }
  525|  17.1M|    break;
  526|  45.3M|  }
  527|       |
  528|  45.3M|  return obj;
  529|  45.3M|}
_ZN5Lexer14skipToNextLineEv:
  531|   101k|void Lexer::skipToNextLine() {
  532|   101k|  int c;
  533|       |
  534|   533k|  while (1) {
  ------------------
  |  Branch (534:10): [True: 533k, Folded]
  ------------------
  535|   533k|    c = getChar();
  536|   533k|    if (c == EOF || c == '\n') {
  ------------------
  |  Branch (536:9): [True: 3.08k, False: 530k]
  |  Branch (536:21): [True: 26.0k, False: 504k]
  ------------------
  537|  29.1k|      return;
  538|  29.1k|    }
  539|   504k|    if (c == '\r') {
  ------------------
  |  Branch (539:9): [True: 72.2k, False: 432k]
  ------------------
  540|  72.2k|      if ((c = lookChar()) == '\n') {
  ------------------
  |  Branch (540:11): [True: 66.1k, False: 6.09k]
  ------------------
  541|  66.1k|	getChar();
  542|  66.1k|      }
  543|  72.2k|      return;
  544|  72.2k|    }
  545|   504k|  }
  546|   101k|}
_ZN5Lexer9skipToEOFEv:
  548|  35.3k|void Lexer::skipToEOF() {
  549|  2.40M|  while (getChar() != EOF) ;
  ------------------
  |  Branch (549:10): [True: 2.37M, False: 35.3k]
  ------------------
  550|  35.3k|}
_ZN5Lexer7isSpaceEi:
  552|  47.9M|GBool Lexer::isSpace(int c) {
  553|  47.9M|  return c >= 0 && c <= 0xff && specialChars[c] == 1;
  ------------------
  |  Branch (553:10): [True: 47.9M, False: 8.13k]
  |  Branch (553:20): [True: 47.9M, False: 0]
  |  Branch (553:33): [True: 9.71M, False: 38.2M]
  ------------------
  554|  47.9M|}

_ZN5Lexer8skipCharEv:
   49|   291k|  void skipChar() { getChar(); }
_ZN5Lexer9getStreamEv:
   56|   396k|    { return curStr.isNone() ? (Stream *)NULL : curStr.getStream(); }
  ------------------
  |  Branch (56:14): [True: 3.08k, False: 393k]
  ------------------
_ZN5Lexer6getPosEv:
   60|  50.2M|    { return curStr.isNone() ? -1 : curStr.streamGetPos(); }
  ------------------
  |  Branch (60:14): [True: 396k, False: 49.8M]
  ------------------
_ZN5Lexer6setPosEli:
   64|  86.5k|    { if (!curStr.isNone()) curStr.streamSetPos(pos, dir); }
  ------------------
  |  Branch (64:11): [True: 86.5k, False: 0]
  ------------------

_ZN10LinkAction9parseDestEP6Object:
   26|    318|LinkAction *LinkAction::parseDest(Object *obj) {
   27|    318|  LinkAction *action;
   28|       |
   29|    318|  action = new LinkGoTo(obj);
   30|    318|  if (!action->isOk()) {
  ------------------
  |  Branch (30:7): [True: 105, False: 213]
  ------------------
   31|    105|    delete action;
   32|    105|    return NULL;
   33|    105|  }
   34|    213|  return action;
   35|    318|}
_ZN10LinkAction11parseActionEP6ObjectP7GString:
   37|    348|LinkAction *LinkAction::parseAction(Object *obj, GString *baseURI) {
   38|    348|  LinkAction *action;
   39|    348|  Object obj2, obj3, obj4, obj5;
   40|       |
   41|    348|  if (!obj->isDict()) {
  ------------------
  |  Branch (41:7): [True: 26, False: 322]
  ------------------
   42|     26|    error(errSyntaxWarning, -1, "Bad annotation action");
   43|     26|    return NULL;
   44|     26|  }
   45|       |
   46|    322|  obj->dictLookup("S", &obj2);
   47|       |
   48|       |  // GoTo action
   49|    322|  if (obj2.isName("GoTo")) {
  ------------------
  |  Branch (49:7): [True: 31, False: 291]
  ------------------
   50|     31|    obj->dictLookup("D", &obj3);
   51|     31|    action = new LinkGoTo(&obj3);
   52|     31|    obj3.free();
   53|       |
   54|       |  // GoToR action
   55|    291|  } else if (obj2.isName("GoToR")) {
  ------------------
  |  Branch (55:14): [True: 123, False: 168]
  ------------------
   56|    123|    obj->dictLookup("F", &obj3);
   57|    123|    obj->dictLookup("D", &obj4);
   58|    123|    action = new LinkGoToR(&obj3, &obj4);
   59|    123|    obj3.free();
   60|    123|    obj4.free();
   61|       |
   62|       |  // Launch action
   63|    168|  } else if (obj2.isName("Launch")) {
  ------------------
  |  Branch (63:14): [True: 0, False: 168]
  ------------------
   64|      0|    action = new LinkLaunch(obj);
   65|       |
   66|       |  // URI action
   67|    168|  } else if (obj2.isName("URI")) {
  ------------------
  |  Branch (67:14): [True: 54, False: 114]
  ------------------
   68|     54|    obj->dictLookup("URI", &obj3);
   69|     54|    action = new LinkURI(&obj3, baseURI);
   70|     54|    obj3.free();
   71|       |
   72|       |  // Named action
   73|    114|  } else if (obj2.isName("Named")) {
  ------------------
  |  Branch (73:14): [True: 0, False: 114]
  ------------------
   74|      0|    obj->dictLookup("N", &obj3);
   75|      0|    action = new LinkNamed(&obj3);
   76|      0|    obj3.free();
   77|       |
   78|       |  // Movie action
   79|    114|  } else if (obj2.isName("Movie")) {
  ------------------
  |  Branch (79:14): [True: 0, False: 114]
  ------------------
   80|      0|    obj->dictLookupNF("Annot", &obj3);
   81|      0|    obj->dictLookup("T", &obj4);
   82|      0|    action = new LinkMovie(&obj3, &obj4);
   83|      0|    obj3.free();
   84|      0|    obj4.free();
   85|       |
   86|       |  // JavaScript action
   87|    114|  } else if (obj2.isName("JavaScript")) {
  ------------------
  |  Branch (87:14): [True: 48, False: 66]
  ------------------
   88|     48|    obj->dictLookup("JS", &obj3);
   89|     48|    action = new LinkJavaScript(&obj3);
   90|     48|    obj3.free();
   91|       |
   92|       |  // SubmitForm action
   93|     66|  } else if (obj2.isName("SubmitForm")) {
  ------------------
  |  Branch (93:14): [True: 0, False: 66]
  ------------------
   94|      0|    obj->dictLookup("F", &obj3);
   95|      0|    obj->dictLookup("Fields", &obj4);
   96|      0|    obj->dictLookup("Flags", &obj5);
   97|      0|    action = new LinkSubmitForm(&obj3, &obj4, &obj5);
   98|      0|    obj3.free();
   99|      0|    obj4.free();
  100|      0|    obj5.free();
  101|       |
  102|       |  // Hide action
  103|     66|  } else if (obj2.isName("Hide")) {
  ------------------
  |  Branch (103:14): [True: 0, False: 66]
  ------------------
  104|      0|    obj->dictLookupNF("T", &obj3);
  105|      0|    obj->dictLookup("H", &obj4);
  106|      0|    action = new LinkHide(&obj3, &obj4);
  107|      0|    obj3.free();
  108|      0|    obj4.free();
  109|       |
  110|       |  // unknown action
  111|     66|  } else if (obj2.isName()) {
  ------------------
  |  Branch (111:14): [True: 52, False: 14]
  ------------------
  112|     52|    action = new LinkUnknown(obj2.getName());
  113|       |
  114|       |  // action is missing or wrong type
  115|     52|  } else {
  116|     14|    error(errSyntaxWarning, -1, "Bad annotation action");
  117|     14|    action = NULL;
  118|     14|  }
  119|       |
  120|    322|  obj2.free();
  121|       |
  122|    322|  if (action && !action->isOk()) {
  ------------------
  |  Branch (122:7): [True: 308, False: 14]
  |  Branch (122:17): [True: 153, False: 155]
  ------------------
  123|    153|    delete action;
  124|    153|    return NULL;
  125|    153|  }
  126|    169|  return action;
  127|    322|}
_ZN10LinkAction15getFileSpecNameEP6Object:
  129|    123|GString *LinkAction::getFileSpecName(Object *fileSpecObj) {
  130|    123|  GString *name;
  131|    123|  Object obj1;
  132|       |
  133|    123|  name = NULL;
  134|       |
  135|       |  // string
  136|    123|  if (fileSpecObj->isString()) {
  ------------------
  |  Branch (136:7): [True: 9, False: 114]
  ------------------
  137|      9|    name = fileSpecObj->getString()->copy();
  138|       |
  139|       |  // dictionary
  140|    114|  } else if (fileSpecObj->isDict()) {
  ------------------
  |  Branch (140:14): [True: 15, False: 99]
  ------------------
  141|       |#ifdef _WIN32
  142|       |    if (!fileSpecObj->dictLookup("DOS", &obj1)->isString()) {
  143|       |#else
  144|     15|    if (!fileSpecObj->dictLookup("Unix", &obj1)->isString()) {
  ------------------
  |  Branch (144:9): [True: 15, False: 0]
  ------------------
  145|     15|#endif
  146|     15|      obj1.free();
  147|     15|      fileSpecObj->dictLookup("F", &obj1);
  148|     15|    }
  149|     15|    if (obj1.isString()) {
  ------------------
  |  Branch (149:9): [True: 9, False: 6]
  ------------------
  150|      9|      name = obj1.getString()->copy();
  151|      9|    } else {
  152|      6|      error(errSyntaxWarning, -1, "Illegal file spec in link");
  153|      6|    }
  154|     15|    obj1.free();
  155|       |
  156|       |  // error
  157|     99|  } else {
  158|     99|    error(errSyntaxWarning, -1, "Illegal file spec in link");
  159|     99|  }
  160|       |
  161|       |  // system-dependent path manipulation
  162|    123|  if (name) {
  ------------------
  |  Branch (162:7): [True: 18, False: 105]
  ------------------
  163|       |#ifdef _WIN32
  164|       |    int i, j;
  165|       |
  166|       |    // "//...."             --> "\...."
  167|       |    // "/x/...."            --> "x:\...."
  168|       |    // "/server/share/...." --> "\\server\share\...."
  169|       |    // convert escaped slashes to slashes and unescaped slashes to backslashes
  170|       |    i = 0;
  171|       |    if (name->getChar(0) == '/') {
  172|       |      if (name->getLength() >= 2 && name->getChar(1) == '/') {
  173|       |	name->del(0);
  174|       |	i = 0;
  175|       |      } else if (name->getLength() >= 2 &&
  176|       |		 ((name->getChar(1) >= 'a' && name->getChar(1) <= 'z') ||
  177|       |		  (name->getChar(1) >= 'A' && name->getChar(1) <= 'Z')) &&
  178|       |		 (name->getLength() == 2 || name->getChar(2) == '/')) {
  179|       |	name->setChar(0, name->getChar(1));
  180|       |	name->setChar(1, ':');
  181|       |	i = 2;
  182|       |      } else {
  183|       |	for (j = 2; j < name->getLength(); ++j) {
  184|       |	  if (name->getChar(j-1) != '\\' &&
  185|       |	      name->getChar(j) == '/') {
  186|       |	    break;
  187|       |	  }
  188|       |	}
  189|       |	if (j < name->getLength()) {
  190|       |	  name->setChar(0, '\\');
  191|       |	  name->insert(0, '\\');
  192|       |	  i = 2;
  193|       |	}
  194|       |      }
  195|       |    }
  196|       |    for (; i < name->getLength(); ++i) {
  197|       |      if (name->getChar(i) == '/') {
  198|       |	name->setChar(i, '\\');
  199|       |      } else if (name->getChar(i) == '\\' &&
  200|       |		 i+1 < name->getLength() &&
  201|       |		 name->getChar(i+1) == '/') {
  202|       |	name->del(i);
  203|       |      }
  204|       |    }
  205|       |#else
  206|       |    // no manipulation needed for Unix
  207|     18|#endif
  208|     18|  }
  209|       |
  210|    123|  return name;
  211|    123|}
_ZN8LinkDestC2EP5Array:
  217|    326|LinkDest::LinkDest(Array *a) {
  218|    326|  Object obj1, obj2;
  219|       |
  220|       |  // initialize fields
  221|    326|  left = bottom = right = top = zoom = 0;
  222|    326|  ok = gFalse;
  ------------------
  |  |   18|    326|#define gFalse 0
  ------------------
  223|       |
  224|       |  // get page
  225|    326|  if (a->getLength() < 2) {
  ------------------
  |  Branch (225:7): [True: 4, False: 322]
  ------------------
  226|      4|    error(errSyntaxWarning, -1, "Annotation destination array is too short");
  227|      4|    return;
  228|      4|  }
  229|    322|  a->getNF(0, &obj1);
  230|    322|  if (obj1.isInt()) {
  ------------------
  |  Branch (230:7): [True: 6, False: 316]
  ------------------
  231|      6|    pageNum = obj1.getInt() + 1;
  232|      6|    pageIsRef = gFalse;
  ------------------
  |  |   18|      6|#define gFalse 0
  ------------------
  233|    316|  } else if (obj1.isRef()) {
  ------------------
  |  Branch (233:14): [True: 302, False: 14]
  ------------------
  234|    302|    pageRef.num = obj1.getRefNum();
  235|    302|    pageRef.gen = obj1.getRefGen();
  236|    302|    pageIsRef = gTrue;
  ------------------
  |  |   17|    302|#define gTrue 1
  ------------------
  237|    302|  } else {
  238|     14|    error(errSyntaxWarning, -1, "Bad annotation destination");
  239|     14|    goto err2;
  240|     14|  }
  241|    308|  obj1.free();
  242|       |
  243|       |  // get destination type
  244|    308|  a->get(1, &obj1);
  245|       |
  246|       |  // XYZ link
  247|    308|  if (obj1.isName("XYZ")) {
  ------------------
  |  Branch (247:7): [True: 84, False: 224]
  ------------------
  248|     84|    kind = destXYZ;
  249|     84|    if (a->getLength() < 3) {
  ------------------
  |  Branch (249:9): [True: 10, False: 74]
  ------------------
  250|     10|      changeLeft = gFalse;
  ------------------
  |  |   18|     10|#define gFalse 0
  ------------------
  251|     74|    } else {
  252|     74|      a->get(2, &obj2);
  253|     74|      if (obj2.isNull()) {
  ------------------
  |  Branch (253:11): [True: 7, False: 67]
  ------------------
  254|      7|	changeLeft = gFalse;
  ------------------
  |  |   18|      7|#define gFalse 0
  ------------------
  255|     67|      } else if (obj2.isNum()) {
  ------------------
  |  Branch (255:18): [True: 57, False: 10]
  ------------------
  256|     57|	changeLeft = gTrue;
  ------------------
  |  |   17|     57|#define gTrue 1
  ------------------
  257|     57|	left = obj2.getNum();
  258|     57|      } else {
  259|     10|	error(errSyntaxWarning, -1, "Bad annotation destination position");
  260|     10|	goto err1;
  261|     10|      }
  262|     64|      obj2.free();
  263|     64|    }
  264|     74|    if (a->getLength() < 4) {
  ------------------
  |  Branch (264:9): [True: 18, False: 56]
  ------------------
  265|     18|      changeTop = gFalse;
  ------------------
  |  |   18|     18|#define gFalse 0
  ------------------
  266|     56|    } else {
  267|     56|      a->get(3, &obj2);
  268|     56|      if (obj2.isNull()) {
  ------------------
  |  Branch (268:11): [True: 11, False: 45]
  ------------------
  269|     11|	changeTop = gFalse;
  ------------------
  |  |   18|     11|#define gFalse 0
  ------------------
  270|     45|      } else if (obj2.isNum()) {
  ------------------
  |  Branch (270:18): [True: 36, False: 9]
  ------------------
  271|     36|	changeTop = gTrue;
  ------------------
  |  |   17|     36|#define gTrue 1
  ------------------
  272|     36|	top = obj2.getNum();
  273|     36|      } else {
  274|      9|	error(errSyntaxWarning, -1, "Bad annotation destination position");
  275|      9|	goto err1;
  276|      9|      }
  277|     47|      obj2.free();
  278|     47|    }
  279|     65|    if (a->getLength() < 5) {
  ------------------
  |  Branch (279:9): [True: 18, False: 47]
  ------------------
  280|     18|      changeZoom = gFalse;
  ------------------
  |  |   18|     18|#define gFalse 0
  ------------------
  281|     47|    } else {
  282|     47|      a->get(4, &obj2);
  283|     47|      if (obj2.isNull()) {
  ------------------
  |  Branch (283:11): [True: 10, False: 37]
  ------------------
  284|     10|	changeZoom = gFalse;
  ------------------
  |  |   18|     10|#define gFalse 0
  ------------------
  285|     37|      } else if (obj2.isNum()) {
  ------------------
  |  Branch (285:18): [True: 20, False: 17]
  ------------------
  286|     20|	changeZoom = gTrue;
  ------------------
  |  |   17|     20|#define gTrue 1
  ------------------
  287|     20|	zoom = obj2.getNum();
  288|     20|      } else {
  289|     17|	error(errSyntaxWarning, -1, "Bad annotation destination position");
  290|     17|	goto err1;
  291|     17|      }
  292|     30|      obj2.free();
  293|     30|    }
  294|       |
  295|       |  // Fit link
  296|    224|  } else if (obj1.isName("Fit")) {
  ------------------
  |  Branch (296:14): [True: 8, False: 216]
  ------------------
  297|      8|    if (a->getLength() < 2) {
  ------------------
  |  Branch (297:9): [True: 0, False: 8]
  ------------------
  298|      0|      error(errSyntaxWarning, -1, "Annotation destination array is too short");
  299|      0|      goto err2;
  300|      0|    }
  301|      8|    kind = destFit;
  302|       |
  303|       |  // FitH link
  304|    216|  } else if (obj1.isName("FitH")) {
  ------------------
  |  Branch (304:14): [True: 48, False: 168]
  ------------------
  305|     48|    if (a->getLength() < 3) {
  ------------------
  |  Branch (305:9): [True: 10, False: 38]
  ------------------
  306|     10|      error(errSyntaxWarning, -1, "Annotation destination array is too short");
  307|     10|      goto err2;
  308|     10|    }
  309|     38|    kind = destFitH;
  310|     38|    if (a->get(2, &obj2)->isNum()) {
  ------------------
  |  Branch (310:9): [True: 20, False: 18]
  ------------------
  311|     20|      top = obj2.getNum();
  312|     20|      changeTop = gTrue;
  ------------------
  |  |   17|     20|#define gTrue 1
  ------------------
  313|     20|    } else if (obj2.isNull()) {
  ------------------
  |  Branch (313:16): [True: 5, False: 13]
  ------------------
  314|      5|      changeTop = gFalse;
  ------------------
  |  |   18|      5|#define gFalse 0
  ------------------
  315|     13|    } else {
  316|     13|      error(errSyntaxWarning, -1, "Bad annotation destination position");
  317|     13|      kind = destFit;
  318|     13|    }
  319|     38|    obj2.free();
  320|       |
  321|       |  // FitV link
  322|    168|  } else if (obj1.isName("FitV")) {
  ------------------
  |  Branch (322:14): [True: 49, False: 119]
  ------------------
  323|     49|    if (a->getLength() < 3) {
  ------------------
  |  Branch (323:9): [True: 12, False: 37]
  ------------------
  324|     12|      error(errSyntaxWarning, -1, "Annotation destination array is too short");
  325|     12|      goto err2;
  326|     12|    }
  327|     37|    kind = destFitV;
  328|     37|    if (a->get(2, &obj2)->isNum()) {
  ------------------
  |  Branch (328:9): [True: 20, False: 17]
  ------------------
  329|     20|      left = obj2.getNum();
  330|     20|      changeLeft = gTrue;
  ------------------
  |  |   17|     20|#define gTrue 1
  ------------------
  331|     20|    } else if (obj2.isNull()) {
  ------------------
  |  Branch (331:16): [True: 8, False: 9]
  ------------------
  332|      8|      changeLeft = gFalse;
  ------------------
  |  |   18|      8|#define gFalse 0
  ------------------
  333|      9|    } else {
  334|      9|      error(errSyntaxWarning, -1, "Bad annotation destination position");
  335|      9|      kind = destFit;
  336|      9|    }
  337|     37|    obj2.free();
  338|       |
  339|       |  // FitR link
  340|    119|  } else if (obj1.isName("FitR")) {
  ------------------
  |  Branch (340:14): [True: 26, False: 93]
  ------------------
  341|     26|    if (a->getLength() < 6) {
  ------------------
  |  Branch (341:9): [True: 10, False: 16]
  ------------------
  342|     10|      error(errSyntaxWarning, -1, "Annotation destination array is too short");
  343|     10|      goto err2;
  344|     10|    }
  345|     16|    kind = destFitR;
  346|     16|    if (a->get(2, &obj2)->isNum()) {
  ------------------
  |  Branch (346:9): [True: 11, False: 5]
  ------------------
  347|     11|      left = obj2.getNum();
  348|     11|    } else {
  349|      5|      error(errSyntaxWarning, -1, "Bad annotation destination position");
  350|      5|      kind = destFit;
  351|      5|    }
  352|     16|    obj2.free();
  353|     16|    if (!a->get(3, &obj2)->isNum()) {
  ------------------
  |  Branch (353:9): [True: 7, False: 9]
  ------------------
  354|      7|      error(errSyntaxWarning, -1, "Bad annotation destination position");
  355|      7|      kind = destFit;
  356|      7|    }
  357|     16|    bottom = obj2.getNum();
  358|     16|    obj2.free();
  359|     16|    if (!a->get(4, &obj2)->isNum()) {
  ------------------
  |  Branch (359:9): [True: 9, False: 7]
  ------------------
  360|      9|      error(errSyntaxWarning, -1, "Bad annotation destination position");
  361|      9|      kind = destFit;
  362|      9|    }
  363|     16|    right = obj2.getNum();
  364|     16|    obj2.free();
  365|     16|    if (!a->get(5, &obj2)->isNum()) {
  ------------------
  |  Branch (365:9): [True: 11, False: 5]
  ------------------
  366|     11|      error(errSyntaxWarning, -1, "Bad annotation destination position");
  367|     11|      kind = destFit;
  368|     11|    }
  369|     16|    top = obj2.getNum();
  370|     16|    obj2.free();
  371|       |
  372|       |  // FitB link
  373|     93|  } else if (obj1.isName("FitB")) {
  ------------------
  |  Branch (373:14): [True: 6, False: 87]
  ------------------
  374|      6|    if (a->getLength() < 2) {
  ------------------
  |  Branch (374:9): [True: 0, False: 6]
  ------------------
  375|      0|      error(errSyntaxWarning, -1, "Annotation destination array is too short");
  376|      0|      goto err2;
  377|      0|    }
  378|      6|    kind = destFitB;
  379|       |
  380|       |  // FitBH link
  381|     87|  } else if (obj1.isName("FitBH")) {
  ------------------
  |  Branch (381:14): [True: 24, False: 63]
  ------------------
  382|     24|    if (a->getLength() < 3) {
  ------------------
  |  Branch (382:9): [True: 0, False: 24]
  ------------------
  383|      0|      error(errSyntaxWarning, -1, "Annotation destination array is too short");
  384|      0|      goto err2;
  385|      0|    }
  386|     24|    kind = destFitBH;
  387|     24|    if (a->get(2, &obj2)->isNum()) {
  ------------------
  |  Branch (387:9): [True: 14, False: 10]
  ------------------
  388|     14|      top = obj2.getNum();
  389|     14|      changeTop = gTrue;
  ------------------
  |  |   17|     14|#define gTrue 1
  ------------------
  390|     14|    } else if (obj2.isNull()) {
  ------------------
  |  Branch (390:16): [True: 4, False: 6]
  ------------------
  391|      4|      changeTop = gFalse;
  ------------------
  |  |   18|      4|#define gFalse 0
  ------------------
  392|      6|    } else {
  393|      6|      error(errSyntaxWarning, -1, "Bad annotation destination position");
  394|      6|      kind = destFit;
  395|      6|    }
  396|     24|    obj2.free();
  397|       |
  398|       |  // FitBV link
  399|     63|  } else if (obj1.isName("FitBV")) {
  ------------------
  |  Branch (399:14): [True: 42, False: 21]
  ------------------
  400|     42|    if (a->getLength() < 3) {
  ------------------
  |  Branch (400:9): [True: 4, False: 38]
  ------------------
  401|      4|      error(errSyntaxWarning, -1, "Annotation destination array is too short");
  402|      4|      goto err2;
  403|      4|    }
  404|     38|    kind = destFitBV;
  405|     38|    if (a->get(2, &obj2)->isNum()) {
  ------------------
  |  Branch (405:9): [True: 17, False: 21]
  ------------------
  406|     17|      left = obj2.getNum();
  407|     17|      changeLeft = gTrue;
  ------------------
  |  |   17|     17|#define gTrue 1
  ------------------
  408|     21|    } else if (obj2.isNull()) {
  ------------------
  |  Branch (408:16): [True: 9, False: 12]
  ------------------
  409|      9|      changeLeft = gFalse;
  ------------------
  |  |   18|      9|#define gFalse 0
  ------------------
  410|     12|    } else {
  411|     12|      error(errSyntaxWarning, -1, "Bad annotation destination position");
  412|     12|      kind = destFit;
  413|     12|    }
  414|     38|    obj2.free();
  415|       |
  416|       |  // unknown link kind
  417|     38|  } else {
  418|     21|    error(errSyntaxWarning, -1, "Unknown annotation destination type");
  419|     21|    goto err2;
  420|     21|  }
  421|       |
  422|    215|  obj1.free();
  423|    215|  ok = gTrue;
  ------------------
  |  |   17|    215|#define gTrue 1
  ------------------
  424|    215|  return;
  425|       |
  426|     36| err1:
  427|     36|  obj2.free();
  428|    107| err2:
  429|    107|  obj1.free();
  430|    107|}
_ZN8LinkGoToC2EP6Object:
  454|    349|LinkGoTo::LinkGoTo(Object *destObj) {
  455|    349|  dest = NULL;
  456|    349|  namedDest = NULL;
  457|       |
  458|       |  // named destination
  459|    349|  if (destObj->isName()) {
  ------------------
  |  Branch (459:7): [True: 11, False: 338]
  ------------------
  460|     11|    namedDest = new GString(destObj->getName());
  461|    338|  } else if (destObj->isString()) {
  ------------------
  |  Branch (461:14): [True: 8, False: 330]
  ------------------
  462|      8|    namedDest = destObj->getString()->copy();
  463|       |
  464|       |  // destination dictionary
  465|    330|  } else if (destObj->isArray()) {
  ------------------
  |  Branch (465:14): [True: 309, False: 21]
  ------------------
  466|    309|    dest = new LinkDest(destObj->getArray());
  467|    309|    if (!dest->isOk()) {
  ------------------
  |  Branch (467:9): [True: 100, False: 209]
  ------------------
  468|    100|      delete dest;
  469|    100|      dest = NULL;
  470|    100|    }
  471|       |
  472|       |  // error
  473|    309|  } else {
  474|     21|    error(errSyntaxWarning, -1, "Illegal annotation destination");
  475|     21|  }
  476|    349|}
_ZN8LinkGoToD2Ev:
  478|    349|LinkGoTo::~LinkGoTo() {
  479|    349|  if (dest)
  ------------------
  |  Branch (479:7): [True: 209, False: 140]
  ------------------
  480|    209|    delete dest;
  481|    349|  if (namedDest)
  ------------------
  |  Branch (481:7): [True: 19, False: 330]
  ------------------
  482|     19|    delete namedDest;
  483|    349|}
_ZN9LinkGoToRC2EP6ObjectS1_:
  489|    123|LinkGoToR::LinkGoToR(Object *fileSpecObj, Object *destObj) {
  490|    123|  dest = NULL;
  491|    123|  namedDest = NULL;
  492|       |
  493|       |  // get file name
  494|    123|  fileName = getFileSpecName(fileSpecObj);
  495|       |
  496|       |  // named destination
  497|    123|  if (destObj->isName()) {
  ------------------
  |  Branch (497:7): [True: 6, False: 117]
  ------------------
  498|      6|    namedDest = new GString(destObj->getName());
  499|    117|  } else if (destObj->isString()) {
  ------------------
  |  Branch (499:14): [True: 6, False: 111]
  ------------------
  500|      6|    namedDest = destObj->getString()->copy();
  501|       |
  502|       |  // destination dictionary
  503|    111|  } else if (destObj->isArray()) {
  ------------------
  |  Branch (503:14): [True: 17, False: 94]
  ------------------
  504|     17|    dest = new LinkDest(destObj->getArray());
  505|     17|    if (!dest->isOk()) {
  ------------------
  |  Branch (505:9): [True: 11, False: 6]
  ------------------
  506|     11|      delete dest;
  507|     11|      dest = NULL;
  508|     11|    }
  509|       |
  510|       |  // error
  511|     94|  } else {
  512|     94|    error(errSyntaxWarning, -1, "Illegal annotation destination");
  513|     94|  }
  514|    123|}
_ZN9LinkGoToRD2Ev:
  516|    123|LinkGoToR::~LinkGoToR() {
  517|    123|  if (fileName)
  ------------------
  |  Branch (517:7): [True: 18, False: 105]
  ------------------
  518|     18|    delete fileName;
  519|    123|  if (dest)
  ------------------
  |  Branch (519:7): [True: 6, False: 117]
  ------------------
  520|      6|    delete dest;
  521|    123|  if (namedDest)
  ------------------
  |  Branch (521:7): [True: 12, False: 111]
  ------------------
  522|     12|    delete namedDest;
  523|    123|}
_ZN7LinkURIC2EP6ObjectP7GString:
  584|     54|LinkURI::LinkURI(Object *uriObj, GString *baseURI) {
  585|     54|  GString *uri2;
  586|     54|  int n;
  587|     54|  char c;
  588|       |
  589|     54|  uri = NULL;
  590|     54|  if (uriObj->isString()) {
  ------------------
  |  Branch (590:7): [True: 44, False: 10]
  ------------------
  591|     44|    uri2 = uriObj->getString();
  592|     44|    n = (int)strcspn(uri2->getCString(), "/:");
  593|     44|    if (n < uri2->getLength() && uri2->getChar(n) == ':') {
  ------------------
  |  Branch (593:9): [True: 24, False: 20]
  |  Branch (593:34): [True: 10, False: 14]
  ------------------
  594|       |      // "http:..." etc.
  595|     10|      uri = uri2->copy();
  596|     34|    } else if (!uri2->cmpN("www.", 4)) {
  ------------------
  |  Branch (596:16): [True: 0, False: 34]
  ------------------
  597|       |      // "www.[...]" without the leading "http://"
  598|      0|      uri = new GString("http://");
  599|      0|      uri->append(uri2);
  600|     34|    } else {
  601|       |      // relative URI
  602|     34|      if (baseURI) {
  ------------------
  |  Branch (602:11): [True: 0, False: 34]
  ------------------
  603|      0|	uri = baseURI->copy();
  604|      0|	c = uri->getChar(uri->getLength() - 1);
  605|      0|	if (c != '/' && c != '?') {
  ------------------
  |  Branch (605:6): [True: 0, False: 0]
  |  Branch (605:18): [True: 0, False: 0]
  ------------------
  606|      0|	  uri->append('/');
  607|      0|	}
  608|      0|	if (uri2->getChar(0) == '/') {
  ------------------
  |  Branch (608:6): [True: 0, False: 0]
  ------------------
  609|      0|	  uri->append(uri2->getCString() + 1, uri2->getLength() - 1);
  610|      0|	} else {
  611|      0|	  uri->append(uri2);
  612|      0|	}
  613|     34|      } else {
  614|     34|	uri = uri2->copy();
  615|     34|      }
  616|     34|    }
  617|     44|  } else {
  618|     10|    error(errSyntaxWarning, -1, "Illegal URI-type link");
  619|     10|  }
  620|     54|}
_ZN7LinkURID2Ev:
  622|     54|LinkURI::~LinkURI() {
  623|     54|  if (uri)
  ------------------
  |  Branch (623:7): [True: 44, False: 10]
  ------------------
  624|     44|    delete uri;
  625|     54|}
_ZN14LinkJavaScriptC2EP6Object:
  671|     48|LinkJavaScript::LinkJavaScript(Object *jsObj) {
  672|     48|  char buf[4096];
  673|     48|  int n;
  674|       |
  675|     48|  if (jsObj->isString()) {
  ------------------
  |  Branch (675:7): [True: 6, False: 42]
  ------------------
  676|      6|    js = jsObj->getString()->copy();
  677|     42|  } else if (jsObj->isStream()) {
  ------------------
  |  Branch (677:14): [True: 30, False: 12]
  ------------------
  678|     30|    js = new GString();
  679|     30|    jsObj->streamReset();
  680|    137|    while ((n = jsObj->getStream()->getBlock(buf, sizeof(buf))) > 0) {
  ------------------
  |  Branch (680:12): [True: 107, False: 30]
  ------------------
  681|    107|      js->append(buf, n);
  682|    107|    }
  683|     30|    jsObj->streamClose();
  684|     30|  } else {
  685|     12|    error(errSyntaxError, -1, "JavaScript action JS key is wrong type");
  686|       |    js = NULL;
  687|     12|  }
  688|     48|}
_ZN14LinkJavaScriptD2Ev:
  690|     48|LinkJavaScript::~LinkJavaScript() {
  691|     48|  if (js) {
  ------------------
  |  Branch (691:7): [True: 36, False: 12]
  ------------------
  692|     36|    delete js;
  693|     36|  }
  694|     48|}
_ZN11LinkUnknownC2EPc:
  763|     52|LinkUnknown::LinkUnknown(char *actionA) {
  764|     52|  action = new GString(actionA);
  765|     52|}
_ZN11LinkUnknownD2Ev:
  767|     52|LinkUnknown::~LinkUnknown() {
  768|     52|  delete action;
  769|     52|}

_ZN10LinkActionD2Ev:
   41|    626|  virtual ~LinkAction() {}
_ZN8LinkDest4isOkEv:
   85|    326|  GBool isOk() { return ok; }
_ZN8LinkGoTo4isOkEv:
  135|    349|  virtual GBool isOk() { return dest || namedDest; }
  ------------------
  |  Branch (135:33): [True: 209, False: 140]
  |  Branch (135:41): [True: 19, False: 121]
  ------------------
_ZN9LinkGoToR4isOkEv:
  165|    123|  virtual GBool isOk() { return fileName && (dest || namedDest); }
  ------------------
  |  Branch (165:33): [True: 18, False: 105]
  |  Branch (165:46): [True: 6, False: 12]
  |  Branch (165:54): [True: 2, False: 10]
  ------------------
_ZN7LinkURI4isOkEv:
  223|     54|  virtual GBool isOk() { return uri != NULL; }
_ZN14LinkJavaScript4isOkEv:
  296|     48|  virtual GBool isOk() { return js != NULL; }
_ZN11LinkUnknown4isOkEv:
  373|     52|  virtual GBool isOk() { return action != NULL; }

_ZN14NameToCharCodeC2Ev:
   25|  9.40k|NameToCharCode::NameToCharCode() {
   26|  9.40k|  int i;
   27|       |
   28|  9.40k|  size = 31;
   29|  9.40k|  len = 0;
   30|  9.40k|  tab = (NameToCharCodeEntry *)gmallocn(size, sizeof(NameToCharCodeEntry));
   31|   301k|  for (i = 0; i < size; ++i) {
  ------------------
  |  Branch (31:15): [True: 291k, False: 9.40k]
  ------------------
   32|       |    tab[i].name = NULL;
   33|   291k|  }
   34|  9.40k|}
_ZN14NameToCharCodeD2Ev:
   36|  9.40k|NameToCharCode::~NameToCharCode() {
   37|  9.40k|  int i;
   38|       |
   39|  79.4M|  for (i = 0; i < size; ++i) {
  ------------------
  |  Branch (39:15): [True: 79.4M, False: 9.40k]
  ------------------
   40|  79.4M|    if (tab[i].name) {
  ------------------
  |  Branch (40:9): [True: 21.0M, False: 58.4M]
  ------------------
   41|  21.0M|      gfree(tab[i].name);
   42|  21.0M|    }
   43|  79.4M|  }
   44|  9.40k|  gfree(tab);
   45|  9.40k|}
_ZN14NameToCharCode3addEPKcj:
   47|  21.0M|void NameToCharCode::add(const char *name, CharCode c) {
   48|  21.0M|  NameToCharCodeEntry *oldTab;
   49|  21.0M|  int h, i, oldSize;
   50|       |
   51|       |  // expand the table if necessary
   52|  21.0M|  if (len >= size / 2) {
  ------------------
  |  Branch (52:7): [True: 61.1k, False: 20.9M]
  ------------------
   53|  61.1k|    oldSize = size;
   54|  61.1k|    oldTab = tab;
   55|  61.1k|    size = 2*size + 1;
   56|  61.1k|    tab = (NameToCharCodeEntry *)gmallocn(size, sizeof(NameToCharCodeEntry));
   57|   158M|    for (h = 0; h < size; ++h) {
  ------------------
  |  Branch (57:17): [True: 158M, False: 61.1k]
  ------------------
   58|   158M|      tab[h].name = NULL;
   59|   158M|    }
   60|  79.1M|    for (i = 0; i < oldSize; ++i) {
  ------------------
  |  Branch (60:17): [True: 79.1M, False: 61.1k]
  ------------------
   61|  79.1M|      if (oldTab[i].name) {
  ------------------
  |  Branch (61:11): [True: 39.5M, False: 39.5M]
  ------------------
   62|  39.5M|	h = hash(oldTab[i].name);
   63|  57.7M|	while (tab[h].name) {
  ------------------
  |  Branch (63:9): [True: 18.2M, False: 39.5M]
  ------------------
   64|  18.2M|	  if (++h == size) {
  ------------------
  |  Branch (64:8): [True: 0, False: 18.2M]
  ------------------
   65|      0|	    h = 0;
   66|      0|	  }
   67|  18.2M|	}
   68|  39.5M|	tab[h] = oldTab[i];
   69|  39.5M|      }
   70|  79.1M|    }
   71|  61.1k|    gfree(oldTab);
   72|  61.1k|  }
   73|       |
   74|       |  // add the new name
   75|  21.0M|  h = hash(name);
   76|  87.3M|  while (tab[h].name && strcmp(tab[h].name, name)) {
  ------------------
  |  Branch (76:10): [True: 66.2M, False: 21.0M]
  |  Branch (76:25): [True: 66.2M, False: 4.70k]
  ------------------
   77|  66.2M|    if (++h == size) {
  ------------------
  |  Branch (77:9): [True: 14.1k, False: 66.2M]
  ------------------
   78|  14.1k|      h = 0;
   79|  14.1k|    }
   80|  66.2M|  }
   81|  21.0M|  if (!tab[h].name) {
  ------------------
  |  Branch (81:7): [True: 21.0M, False: 4.70k]
  ------------------
   82|  21.0M|    tab[h].name = copyString(name);
   83|  21.0M|  }
   84|  21.0M|  tab[h].c = c;
   85|       |
   86|  21.0M|  ++len;
   87|  21.0M|}
_ZN14NameToCharCode4hashEPKc:
  104|  60.5M|int NameToCharCode::hash(const char *name) {
  105|  60.5M|  const char *p;
  106|  60.5M|  unsigned int h;
  107|       |
  108|  60.5M|  h = 0;
  109|   711M|  for (p = name; *p; ++p) {
  ------------------
  |  Branch (109:18): [True: 651M, False: 60.5M]
  ------------------
  110|   651M|    h = 17 * h + (int)(*p & 0xff);
  111|   651M|  }
  112|  60.5M|  return (int)(h % size);
  113|  60.5M|}

_ZN6Object9initArrayEP4XRef:
   51|   677k|Object *Object::initArray(XRef *xref) {
   52|   677k|  initObj(objArray);
  ------------------
  |  |   77|   677k|#define initObj(t) type = t
  ------------------
   53|   677k|  array = new Array(xref);
   54|   677k|  return this;
   55|   677k|}
_ZN6Object8initDictEP4XRef:
   57|   634k|Object *Object::initDict(XRef *xref) {
   58|   634k|  initObj(objDict);
  ------------------
  |  |   77|   634k|#define initObj(t) type = t
  ------------------
   59|   634k|  dict = new Dict(xref);
   60|   634k|  return this;
   61|   634k|}
_ZN6Object8initDictEP4Dict:
   63|  4.60k|Object *Object::initDict(Dict *dictA) {
   64|  4.60k|  initObj(objDict);
  ------------------
  |  |   77|  4.60k|#define initObj(t) type = t
  ------------------
   65|  4.60k|  dict = dictA;
   66|  4.60k|  dict->incRef();
   67|  4.60k|  return this;
   68|  4.60k|}
_ZN6Object10initStreamEP6Stream:
   70|   458k|Object *Object::initStream(Stream *streamA) {
   71|   458k|  initObj(objStream);
  ------------------
  |  |   77|   458k|#define initObj(t) type = t
  ------------------
   72|   458k|  stream = streamA;
   73|   458k|  return this;
   74|   458k|}
_ZN6Object4copyEPS_:
   76|   132M|Object *Object::copy(Object *obj) {
   77|   132M|  *obj = *this;
   78|   132M|  switch (type) {
   79|   613k|  case objString:
  ------------------
  |  Branch (79:3): [True: 613k, False: 132M]
  ------------------
   80|   613k|    obj->string = string->copy();
   81|   613k|    break;
   82|  4.88M|  case objName:
  ------------------
  |  Branch (82:3): [True: 4.88M, False: 127M]
  ------------------
   83|  4.88M|    obj->name = copyString(name);
   84|  4.88M|    break;
   85|   533k|  case objArray:
  ------------------
  |  Branch (85:3): [True: 533k, False: 132M]
  ------------------
   86|   533k|    array->incRef();
   87|   533k|    break;
   88|  1.62M|  case objDict:
  ------------------
  |  Branch (88:3): [True: 1.62M, False: 131M]
  ------------------
   89|  1.62M|    dict->incRef();
   90|  1.62M|    break;
   91|   811k|  case objStream:
  ------------------
  |  Branch (91:3): [True: 811k, False: 131M]
  ------------------
   92|   811k|    obj->stream = stream->copy();
   93|   811k|    break;
   94|  17.6M|  case objCmd:
  ------------------
  |  Branch (94:3): [True: 17.6M, False: 115M]
  ------------------
   95|  17.6M|    obj->cmd = copyString(cmd);
   96|  17.6M|    break;
   97|   106M|  default:
  ------------------
  |  Branch (97:3): [True: 106M, False: 26.1M]
  ------------------
   98|   106M|    break;
   99|   132M|  }
  100|       |#ifdef DEBUG_OBJECT_MEM
  101|       |#if MULTITHREADED
  102|       |  gAtomicIncrement(&numAlloc[type]);
  103|       |#else
  104|       |  ++numAlloc[type];
  105|       |#endif
  106|       |#endif
  107|   132M|  return obj;
  108|   132M|}
_ZN6Object5fetchEP4XRefPS_i:
  110|  2.93M|Object *Object::fetch(XRef *xref, Object *obj, int recursion) {
  111|  2.93M|  return (type == objRef && xref) ?
  ------------------
  |  Branch (111:11): [True: 1.52M, False: 1.41M]
  |  Branch (111:29): [True: 1.52M, False: 3]
  ------------------
  112|  1.52M|         xref->fetch(ref.num, ref.gen, obj, recursion) : copy(obj);
  113|  2.93M|}
_ZN6Object4freeEv:
  115|   285M|void Object::free() {
  116|   285M|  switch (type) {
  117|  1.52M|  case objString:
  ------------------
  |  Branch (117:3): [True: 1.52M, False: 283M]
  ------------------
  118|  1.52M|    delete string;
  119|  1.52M|    break;
  120|  11.3M|  case objName:
  ------------------
  |  Branch (120:3): [True: 11.3M, False: 273M]
  ------------------
  121|  11.3M|    gfree(name);
  122|  11.3M|    break;
  123|  1.13M|  case objArray:
  ------------------
  |  Branch (123:3): [True: 1.13M, False: 283M]
  ------------------
  124|  1.13M|    if (!array->decRef()) {
  ------------------
  |  Branch (124:9): [True: 599k, False: 533k]
  ------------------
  125|   599k|      delete array;
  126|   599k|    }
  127|  1.13M|    break;
  128|  2.12M|  case objDict:
  ------------------
  |  Branch (128:3): [True: 2.12M, False: 282M]
  ------------------
  129|  2.12M|    if (!dict->decRef()) {
  ------------------
  |  Branch (129:9): [True: 497k, False: 1.62M]
  ------------------
  130|   497k|      delete dict;
  131|   497k|    }
  132|  2.12M|    break;
  133|  1.24M|  case objStream:
  ------------------
  |  Branch (133:3): [True: 1.24M, False: 283M]
  ------------------
  134|  1.24M|    delete stream;
  135|  1.24M|    break;
  136|  45.0M|  case objCmd:
  ------------------
  |  Branch (136:3): [True: 45.0M, False: 240M]
  ------------------
  137|  45.0M|    gfree(cmd);
  138|  45.0M|    break;
  139|   222M|  default:
  ------------------
  |  Branch (139:3): [True: 222M, False: 62.4M]
  ------------------
  140|   222M|    break;
  141|   285M|  }
  142|       |#ifdef DEBUG_OBJECT_MEM
  143|       |#if MULTITHREADED
  144|       |  gAtomicDecrement(&numAlloc[type]);
  145|       |#else
  146|       |  --numAlloc[type];
  147|       |#endif
  148|       |#endif
  149|   285M|  type = objNone;
  150|   285M|}
_ZN6Object11getTypeNameEv:
  152|   624k|const char *Object::getTypeName() {
  153|   624k|  return objTypeNames[type];
  154|   624k|}

_ZN6ObjectC2Ev:
   85|   363M|    type(objNone) {}
_ZN6Object8initNullEv:
   99|  59.6M|    { initObj(objNull); return this; }
  ------------------
  |  |   77|  59.6M|#define initObj(t) type = t
  ------------------
_ZN6Object8isStreamEv:
  134|  54.9M|  GBool isStream() { return type == objStream; }
_ZN6Object9getStreamEv:
  158|   696k|  Stream *getStream() { return stream; }
_ZN6Object8initBoolEi:
   89|  70.9k|    { initObj(objBool); booln = boolnA; return this; }
  ------------------
  |  |   77|  70.9k|#define initObj(t) type = t
  ------------------
_ZN6Object7initIntEi:
   91|  11.2M|    { initObj(objInt); intg = intgA; return this; }
  ------------------
  |  |   77|  11.2M|#define initObj(t) type = t
  ------------------
_ZN6Object8initRealEd:
   93|   619k|    { initObj(objReal); real = realA; return this; }
  ------------------
  |  |   77|   619k|#define initObj(t) type = t
  ------------------
_ZN6Object10initStringEP7GString:
   95|   976k|    { initObj(objString); string = stringA; return this; }
  ------------------
  |  |   77|   976k|#define initObj(t) type = t
  ------------------
_ZN6Object8initNameEPKc:
   97|  6.76M|    { initObj(objName); name = copyString(nameA); return this; }
  ------------------
  |  |   77|  6.76M|#define initObj(t) type = t
  ------------------
_ZN6Object7initRefEii:
  105|   777k|    { initObj(objRef); ref.num = numA; ref.gen = genA; return this; }
  ------------------
  |  |   77|   777k|#define initObj(t) type = t
  ------------------
_ZN6Object7initCmdEPc:
  107|  27.7M|    { initObj(objCmd); cmd = copyString(cmdA); return this; }
  ------------------
  |  |   77|  27.7M|#define initObj(t) type = t
  ------------------
_ZN6Object9initErrorEv:
  109|  2.14M|    { initObj(objError); return this; }
  ------------------
  |  |   77|  2.14M|#define initObj(t) type = t
  ------------------
_ZN6Object7initEOFEv:
  111|  96.4M|    { initObj(objEOF); return this; }
  ------------------
  |  |   77|  96.4M|#define initObj(t) type = t
  ------------------
_ZN6Object6isBoolEv:
  125|  10.5k|  GBool isBool() { return type == objBool; }
_ZN6Object5isIntEv:
  126|   177M|  GBool isInt() { return type == objInt; }
_ZN6Object5isNumEv:
  128|   159k|  GBool isNum() { return type == objInt || type == objReal; }
  ------------------
  |  Branch (128:26): [True: 613, False: 159k]
  |  Branch (128:44): [True: 7.32k, False: 151k]
  ------------------
_ZN6Object8isStringEv:
  129|   116M|  GBool isString() { return type == objString; }
_ZN6Object6isNameEv:
  130|  16.1M|  GBool isName() { return type == objName; }
_ZN6Object6isNullEv:
  131|   535k|  GBool isNull() { return type == objNull; }
_ZN6Object7isArrayEv:
  132|  1.88M|  GBool isArray() { return type == objArray; }
_ZN6Object6isDictEv:
  133|  2.08M|  GBool isDict() { return type == objDict; }
_ZN6Object5isRefEv:
  135|  12.5M|  GBool isRef() { return type == objRef; }
_ZN6Object7isErrorEv:
  137|  2.78M|  GBool isError() { return type == objError; }
_ZN6Object5isEOFEv:
  138|  40.8M|  GBool isEOF() { return type == objEOF; }
_ZN6Object6isNoneEv:
  139|  1.47G|  GBool isNone() { return type == objNone; }
_ZN6Object6isNameEPKc:
  143|   722k|    { return type == objName && !strcmp(name, nameA); }
  ------------------
  |  Branch (143:14): [True: 555k, False: 167k]
  |  Branch (143:33): [True: 271k, False: 283k]
  ------------------
_ZN6Object5isCmdEPKc:
  147|   202M|    { return type == objCmd && !strcmp(cmd, cmdA); }
  ------------------
  |  Branch (147:14): [True: 61.7M, False: 140M]
  |  Branch (147:32): [True: 3.31M, False: 58.4M]
  ------------------
_ZN6Object7getBoolEv:
  150|  1.18k|  GBool getBool() { return booln; }
_ZN6Object6getIntEv:
  151|  6.47M|  int getInt() { return intg; }
_ZN6Object6getNumEv:
  153|  7.96k|  double getNum() { return type == objInt ? (double)intg : real; }
  ------------------
  |  Branch (153:28): [True: 613, False: 7.35k]
  ------------------
_ZN6Object9getStringEv:
  154|  67.2k|  GString *getString() { return string; }
_ZN6Object7getNameEv:
  155|  2.86M|  char *getName() { return name; }
_ZN6Object8getArrayEv:
  156|    326|  Array *getArray() { return array; }
_ZN6Object7getDictEv:
  157|   926k|  Dict *getDict() { return dict; }
_ZN6Object6getRefEv:
  159|  73.2k|  Ref getRef() { return ref; }
_ZN6Object9getRefNumEv:
  160|  2.40M|  int getRefNum() { return ref.num; }
_ZN6Object9getRefGenEv:
  161|  1.46M|  int getRefGen() { return ref.gen; }
_ZN6Object14arrayGetLengthEv:
  233|  11.5M|  { return array->getLength(); }
_ZN6Object8arrayAddEPS_:
  236|  20.3M|  { array->add(elem); }
_ZN6Object8arrayGetEiPS_i:
  239|  76.2k|  { return array->get(i, obj, recursion); }
_ZN6Object10arrayGetNFEiPS_:
  242|  11.1M|  { return array->getNF(i, obj); }
_ZN6Object7dictAddEPcPS_:
  254|  2.75M|  { dict->add(key, val); }
_ZN6Object10dictLookupEPKcPS_i:
  263|   941k|  { return dict->lookup(key, obj, recursion); }
_ZN6Object12dictLookupNFEPKcPS_:
  266|  58.0k|  { return dict->lookupNF(key, obj); }
_ZN6Object11streamResetEv:
  290|   378k|  { stream->reset(); }
_ZN6Object11streamCloseEv:
  293|   372k|  { stream->close(); }
_ZN6Object13streamGetCharEv:
  296|  1.06G|  { return stream->getChar(); }
_ZN6Object14streamLookCharEv:
  299|   264M|  { return stream->lookChar(); }
_ZN6Object12streamGetPosEv:
  308|  49.8M|  { return stream->getPos(); }
_ZN6Object12streamSetPosEli:
  311|  86.5k|  { stream->setPos(pos, dir); }
_ZN6Object13streamGetDictEv:
  314|   601k|  { return stream->getDict(); }

_ZN15OptionalContentC2EP6PDFDoc:
   39|  2.33k|OptionalContent::OptionalContent(PDFDoc *doc) {
   40|  2.33k|  Object *ocProps;
   41|  2.33k|  Object ocgList, defView, uad, obj1, obj2, obj3, obj4;
   42|  2.33k|  Ref ref1;
   43|  2.33k|  OptionalContentGroup *ocg;
   44|  2.33k|  int i, j;
   45|       |
   46|  2.33k|  xref = doc->getXRef();
   47|  2.33k|  ocgs = new GList();
   48|  2.33k|  display = NULL;
   49|       |
   50|  2.33k|  if ((ocProps = doc->getCatalog()->getOCProperties())->isDict()) {
  ------------------
  |  Branch (50:7): [True: 332, False: 2.00k]
  ------------------
   51|    332|    if (ocProps->dictLookup("OCGs", &ocgList)->isArray()) {
  ------------------
  |  Branch (51:9): [True: 312, False: 20]
  ------------------
   52|       |
   53|       |      //----- read the OCG list
   54|  23.7k|      for (i = 0; i < ocgList.arrayGetLength(); ++i) {
  ------------------
  |  Branch (54:19): [True: 23.4k, False: 312]
  ------------------
   55|  23.4k|	if (ocgList.arrayGetNF(i, &obj1)->isRef()) {
  ------------------
  |  Branch (55:6): [True: 5.16k, False: 18.3k]
  ------------------
   56|  5.16k|	  ref1 = obj1.getRef();
   57|  5.16k|	  obj1.fetch(xref, &obj2);
   58|  5.16k|	  if ((ocg = OptionalContentGroup::parse(&ref1, &obj2))) {
  ------------------
  |  Branch (58:8): [True: 2.71k, False: 2.45k]
  ------------------
   59|  2.71k|	    ocgs->append(ocg);
   60|  2.71k|	  }
   61|  5.16k|	  obj2.free();
   62|  5.16k|	}
   63|  23.4k|	obj1.free();
   64|  23.4k|      }
   65|       |
   66|       |      //----- read the default viewing OCCD
   67|    312|      if (ocProps->dictLookup("D", &defView)->isDict()) {
  ------------------
  |  Branch (67:11): [True: 210, False: 102]
  ------------------
   68|       |
   69|       |	//----- read the usage app dicts
   70|    210|	if (defView.dictLookup("AS", &obj1)->isArray()) {
  ------------------
  |  Branch (70:6): [True: 22, False: 188]
  ------------------
   71|  2.37k|	  for (i = 0; i < obj1.arrayGetLength(); ++i) {
  ------------------
  |  Branch (71:16): [True: 2.35k, False: 22]
  ------------------
   72|  2.35k|	    if (obj1.arrayGet(i, &uad)->isDict()) {
  ------------------
  |  Branch (72:10): [True: 123, False: 2.23k]
  ------------------
   73|    123|	      if (uad.dictLookup("Event", &obj2)->isName("View")) {
  ------------------
  |  Branch (73:12): [True: 12, False: 111]
  ------------------
   74|     12|		if (uad.dictLookup("OCGs", &obj3)->isArray()) {
  ------------------
  |  Branch (74:7): [True: 11, False: 1]
  ------------------
   75|    141|		  for (j = 0; j < obj3.arrayGetLength(); ++j) {
  ------------------
  |  Branch (75:17): [True: 130, False: 11]
  ------------------
   76|    130|		    if (obj3.arrayGetNF(j, &obj4)->isRef()) {
  ------------------
  |  Branch (76:11): [True: 24, False: 106]
  ------------------
   77|     24|		      ref1 = obj4.getRef();
   78|     24|		      if ((ocg = findOCG(&ref1))) {
  ------------------
  |  Branch (78:13): [True: 8, False: 16]
  ------------------
   79|      8|			ocg->setInViewUsageAppDict();
   80|      8|		      }
   81|     24|		    }
   82|    130|		    obj4.free();
   83|    130|		  }
   84|     11|		}
   85|     12|		obj3.free();
   86|     12|	      }
   87|    123|	      obj2.free();
   88|    123|	    }
   89|  2.35k|	    uad.free();
   90|  2.35k|	  }
   91|     22|	}
   92|    210|	obj1.free();
   93|       |
   94|       |	//----- initial state from OCCD
   95|    210|	if (defView.dictLookup("OFF", &obj1)->isArray()) {
  ------------------
  |  Branch (95:6): [True: 31, False: 179]
  ------------------
   96|  3.91k|	  for (i = 0; i < obj1.arrayGetLength(); ++i) {
  ------------------
  |  Branch (96:16): [True: 3.87k, False: 31]
  ------------------
   97|  3.87k|	    if (obj1.arrayGetNF(i, &obj2)->isRef()) {
  ------------------
  |  Branch (97:10): [True: 1.57k, False: 2.30k]
  ------------------
   98|  1.57k|	      ref1 = obj2.getRef();
   99|  1.57k|	      if ((ocg = findOCG(&ref1))) {
  ------------------
  |  Branch (99:12): [True: 403, False: 1.17k]
  ------------------
  100|    403|		ocg->setState(gFalse);
  ------------------
  |  |   18|    403|#define gFalse 0
  ------------------
  101|  1.17k|	      } else {
  102|  1.17k|		error(errSyntaxError, -1,
  103|  1.17k|		      "Invalid OCG reference in OFF array in default viewing OCCD");
  104|  1.17k|	      }
  105|  1.57k|	    }
  106|  3.87k|	    obj2.free();
  107|  3.87k|	  }
  108|     31|	}
  109|    210|	obj1.free();
  110|       |
  111|       |	//----- initial state from OCG usage dict
  112|    736|	for (i = 0; i < ocgs->getLength(); ++i) {
  ------------------
  |  Branch (112:14): [True: 526, False: 210]
  ------------------
  113|    526|	  ocg = (OptionalContentGroup *)ocgs->get(i);
  114|    526|	  if (ocg->getInViewUsageAppDict() &&
  ------------------
  |  Branch (114:8): [True: 8, False: 518]
  ------------------
  115|      8|	      ocg->getViewState() != ocUsageUnset) {
  ------------------
  |  Branch (115:8): [True: 0, False: 8]
  ------------------
  116|      0|	    ocg->setState(ocg->getViewState() == ocUsageOn);
  117|      0|	  }
  118|    526|	}
  119|       |
  120|       |	//----- display order
  121|    210|	if (defView.dictLookup("Order", &obj1)->isArray()) {
  ------------------
  |  Branch (121:6): [True: 159, False: 51]
  ------------------
  122|    159|	  display = OCDisplayNode::parse(&obj1, this, xref);
  123|    159|	}
  124|    210|	obj1.free();
  125|       |
  126|    210|      } else {
  127|    102|	error(errSyntaxError, -1, "Missing or invalid default viewing OCCD");
  128|    102|      }
  129|    312|      defView.free();
  130|       |
  131|    312|    }
  132|    332|    ocgList.free();
  133|    332|  }
  134|       |
  135|  2.33k|  if (!display) {
  ------------------
  |  Branch (135:7): [True: 2.18k, False: 159]
  ------------------
  136|  2.18k|    display = new OCDisplayNode();
  137|  2.18k|  }
  138|  2.33k|}
_ZN15OptionalContentD2Ev:
  140|  2.33k|OptionalContent::~OptionalContent() {
  141|  2.33k|  deleteGList(ocgs, OptionalContentGroup);
  ------------------
  |  |   94|  2.33k|  do {                                              \
  |  |   95|  2.33k|    GList *_list = (list);                          \
  |  |   96|  2.33k|    {                                               \
  |  |   97|  2.33k|      int _i;                                       \
  |  |   98|  5.04k|      for (_i = 0; _i < _list->getLength(); ++_i) { \
  |  |  ------------------
  |  |  |  Branch (98:20): [True: 2.71k, False: 2.33k]
  |  |  ------------------
  |  |   99|  2.71k|        delete (T*)_list->get(_i);                  \
  |  |  100|  2.71k|      }                                             \
  |  |  101|  2.33k|      delete _list;                                 \
  |  |  102|  2.33k|    }                                               \
  |  |  103|  2.33k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (103:12): [Folded, False: 2.33k]
  |  |  ------------------
  ------------------
  142|  2.33k|  delete display;
  143|  2.33k|}
_ZN15OptionalContent7findOCGEP3Ref:
  153|  33.3k|OptionalContentGroup *OptionalContent::findOCG(Ref *ref) {
  154|  33.3k|  OptionalContentGroup *ocg;
  155|  33.3k|  int i;
  156|       |
  157|  62.3k|  for (i = 0; i < ocgs->getLength(); ++i) {
  ------------------
  |  Branch (157:15): [True: 30.2k, False: 32.1k]
  ------------------
  158|  30.2k|    ocg = (OptionalContentGroup *)ocgs->get(i);
  159|  30.2k|    if (ocg->matches(ref)) {
  ------------------
  |  Branch (159:9): [True: 1.24k, False: 28.9k]
  ------------------
  160|  1.24k|      return ocg;
  161|  1.24k|    }
  162|  30.2k|  }
  163|  32.1k|  return NULL;
  164|  33.3k|}
_ZN20OptionalContentGroup5parseEP3RefP6Object:
  328|  5.16k|OptionalContentGroup *OptionalContentGroup::parse(Ref *refA, Object *obj) {
  329|  5.16k|  TextString *nameA;
  330|  5.16k|  Object obj1, obj2, obj3;
  331|  5.16k|  OCUsageState viewStateA, printStateA;
  332|       |
  333|  5.16k|  if (!obj->isDict()) {
  ------------------
  |  Branch (333:7): [True: 1.93k, False: 3.22k]
  ------------------
  334|  1.93k|    return NULL;
  335|  1.93k|  }
  336|  3.22k|  if (!obj->dictLookup("Name", &obj1)->isString()) {
  ------------------
  |  Branch (336:7): [True: 514, False: 2.71k]
  ------------------
  337|    514|    error(errSyntaxError, -1, "Missing or invalid Name in OCG");
  338|    514|    obj1.free();
  339|    514|    return NULL;
  340|    514|  }
  341|  2.71k|  nameA = new TextString(obj1.getString());
  342|  2.71k|  obj1.free();
  343|       |
  344|  2.71k|  viewStateA = printStateA = ocUsageUnset;
  345|  2.71k|  if (obj->dictLookup("Usage", &obj1)->isDict()) {
  ------------------
  |  Branch (345:7): [True: 70, False: 2.64k]
  ------------------
  346|     70|    if (obj1.dictLookup("View", &obj2)->isDict()) {
  ------------------
  |  Branch (346:9): [True: 30, False: 40]
  ------------------
  347|     30|      if (obj2.dictLookup("ViewState", &obj3)->isName()) {
  ------------------
  |  Branch (347:11): [True: 20, False: 10]
  ------------------
  348|     20|	if (obj3.isName("ON")) {
  ------------------
  |  Branch (348:6): [True: 10, False: 10]
  ------------------
  349|     10|	  viewStateA = ocUsageOn;
  350|     10|	} else {
  351|     10|	  viewStateA = ocUsageOff;
  352|     10|	}
  353|     20|      }
  354|     30|      obj3.free();
  355|     30|    }
  356|     70|    obj2.free();
  357|     70|    if (obj1.dictLookup("Print", &obj2)->isDict()) {
  ------------------
  |  Branch (357:9): [True: 30, False: 40]
  ------------------
  358|     30|      if (obj2.dictLookup("PrintState", &obj3)->isName()) {
  ------------------
  |  Branch (358:11): [True: 20, False: 10]
  ------------------
  359|     20|	if (obj3.isName("ON")) {
  ------------------
  |  Branch (359:6): [True: 10, False: 10]
  ------------------
  360|     10|	  printStateA = ocUsageOn;
  361|     10|	} else {
  362|     10|	  printStateA = ocUsageOff;
  363|     10|	}
  364|     20|      }
  365|     30|      obj3.free();
  366|     30|    }
  367|     70|    obj2.free();
  368|     70|  }
  369|  2.71k|  obj1.free();
  370|       |
  371|  2.71k|  return new OptionalContentGroup(refA, nameA, viewStateA, printStateA);
  372|  3.22k|}
_ZN20OptionalContentGroupC2EP3RefP10TextString12OCUsageStateS4_:
  376|  2.71k|					   OCUsageState printStateA) {
  377|  2.71k|  ref = *refA;
  378|  2.71k|  name = nameA;
  379|  2.71k|  viewState = viewStateA;
  380|  2.71k|  printState = printStateA;
  381|  2.71k|  state = gTrue;
  ------------------
  |  |   17|  2.71k|#define gTrue 1
  ------------------
  382|  2.71k|  inViewUsageAppDict = gFalse;
  ------------------
  |  |   18|  2.71k|#define gFalse 0
  ------------------
  383|  2.71k|}
_ZN20OptionalContentGroupD2Ev:
  385|  2.71k|OptionalContentGroup::~OptionalContentGroup() {
  386|  2.71k|  delete name;
  387|  2.71k|}
_ZN20OptionalContentGroup7matchesEP3Ref:
  389|  30.2k|GBool OptionalContentGroup::matches(Ref *refA) {
  390|  30.2k|  return refA->num == ref.num && refA->gen == ref.gen;
  ------------------
  |  Branch (390:10): [True: 1.90k, False: 28.3k]
  |  Branch (390:34): [True: 1.24k, False: 663]
  ------------------
  391|  30.2k|}
_ZN13OCDisplayNode5parseEP6ObjectP15OptionalContentP4XRefi:
  404|   226k|				    XRef *xref, int recursion) {
  405|   226k|  Object obj2, obj3;
  406|   226k|  Ref ref;
  407|   226k|  OptionalContentGroup *ocgA;
  408|   226k|  OCDisplayNode *node, *child;
  409|   226k|  int i;
  410|       |
  411|   226k|  if (recursion > displayNodeRecursionLimit) {
  ------------------
  |  |   35|   226k|#define displayNodeRecursionLimit 50
  ------------------
  |  Branch (411:7): [True: 4.62k, False: 221k]
  ------------------
  412|  4.62k|    error(errSyntaxError, -1, "Loop detected in optional content order");
  413|  4.62k|    return NULL;
  414|  4.62k|  }
  415|   221k|  if (obj->isRef()) {
  ------------------
  |  Branch (415:7): [True: 31.7k, False: 189k]
  ------------------
  416|  31.7k|    ref = obj->getRef();
  417|  31.7k|    if ((ocgA = oc->findOCG(&ref))) {
  ------------------
  |  Branch (417:9): [True: 835, False: 30.9k]
  ------------------
  418|    835|      return new OCDisplayNode(ocgA);
  419|    835|    }
  420|  31.7k|  }
  421|   220k|  obj->fetch(xref, &obj2);
  422|   220k|  if (!obj2.isArray()) {
  ------------------
  |  Branch (422:7): [True: 216k, False: 3.70k]
  ------------------
  423|   216k|    obj2.free();
  424|   216k|    return NULL;
  425|   216k|  }
  426|  3.70k|  i = 0;
  427|  3.70k|  if (obj2.arrayGetLength() >= 1) {
  ------------------
  |  Branch (427:7): [True: 3.69k, False: 15]
  ------------------
  428|  3.69k|    if (obj2.arrayGet(0, &obj3)->isString()) {
  ------------------
  |  Branch (428:9): [True: 267, False: 3.42k]
  ------------------
  429|    267|      node = new OCDisplayNode(obj3.getString());
  430|    267|      i = 1;
  431|  3.42k|    } else {
  432|  3.42k|      node = new OCDisplayNode();
  433|  3.42k|    }
  434|  3.69k|    obj3.free();
  435|  3.69k|  } else {
  436|     15|    node = new OCDisplayNode();
  437|     15|  }
  438|   229k|  for (; i < obj2.arrayGetLength(); ++i) {
  ------------------
  |  Branch (438:10): [True: 225k, False: 3.70k]
  ------------------
  439|   225k|    obj2.arrayGetNF(i, &obj3);
  440|   225k|    if ((child = OCDisplayNode::parse(&obj3, oc, xref, recursion + 1))) {
  ------------------
  |  Branch (440:9): [True: 4.38k, False: 221k]
  ------------------
  441|  4.38k|      if (!child->ocg && !child->name && node->getNumChildren() > 0) {
  ------------------
  |  Branch (441:11): [True: 3.54k, False: 835]
  |  Branch (441:26): [True: 0, False: 3.54k]
  |  Branch (441:42): [True: 0, False: 0]
  ------------------
  442|      0|	if (child->getNumChildren() > 0) {
  ------------------
  |  Branch (442:6): [True: 0, False: 0]
  ------------------
  443|      0|	  node->getChild(node->getNumChildren() - 1)->
  444|      0|	            addChildren(child->takeChildren());
  445|      0|	}
  446|      0|	delete child;
  447|  4.38k|      } else {
  448|  4.38k|	node->addChild(child);
  449|  4.38k|      }
  450|  4.38k|    }
  451|   225k|    obj3.free();
  452|   225k|  }
  453|  3.70k|  obj2.free();
  454|  3.70k|  return node;
  455|   220k|}
_ZN13OCDisplayNodeC2Ev:
  457|  5.62k|OCDisplayNode::OCDisplayNode() {
  458|  5.62k|  name = new TextString();
  459|  5.62k|  ocg = NULL;
  460|  5.62k|  parent = NULL;
  461|       |  children = NULL;
  462|  5.62k|}
_ZN13OCDisplayNodeC2EP7GString:
  464|    267|OCDisplayNode::OCDisplayNode(GString *nameA) {
  465|    267|  name = new TextString(nameA);
  466|    267|  ocg = NULL;
  467|       |  children = NULL;
  468|    267|}
_ZN13OCDisplayNodeC2EP20OptionalContentGroup:
  470|    835|OCDisplayNode::OCDisplayNode(OptionalContentGroup *ocgA) {
  471|    835|  name = new TextString(ocgA->name);
  472|    835|  ocg = ocgA;
  473|       |  children = NULL;
  474|    835|}
_ZN13OCDisplayNode8addChildEPS_:
  476|  4.38k|void OCDisplayNode::addChild(OCDisplayNode *child) {
  477|  4.38k|  if (!children) {
  ------------------
  |  Branch (477:7): [True: 1.23k, False: 3.15k]
  ------------------
  478|  1.23k|    children = new GList();
  479|  1.23k|  }
  480|  4.38k|  children->append(child);
  481|  4.38k|  child->parent = this;
  482|  4.38k|}
_ZN13OCDisplayNodeD2Ev:
  509|  6.72k|OCDisplayNode::~OCDisplayNode() {
  510|  6.72k|  delete name;
  511|  6.72k|  if (children) {
  ------------------
  |  Branch (511:7): [True: 1.23k, False: 5.49k]
  ------------------
  512|  1.23k|    deleteGList(children, OCDisplayNode);
  ------------------
  |  |   94|  1.23k|  do {                                              \
  |  |   95|  1.23k|    GList *_list = (list);                          \
  |  |   96|  1.23k|    {                                               \
  |  |   97|  1.23k|      int _i;                                       \
  |  |   98|  5.61k|      for (_i = 0; _i < _list->getLength(); ++_i) { \
  |  |  ------------------
  |  |  |  Branch (98:20): [True: 4.38k, False: 1.23k]
  |  |  ------------------
  |  |   99|  4.38k|        delete (T*)_list->get(_i);                  \
  |  |  100|  4.38k|      }                                             \
  |  |  101|  1.23k|      delete _list;                                 \
  |  |  102|  1.23k|    }                                               \
  |  |  103|  1.23k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (103:12): [Folded, False: 1.23k]
  |  |  ------------------
  ------------------
  513|  1.23k|  }
  514|  6.72k|}

_ZN20OptionalContentGroup12getViewStateEv:
   80|      8|  OCUsageState getViewState() { return viewState; }
_ZN20OptionalContentGroup8setStateEi:
   83|    403|  void setState(GBool stateA) { state = stateA; }
_ZN20OptionalContentGroup21getInViewUsageAppDictEv:
   84|    526|  GBool getInViewUsageAppDict() { return inViewUsageAppDict; }
_ZN20OptionalContentGroup21setInViewUsageAppDictEv:
   85|      8|  void setInViewUsageAppDict() { inViewUsageAppDict = gTrue; }
  ------------------
  |  |   17|      8|#define gTrue 1
  ------------------

_ZN7OutlineC2EP6ObjectP4XRef:
   22|  2.33k|Outline::Outline(Object *outlineObj, XRef *xref) {
   23|  2.33k|  Object first, last;
   24|       |
   25|  2.33k|  items = NULL;
   26|  2.33k|  if (!outlineObj->isDict()) {
  ------------------
  |  Branch (26:7): [True: 2.14k, False: 198]
  ------------------
   27|  2.14k|    return;
   28|  2.14k|  }
   29|    198|  outlineObj->dictLookupNF("First", &first);
   30|    198|  outlineObj->dictLookupNF("Last", &last);
   31|    198|  if (first.isRef() && last.isRef()) {
  ------------------
  |  Branch (31:7): [True: 198, False: 0]
  |  Branch (31:24): [True: 197, False: 1]
  ------------------
   32|       |    items = OutlineItem::readItemList(&first, &last, NULL, xref);
   33|    197|  }
   34|    198|  first.free();
   35|    198|  last.free();
   36|    198|}
_ZN7OutlineD2Ev:
   38|  2.33k|Outline::~Outline() {
   39|  2.33k|  if (items) {
  ------------------
  |  Branch (39:7): [True: 197, False: 2.14k]
  ------------------
   40|    197|    deleteGList(items, OutlineItem);
  ------------------
  |  |   94|    197|  do {                                              \
  |  |   95|    197|    GList *_list = (list);                          \
  |  |   96|    197|    {                                               \
  |  |   97|    197|      int _i;                                       \
  |  |   98|    766|      for (_i = 0; _i < _list->getLength(); ++_i) { \
  |  |  ------------------
  |  |  |  Branch (98:20): [True: 569, False: 197]
  |  |  ------------------
  |  |   99|    569|        delete (T*)_list->get(_i);                  \
  |  |  100|    569|      }                                             \
  |  |  101|    197|      delete _list;                                 \
  |  |  102|    197|    }                                               \
  |  |  103|    197|  } while (0)
  |  |  ------------------
  |  |  |  Branch (103:12): [Folded, False: 197]
  |  |  ------------------
  ------------------
   41|    197|  }
   42|  2.33k|}
_ZN11OutlineItemC2EP6ObjectP4DictPS_P4XRef:
   47|    684|			 OutlineItem *parentA, XRef *xrefA) {
   48|    684|  Object obj1;
   49|       |
   50|    684|  xref = xrefA;
   51|    684|  title = NULL;
   52|    684|  action = NULL;
   53|    684|  kids = NULL;
   54|    684|  parent = parentA;
   55|       |
   56|    684|  if (dict->lookup("Title", &obj1)->isString()) {
  ------------------
  |  Branch (56:7): [True: 173, False: 511]
  ------------------
   57|    173|    title = new TextString(obj1.getString());
   58|    173|  }
   59|    684|  obj1.free();
   60|       |
   61|    684|  if (!dict->lookup("Dest", &obj1)->isNull()) {
  ------------------
  |  Branch (61:7): [True: 318, False: 366]
  ------------------
   62|    318|    action = LinkAction::parseDest(&obj1);
   63|    366|  } else {
   64|    366|    obj1.free();
   65|    366|    if (!dict->lookup("A", &obj1)->isNull()) {
  ------------------
  |  Branch (65:9): [True: 348, False: 18]
  ------------------
   66|    348|      action = LinkAction::parseAction(&obj1);
   67|    348|    }
   68|    366|  }
   69|    684|  obj1.free();
   70|       |
   71|    684|  itemRefA->copy(&itemRef);
   72|    684|  dict->lookupNF("First", &firstRef);
   73|    684|  dict->lookupNF("Last", &lastRef);
   74|    684|  dict->lookupNF("Next", &nextRef);
   75|       |
   76|    684|  startsOpen = gFalse;
  ------------------
  |  |   18|    684|#define gFalse 0
  ------------------
   77|    684|  if (dict->lookup("Count", &obj1)->isInt()) {
  ------------------
  |  Branch (77:7): [True: 155, False: 529]
  ------------------
   78|    155|    if (obj1.getInt() > 0) {
  ------------------
  |  Branch (78:9): [True: 123, False: 32]
  ------------------
   79|    123|      startsOpen = gTrue;
  ------------------
  |  |   17|    123|#define gTrue 1
  ------------------
   80|    123|    }
   81|    155|  }
   82|    684|  obj1.free();
   83|       |
   84|    684|  pageNum = -1;
   85|    684|}
_ZN11OutlineItemD2Ev:
   87|    684|OutlineItem::~OutlineItem() {
   88|    684|  close();
   89|    684|  if (title) {
  ------------------
  |  Branch (89:7): [True: 173, False: 511]
  ------------------
   90|    173|    delete title;
   91|    173|  }
   92|    684|  if (action) {
  ------------------
  |  Branch (92:7): [True: 368, False: 316]
  ------------------
   93|    368|    delete action;
   94|    368|  }
   95|    684|  itemRef.free();
   96|    684|  firstRef.free();
   97|    684|  lastRef.free();
   98|    684|  nextRef.free();
   99|    684|}
_ZN11OutlineItem12readItemListEP6ObjectS1_PS_P4XRef:
  102|    197|				 OutlineItem *parentA, XRef *xrefA) {
  103|    197|  GList *items;
  104|    197|  OutlineItem *item, *sibling;
  105|    197|  Object obj;
  106|    197|  Object *p;
  107|    197|  OutlineItem *ancestor;
  108|    197|  int i;
  109|       |
  110|    197|  items = new GList();
  111|    197|  if (!firstItemRef->isRef() || !lastItemRef->isRef()) {
  ------------------
  |  Branch (111:7): [True: 0, False: 197]
  |  Branch (111:33): [True: 0, False: 197]
  ------------------
  112|      0|    return items;
  113|      0|  }
  114|    197|  p = firstItemRef;
  115|    709|  do {
  116|    709|    if (!p->fetch(xrefA, &obj)->isDict()) {
  ------------------
  |  Branch (116:9): [True: 25, False: 684]
  ------------------
  117|     25|      obj.free();
  118|     25|      break;
  119|     25|    }
  120|    684|    item = new OutlineItem(p, obj.getDict(), parentA, xrefA);
  121|    684|    obj.free();
  122|       |
  123|       |    // check for loops with parents
  124|    684|    for (ancestor = parentA; ancestor; ancestor = ancestor->parent) {
  ------------------
  |  Branch (124:30): [True: 0, False: 684]
  ------------------
  125|      0|      if (p->getRefNum() == ancestor->itemRef.getRefNum() &&
  ------------------
  |  Branch (125:11): [True: 0, False: 0]
  ------------------
  126|      0|	  p->getRefGen() == ancestor->itemRef.getRefGen()) {
  ------------------
  |  Branch (126:4): [True: 0, False: 0]
  ------------------
  127|      0|	error(errSyntaxError, -1, "Loop detected in outline");
  128|      0|	break;
  129|      0|      }
  130|      0|    }
  131|    684|    if (ancestor) {
  ------------------
  |  Branch (131:9): [True: 0, False: 684]
  ------------------
  132|      0|      delete item;
  133|      0|      break;
  134|      0|    }
  135|       |
  136|       |    // check for loops with siblings
  137|  1.56k|    for (i = 0; i < items->getLength(); ++i) {
  ------------------
  |  Branch (137:17): [True: 991, False: 569]
  ------------------
  138|    991|      sibling = (OutlineItem *)items->get(i);
  139|    991|      if (p->getRefNum() == sibling->itemRef.getRefNum() &&
  ------------------
  |  Branch (139:11): [True: 119, False: 872]
  ------------------
  140|    119|	  p->getRefGen() == sibling->itemRef.getRefGen()) {
  ------------------
  |  Branch (140:4): [True: 115, False: 4]
  ------------------
  141|    115|	error(errSyntaxError, -1, "Loop detected in outline");
  142|    115|	break;
  143|    115|      }
  144|    991|    }
  145|    684|    if (i < items->getLength()) {
  ------------------
  |  Branch (145:9): [True: 115, False: 569]
  ------------------
  146|    115|      delete item;
  147|    115|      break;
  148|    115|    }
  149|       |
  150|    569|    items->append(item);
  151|    569|    if (p->getRefNum() == lastItemRef->getRef().num &&
  ------------------
  |  Branch (151:9): [True: 4, False: 565]
  |  Branch (151:9): [True: 3, False: 566]
  ------------------
  152|      4|	p->getRefGen() == lastItemRef->getRef().gen) {
  ------------------
  |  Branch (152:2): [True: 3, False: 1]
  ------------------
  153|      3|      break;
  154|      3|    }
  155|    566|    p = &item->nextRef;
  156|    566|    if (!p->isRef()) {
  ------------------
  |  Branch (156:9): [True: 54, False: 512]
  ------------------
  157|     54|      break;
  158|     54|    }
  159|    566|  } while (p);
  ------------------
  |  Branch (159:12): [True: 512, False: 0]
  ------------------
  160|    197|  return items;
  161|    197|}
_ZN11OutlineItem5closeEv:
  169|    684|void OutlineItem::close() {
  170|    684|  if (kids) {
  ------------------
  |  Branch (170:7): [True: 0, False: 684]
  ------------------
  171|      0|    deleteGList(kids, OutlineItem);
  ------------------
  |  |   94|      0|  do {                                              \
  |  |   95|      0|    GList *_list = (list);                          \
  |  |   96|      0|    {                                               \
  |  |   97|      0|      int _i;                                       \
  |  |   98|      0|      for (_i = 0; _i < _list->getLength(); ++_i) { \
  |  |  ------------------
  |  |  |  Branch (98:20): [True: 0, False: 0]
  |  |  ------------------
  |  |   99|      0|        delete (T*)_list->get(_i);                  \
  |  |  100|      0|      }                                             \
  |  |  101|      0|      delete _list;                                 \
  |  |  102|      0|    }                                               \
  |  |  103|      0|  } while (0)
  |  |  ------------------
  |  |  |  Branch (103:12): [Folded, False: 0]
  |  |  ------------------
  ------------------
  172|       |    kids = NULL;
  173|      0|  }
  174|    684|}

_ZN6PDFDocC2EP10BaseStreamP7GStringS3_P7PDFCore:
  219|  4.70k|	       GString *userPassword, PDFCore *coreA) {
  220|       |#ifdef _WIN32
  221|       |  int n, i;
  222|       |#endif
  223|       |
  224|  4.70k|  init(coreA);
  225|       |
  226|  4.70k|  if (strA->getFileName()) {
  ------------------
  |  Branch (226:7): [True: 0, False: 4.70k]
  ------------------
  227|      0|    fileName = strA->getFileName()->copy();
  228|       |#ifdef _WIN32
  229|       |    n = fileName->getLength();
  230|       |    fileNameU = (wchar_t *)gmallocn(n + 1, sizeof(wchar_t));
  231|       |    for (i = 0; i < n; ++i) {
  232|       |      fileNameU[i] = (wchar_t)(fileName->getChar(i) & 0xff);
  233|       |    }
  234|       |    fileNameU[n] = L'\0';
  235|       |#endif
  236|  4.70k|  } else {
  237|  4.70k|    fileName = NULL;
  238|       |#ifdef _WIN32
  239|       |    fileNameU = NULL;
  240|       |#endif
  241|  4.70k|  }
  242|  4.70k|  str = strA;
  243|  4.70k|  ok = setup(ownerPassword, userPassword);
  244|  4.70k|}
_ZN6PDFDoc4initEP7PDFCore:
  246|  4.70k|void PDFDoc::init(PDFCore *coreA) {
  247|  4.70k|  ok = gFalse;
  ------------------
  |  |   18|  4.70k|#define gFalse 0
  ------------------
  248|  4.70k|  errCode = errNone;
  ------------------
  |  |   12|  4.70k|#define errNone             0	// no error
  ------------------
  249|  4.70k|  core = coreA;
  250|  4.70k|  file = NULL;
  251|  4.70k|  str = NULL;
  252|  4.70k|  xref = NULL;
  253|  4.70k|  catalog = NULL;
  254|  4.70k|  annots = NULL;
  255|  4.70k|#ifndef DISABLE_OUTLINE
  256|  4.70k|  outline = NULL;
  257|  4.70k|#endif
  258|       |  optContent = NULL;
  259|  4.70k|}
_ZN6PDFDoc5setupEP7GStringS1_:
  261|  4.70k|GBool PDFDoc::setup(GString *ownerPassword, GString *userPassword) {
  262|       |
  263|  4.70k|  str->reset();
  264|       |
  265|       |  // check header
  266|  4.70k|  checkHeader();
  267|       |
  268|       |  // read the xref and catalog
  269|  4.70k|  if (!PDFDoc::setup2(ownerPassword, userPassword, gFalse)) {
  ------------------
  |  |   18|  4.70k|#define gFalse 0
  ------------------
  |  Branch (269:7): [True: 4.66k, False: 38]
  ------------------
  270|  4.66k|    if (errCode == errDamaged || errCode == errBadCatalog) {
  ------------------
  |  |   18|  9.33k|#define errDamaged          3	// PDF file was damaged and couldn't be
  ------------------
                  if (errCode == errDamaged || errCode == errBadCatalog) {
  ------------------
  |  |   16|     34|#define errBadCatalog       2	// couldn't read the page catalog
  ------------------
  |  Branch (270:9): [True: 4.63k, False: 34]
  |  Branch (270:34): [True: 32, False: 2]
  ------------------
  271|       |      // try repairing the xref table
  272|  4.66k|      error(errSyntaxWarning, -1,
  273|  4.66k|	    "PDF file is damaged - attempting to reconstruct xref table...");
  274|  4.66k|      if (!PDFDoc::setup2(ownerPassword, userPassword, gTrue)) {
  ------------------
  |  |   17|  4.66k|#define gTrue 1
  ------------------
  |  Branch (274:11): [True: 2.34k, False: 2.32k]
  ------------------
  275|  2.34k|	return gFalse;
  ------------------
  |  |   18|  2.34k|#define gFalse 0
  ------------------
  276|  2.34k|      }
  277|  4.66k|    } else {
  278|      2|      return gFalse;
  ------------------
  |  |   18|      2|#define gFalse 0
  ------------------
  279|      2|    }
  280|  4.66k|  }
  281|       |
  282|  2.36k|#ifndef DISABLE_OUTLINE
  283|       |  // read outline
  284|  2.36k|  outline = new Outline(catalog->getOutline(), xref);
  285|  2.36k|#endif
  286|       |
  287|       |  // read the optional content info
  288|  2.36k|  optContent = new OptionalContent(this);
  289|       |
  290|       |
  291|       |  // done
  292|  2.36k|  return gTrue;
  ------------------
  |  |   17|  2.36k|#define gTrue 1
  ------------------
  293|  4.70k|}
_ZN6PDFDoc6setup2EP7GStringS1_i:
  296|  9.36k|		     GBool repairXRef) {
  297|       |  // read xref table
  298|  9.36k|  xref = new XRef(str, repairXRef);
  299|  9.36k|  if (!xref->isOk()) {
  ------------------
  |  Branch (299:7): [True: 6.73k, False: 2.63k]
  ------------------
  300|  6.73k|    error(errSyntaxError, -1, "Couldn't read xref table");
  301|  6.73k|    errCode = xref->getErrorCode();
  302|  6.73k|    delete xref;
  303|  6.73k|    xref = NULL;
  304|  6.73k|    return gFalse;
  ------------------
  |  |   18|  6.73k|#define gFalse 0
  ------------------
  305|  6.73k|  }
  306|       |
  307|       |  // check for encryption
  308|  2.63k|  if (!checkEncryption(ownerPassword, userPassword)) {
  ------------------
  |  Branch (308:7): [True: 28, False: 2.60k]
  ------------------
  309|     28|    errCode = errEncrypted;
  ------------------
  |  |   21|     28|#define errEncrypted        4	// file was encrypted and password was
  ------------------
  310|     28|    delete xref;
  311|     28|    xref = NULL;
  312|     28|    return gFalse;
  ------------------
  |  |   18|     28|#define gFalse 0
  ------------------
  313|     28|  }
  314|       |
  315|       |  // read catalog
  316|  2.60k|  catalog = new Catalog(this);
  317|  2.60k|  if (!catalog->isOk()) {
  ------------------
  |  Branch (317:7): [True: 246, False: 2.36k]
  ------------------
  318|    246|    error(errSyntaxError, -1, "Couldn't read page catalog");
  319|    246|    errCode = errBadCatalog;
  ------------------
  |  |   16|    246|#define errBadCatalog       2	// couldn't read the page catalog
  ------------------
  320|    246|    delete catalog;
  321|    246|    catalog = NULL;
  322|    246|    delete xref;
  323|    246|    xref = NULL;
  324|    246|    return gFalse;
  ------------------
  |  |   18|    246|#define gFalse 0
  ------------------
  325|    246|  }
  326|       |
  327|       |  // initialize the Annots object
  328|  2.36k|  annots = new Annots(this);
  329|       |
  330|  2.36k|  return gTrue;
  ------------------
  |  |   17|  2.36k|#define gTrue 1
  ------------------
  331|  2.60k|}
_ZN6PDFDocD2Ev:
  333|  4.68k|PDFDoc::~PDFDoc() {
  334|  4.68k|  if (optContent) {
  ------------------
  |  Branch (334:7): [True: 2.33k, False: 2.34k]
  ------------------
  335|  2.33k|    delete optContent;
  336|  2.33k|  }
  337|  4.68k|#ifndef DISABLE_OUTLINE
  338|  4.68k|  if (outline) {
  ------------------
  |  Branch (338:7): [True: 2.33k, False: 2.34k]
  ------------------
  339|  2.33k|    delete outline;
  340|  2.33k|  }
  341|  4.68k|#endif
  342|  4.68k|  if (annots) {
  ------------------
  |  Branch (342:7): [True: 2.33k, False: 2.34k]
  ------------------
  343|  2.33k|    delete annots;
  344|  2.33k|  }
  345|  4.68k|  if (catalog) {
  ------------------
  |  Branch (345:7): [True: 2.33k, False: 2.34k]
  ------------------
  346|  2.33k|    delete catalog;
  347|  2.33k|  }
  348|  4.68k|  if (xref) {
  ------------------
  |  Branch (348:7): [True: 2.33k, False: 2.34k]
  ------------------
  349|  2.33k|    delete xref;
  350|  2.33k|  }
  351|  4.68k|  if (str) {
  ------------------
  |  Branch (351:7): [True: 4.68k, False: 0]
  ------------------
  352|  4.68k|    delete str;
  353|  4.68k|  }
  354|  4.68k|  if (file) {
  ------------------
  |  Branch (354:7): [True: 0, False: 4.68k]
  ------------------
  355|      0|    fclose(file);
  356|      0|  }
  357|  4.68k|  if (fileName) {
  ------------------
  |  Branch (357:7): [True: 0, False: 4.68k]
  ------------------
  358|      0|    delete fileName;
  359|      0|  }
  360|       |#ifdef _WIN32
  361|       |  if (fileNameU) {
  362|       |    gfree(fileNameU);
  363|       |  }
  364|       |#endif
  365|  4.68k|}
_ZN6PDFDoc11checkHeaderEv:
  369|  4.70k|void PDFDoc::checkHeader() {
  370|  4.70k|  char hdrBuf[headerSearchSize+1];
  371|  4.70k|  char *p;
  372|  4.70k|  int i;
  373|       |
  374|  4.70k|  pdfVersion = 0;
  375|  4.70k|  memset(hdrBuf, 0, headerSearchSize + 1);
  ------------------
  |  |   44|  4.70k|#define headerSearchSize 1024	// read this many bytes at beginning of
  ------------------
  376|  4.70k|  str->getBlock(hdrBuf, headerSearchSize);
  ------------------
  |  |   44|  4.70k|#define headerSearchSize 1024	// read this many bytes at beginning of
  ------------------
  377|  2.85M|  for (i = 0; i < headerSearchSize - 5; ++i) {
  ------------------
  |  |   44|  2.85M|#define headerSearchSize 1024	// read this many bytes at beginning of
  ------------------
  |  Branch (377:15): [True: 2.84M, False: 2.48k]
  ------------------
  378|  2.84M|    if (!strncmp(&hdrBuf[i], "%PDF-", 5)) {
  ------------------
  |  Branch (378:9): [True: 2.22k, False: 2.84M]
  ------------------
  379|  2.22k|      break;
  380|  2.22k|    }
  381|  2.84M|  }
  382|  4.70k|  if (i >= headerSearchSize - 5) {
  ------------------
  |  |   44|  4.70k|#define headerSearchSize 1024	// read this many bytes at beginning of
  ------------------
  |  Branch (382:7): [True: 2.48k, False: 2.22k]
  ------------------
  383|  2.48k|    error(errSyntaxWarning, -1, "May not be a PDF file (continuing anyway)");
  384|  2.48k|    return;
  385|  2.48k|  }
  386|  2.22k|  str->moveStart(i);
  387|  2.22k|  if (!(p = strtok(&hdrBuf[i+5], " \t\n\r"))) {
  ------------------
  |  Branch (387:7): [True: 2, False: 2.22k]
  ------------------
  388|      2|    error(errSyntaxWarning, -1, "May not be a PDF file (continuing anyway)");
  389|      2|    return;
  390|      2|  }
  391|  2.22k|  pdfVersion = atof(p);
  392|  2.22k|  if (!(hdrBuf[i+5] >= '0' && hdrBuf[i+5] <= '9') ||
  ------------------
  |  Branch (392:9): [True: 2.07k, False: 142]
  |  Branch (392:31): [True: 1.99k, False: 84]
  ------------------
  393|  1.99k|      pdfVersion > supportedPDFVersionNum + 0.0001) {
  ------------------
  |  |   28|  1.99k|#define supportedPDFVersionNum 2.0
  ------------------
  |  Branch (393:7): [True: 415, False: 1.58k]
  ------------------
  394|    641|    error(errSyntaxWarning, -1,
  395|    641|	  "PDF version {0:s} -- xpdf supports version {1:s} (continuing anyway)",
  396|    641|	  p, supportedPDFVersionStr);
  ------------------
  |  |   27|    641|#define supportedPDFVersionStr "2.0"
  ------------------
  397|    641|  }
  398|  2.22k|}
_ZN6PDFDoc15checkEncryptionEP7GStringS1_:
  400|  2.61k|GBool PDFDoc::checkEncryption(GString *ownerPassword, GString *userPassword) {
  401|  2.61k|  Object encrypt;
  402|  2.61k|  GBool encrypted;
  403|  2.61k|  SecurityHandler *secHdlr;
  404|  2.61k|  GBool ret;
  405|       |
  406|  2.61k|  xref->getTrailerDict()->dictLookup("Encrypt", &encrypt);
  407|  2.61k|  if ((encrypted = encrypt.isDict())) {
  ------------------
  |  Branch (407:7): [True: 213, False: 2.40k]
  ------------------
  408|    213|    if ((secHdlr = SecurityHandler::make(this, &encrypt))) {
  ------------------
  |  Branch (408:9): [True: 211, False: 2]
  ------------------
  409|    211|      if (secHdlr->isUnencrypted()) {
  ------------------
  |  Branch (409:11): [True: 2, False: 209]
  ------------------
  410|       |	// no encryption
  411|      2|	ret = gTrue;
  ------------------
  |  |   17|      2|#define gTrue 1
  ------------------
  412|    209|      } else if (secHdlr->checkEncryption(ownerPassword, userPassword)) {
  ------------------
  |  Branch (412:18): [True: 183, False: 26]
  ------------------
  413|       |	// authorization succeeded
  414|    183|       	xref->setEncryption(secHdlr->getPermissionFlags(),
  415|    183|			    secHdlr->getOwnerPasswordOk(),
  416|    183|			    secHdlr->getFileKey(),
  417|    183|			    secHdlr->getFileKeyLength(),
  418|    183|			    secHdlr->getEncVersion(),
  419|    183|			    secHdlr->getEncAlgorithm());
  420|    183|	ret = gTrue;
  ------------------
  |  |   17|    183|#define gTrue 1
  ------------------
  421|    183|      } else {
  422|       |	// authorization failed
  423|     26|	ret = gFalse;
  ------------------
  |  |   18|     26|#define gFalse 0
  ------------------
  424|     26|      }
  425|    211|      delete secHdlr;
  426|    211|    } else {
  427|       |      // couldn't find the matching security handler
  428|      2|      ret = gFalse;
  ------------------
  |  |   18|      2|#define gFalse 0
  ------------------
  429|      2|    }
  430|  2.40k|  } else {
  431|       |    // document is not encrypted
  432|  2.40k|    ret = gTrue;
  ------------------
  |  |   17|  2.40k|#define gTrue 1
  ------------------
  433|  2.40k|  }
  434|  2.61k|  encrypt.free();
  435|  2.61k|  return ret;
  436|  2.61k|}

_ZN6PDFDoc4isOkEv:
   58|  4.68k|  GBool isOk() { return ok; }
_ZN6PDFDoc7getXRefEv:
   70|  1.32M|  XRef *getXRef() { return xref; }
_ZN6PDFDoc11getFileNameEv:
   64|  2.34k|  GString *getFileName() { return fileName; }
_ZN6PDFDoc10getCatalogEv:
   73|  2.33k|  Catalog *getCatalog() { return catalog; }
_ZN6PDFDoc11getNumPagesEv:
   94|   326k|  int getNumPages() { return catalog->getNumPages(); }
_ZN6PDFDoc7getCoreEv:
  186|     26|  PDFCore *getCore() { return core; }

_ZN12PDFRectangle6clipToEPS_:
   36|   601k|void PDFRectangle::clipTo(PDFRectangle *rect) {
   37|   601k|  if (x1 < rect->x1) {
  ------------------
  |  Branch (37:7): [True: 0, False: 601k]
  ------------------
   38|      0|    x1 = rect->x1;
   39|   601k|  } else if (x1 > rect->x2) {
  ------------------
  |  Branch (39:14): [True: 0, False: 601k]
  ------------------
   40|      0|    x1 = rect->x2;
   41|      0|  }
   42|   601k|  if (x2 < rect->x1) {
  ------------------
  |  Branch (42:7): [True: 0, False: 601k]
  ------------------
   43|      0|    x2 = rect->x1;
   44|   601k|  } else if (x2 > rect->x2) {
  ------------------
  |  Branch (44:14): [True: 88, False: 601k]
  ------------------
   45|     88|    x2 = rect->x2;
   46|     88|  }
   47|   601k|  if (y1 < rect->y1) {
  ------------------
  |  Branch (47:7): [True: 0, False: 601k]
  ------------------
   48|      0|    y1 = rect->y1;
   49|   601k|  } else if (y1 > rect->y2) {
  ------------------
  |  Branch (49:14): [True: 156, False: 601k]
  ------------------
   50|    156|    y1 = rect->y2;
   51|    156|  }
   52|   601k|  if (y2 < rect->y1) {
  ------------------
  |  Branch (52:7): [True: 0, False: 601k]
  ------------------
   53|      0|    y2 = rect->y1;
   54|   601k|  } else if (y2 > rect->y2) {
  ------------------
  |  Branch (54:14): [True: 1.08k, False: 600k]
  ------------------
   55|  1.08k|    y2 = rect->y2;
   56|  1.08k|  }
   57|   601k|}
_ZN9PageAttrsC2EPS_P4DictP4XRef:
   63|   152k|PageAttrs::PageAttrs(PageAttrs *attrs, Dict *dict, XRef *xref) {
   64|   152k|  Object obj1;
   65|       |
   66|       |  // get old/default values
   67|   152k|  if (attrs) {
  ------------------
  |  Branch (67:7): [True: 2.62k, False: 149k]
  ------------------
   68|  2.62k|    mediaBox = attrs->mediaBox;
   69|  2.62k|    cropBox = attrs->cropBox;
   70|  2.62k|    haveCropBox = attrs->haveCropBox;
   71|  2.62k|    rotate = attrs->rotate;
   72|   149k|  } else {
   73|       |    // set default MediaBox to 8.5" x 11" -- this shouldn't be necessary
   74|       |    // but some (non-compliant) PDF files don't specify a MediaBox
   75|   149k|    mediaBox.x1 = 0;
   76|   149k|    mediaBox.y1 = 0;
   77|   149k|    mediaBox.x2 = 612;
   78|   149k|    mediaBox.y2 = 792;
   79|   149k|    cropBox.x1 = cropBox.y1 = cropBox.x2 = cropBox.y2 = 0;
   80|   149k|    haveCropBox = gFalse;
  ------------------
  |  |   18|   149k|#define gFalse 0
  ------------------
   81|   149k|    rotate = 0;
   82|   149k|  }
   83|       |
   84|       |  // media box
   85|   152k|  readBox(dict, "MediaBox", &mediaBox);
   86|       |
   87|       |  // crop box
   88|   152k|  if (readBox(dict, "CropBox", &cropBox)) {
  ------------------
  |  Branch (88:7): [True: 1.36k, False: 150k]
  ------------------
   89|  1.36k|    haveCropBox = gTrue;
  ------------------
  |  |   17|  1.36k|#define gTrue 1
  ------------------
   90|  1.36k|  }
   91|   152k|  if (!haveCropBox) {
  ------------------
  |  Branch (91:7): [True: 150k, False: 1.36k]
  ------------------
   92|   150k|    cropBox = mediaBox;
   93|   150k|  }
   94|       |
   95|       |  // other boxes
   96|   152k|  bleedBox = cropBox;
   97|   152k|  readBox(dict, "BleedBox", &bleedBox);
   98|   152k|  trimBox = cropBox;
   99|   152k|  readBox(dict, "TrimBox", &trimBox);
  100|   152k|  artBox = cropBox;
  101|   152k|  readBox(dict, "ArtBox", &artBox);
  102|       |
  103|       |  // rotate
  104|   152k|  dict->lookup("Rotate", &obj1);
  105|   152k|  if (obj1.isInt()) {
  ------------------
  |  Branch (105:7): [True: 2.14k, False: 150k]
  ------------------
  106|  2.14k|    rotate = obj1.getInt();
  107|  2.14k|  }
  108|   152k|  obj1.free();
  109|  32.1M|  while (rotate < 0) {
  ------------------
  |  Branch (109:10): [True: 32.0M, False: 152k]
  ------------------
  110|  32.0M|    rotate += 360;
  111|  32.0M|  }
  112|  77.8M|  while (rotate >= 360) {
  ------------------
  |  Branch (112:10): [True: 77.7M, False: 152k]
  ------------------
  113|  77.7M|    rotate -= 360;
  114|  77.7M|  }
  115|       |
  116|       |  // misc attributes
  117|   152k|  dict->lookup("LastModified", &lastModified);
  118|   152k|  dict->lookup("BoxColorInfo", &boxColorInfo);
  119|   152k|  dict->lookup("Group", &group);
  120|   152k|  dict->lookup("Metadata", &metadata);
  121|   152k|  dict->lookup("PieceInfo", &pieceInfo);
  122|   152k|  dict->lookup("SeparationInfo", &separationInfo);
  123|   152k|  if (dict->lookup("UserUnit", &obj1)->isNum()) {
  ------------------
  |  Branch (123:7): [True: 760, False: 151k]
  ------------------
  124|    760|    userUnit = obj1.getNum();
  125|    760|    if (userUnit < 1) {
  ------------------
  |  Branch (125:9): [True: 674, False: 86]
  ------------------
  126|    674|      userUnit = 1;
  127|    674|    }
  128|   151k|  } else {
  129|   151k|    userUnit = 1;
  130|   151k|  }
  131|   152k|  obj1.free();
  132|       |
  133|       |  // resource dictionary
  134|   152k|  Object childResDictObj;
  135|   152k|  dict->lookup("Resources", &childResDictObj);
  136|   152k|  if (attrs && attrs->resources.isDict() && childResDictObj.isDict()) {
  ------------------
  |  Branch (136:7): [True: 2.62k, False: 149k]
  |  Branch (136:16): [True: 143, False: 2.47k]
  |  Branch (136:45): [True: 74, False: 69]
  ------------------
  137|       |    // merge this node's resources into the parent's resources
  138|       |    // (some PDF files violate the PDF spec and expect this merging)
  139|     74|    resources.initDict(xref);
  140|     74|    Dict *resDict = resources.getDict();
  141|     74|    Dict *parentResDict = attrs->resources.getDict();
  142|     74|    for (int i = 0; i < parentResDict->getLength(); ++i) {
  ------------------
  |  Branch (142:21): [True: 0, False: 74]
  ------------------
  143|      0|      char *resType = parentResDict->getKey(i);
  144|      0|      Object subdictObj1;
  145|      0|      if (parentResDict->getVal(i, &subdictObj1)->isDict()) {
  ------------------
  |  Branch (145:11): [True: 0, False: 0]
  ------------------
  146|      0|	Dict *subdict1 = subdictObj1.getDict();
  147|      0|	Object subdictObj2;
  148|      0|	subdictObj2.initDict(xref);
  149|      0|	Dict *subdict2 = subdictObj2.getDict();
  150|      0|	for (int j = 0; j < subdict1->getLength(); ++j) {
  ------------------
  |  Branch (150:18): [True: 0, False: 0]
  ------------------
  151|      0|	  subdict1->getValNF(j, &obj1);
  152|      0|	  subdict2->add(copyString(subdict1->getKey(j)), &obj1);
  153|      0|	}
  154|      0|	resDict->add(copyString(resType), &subdictObj2);
  155|      0|      }
  156|      0|      subdictObj1.free();
  157|      0|    }
  158|     74|    Dict *childResDict = childResDictObj.getDict();
  159|    328|    for (int i = 0; i < childResDict->getLength(); ++i) {
  ------------------
  |  Branch (159:21): [True: 254, False: 74]
  ------------------
  160|    254|      char *resType = childResDict->getKey(i);
  161|    254|      Object subdictObj1;
  162|    254|      if (childResDict->getVal(i, &subdictObj1)->isDict()) {
  ------------------
  |  Branch (162:11): [True: 72, False: 182]
  ------------------
  163|     72|	Object subdictObj2;
  164|     72|	if (resDict->lookup(resType, &subdictObj2)->isDict()) {
  ------------------
  |  Branch (164:6): [True: 0, False: 72]
  ------------------
  165|      0|	  Dict *subdict1 = subdictObj1.getDict();
  166|      0|	  Dict *subdict2 = subdictObj2.getDict();
  167|      0|	  for (int j = 0; j < subdict1->getLength(); ++j) {
  ------------------
  |  Branch (167:20): [True: 0, False: 0]
  ------------------
  168|      0|	    subdict1->getValNF(j, &obj1);
  169|      0|	    subdict2->add(copyString(subdict1->getKey(j)), &obj1);
  170|      0|	  }
  171|      0|	  subdictObj2.free();
  172|     72|	} else {
  173|     72|	  subdictObj2.free();
  174|     72|	  resDict->add(copyString(resType), subdictObj1.copy(&subdictObj2));
  175|     72|	}
  176|     72|      }
  177|    254|      subdictObj1.free();
  178|    254|    }
  179|   152k|  } else if (attrs && attrs->resources.isDict()) {
  ------------------
  |  Branch (179:14): [True: 2.54k, False: 149k]
  |  Branch (179:23): [True: 69, False: 2.47k]
  ------------------
  180|     69|    attrs->resources.copy(&resources);
  181|   152k|  } else if (childResDictObj.isDict()) {
  ------------------
  |  Branch (181:14): [True: 1.57k, False: 150k]
  ------------------
  182|  1.57k|    childResDictObj.copy(&resources);
  183|   150k|  } else {
  184|   150k|    resources.initNull();
  185|   150k|  }
  186|   152k|  childResDictObj.free();
  187|   152k|}
_ZN9PageAttrsC2Ev:
  189|  9.43k|PageAttrs::PageAttrs() {
  190|  9.43k|  mediaBox.x1 = mediaBox.y1 = 0;
  191|  9.43k|  mediaBox.x2 = mediaBox.y2 = 50;
  192|  9.43k|  cropBox = mediaBox;
  193|  9.43k|  haveCropBox = gFalse;
  ------------------
  |  |   18|  9.43k|#define gFalse 0
  ------------------
  194|  9.43k|  bleedBox = cropBox;
  195|  9.43k|  trimBox = cropBox;
  196|  9.43k|  artBox = cropBox;
  197|  9.43k|  rotate = 0;
  198|  9.43k|  lastModified.initNull();
  199|  9.43k|  boxColorInfo.initNull();
  200|  9.43k|  group.initNull();
  201|  9.43k|  metadata.initNull();
  202|  9.43k|  pieceInfo.initNull();
  203|  9.43k|  separationInfo.initNull();
  204|  9.43k|  userUnit = 1;
  205|  9.43k|  resources.initNull();
  206|  9.43k|}
_ZN9PageAttrsD2Ev:
  208|   161k|PageAttrs::~PageAttrs() {
  209|   161k|  lastModified.free();
  210|   161k|  boxColorInfo.free();
  211|   161k|  group.free();
  212|   161k|  metadata.free();
  213|   161k|  pieceInfo.free();
  214|   161k|  separationInfo.free();
  215|   161k|  resources.free();
  216|   161k|}
_ZN9PageAttrs9clipBoxesEv:
  218|   150k|void PageAttrs::clipBoxes() {
  219|   150k|  cropBox.clipTo(&mediaBox);
  220|   150k|  bleedBox.clipTo(&mediaBox);
  221|   150k|  trimBox.clipTo(&mediaBox);
  222|   150k|  artBox.clipTo(&mediaBox);
  223|   150k|}
_ZN9PageAttrs7readBoxEP4DictPKcP12PDFRectangle:
  225|   761k|GBool PageAttrs::readBox(Dict *dict, const char *key, PDFRectangle *box) {
  226|   761k|  PDFRectangle tmp;
  227|   761k|  double t;
  228|   761k|  Object obj1, obj2;
  229|   761k|  GBool ok;
  230|       |
  231|   761k|  dict->lookup(key, &obj1);
  232|   761k|  if (obj1.isArray() && obj1.arrayGetLength() == 4) {
  ------------------
  |  Branch (232:7): [True: 3.11k, False: 758k]
  |  Branch (232:25): [True: 1.75k, False: 1.35k]
  ------------------
  233|  1.75k|    ok = gTrue;
  ------------------
  |  |   17|  1.75k|#define gTrue 1
  ------------------
  234|  1.75k|    obj1.arrayGet(0, &obj2);
  235|  1.75k|    if (obj2.isNum()) {
  ------------------
  |  Branch (235:9): [True: 1.75k, False: 1]
  ------------------
  236|  1.75k|      tmp.x1 = obj2.getNum();
  237|  1.75k|    } else {
  238|      1|      ok = gFalse;
  ------------------
  |  |   18|      1|#define gFalse 0
  ------------------
  239|      1|    }
  240|  1.75k|    obj2.free();
  241|  1.75k|    obj1.arrayGet(1, &obj2);
  242|  1.75k|    if (obj2.isNum()) {
  ------------------
  |  Branch (242:9): [True: 1.70k, False: 57]
  ------------------
  243|  1.70k|      tmp.y1 = obj2.getNum();
  244|  1.70k|    } else {
  245|     57|      ok = gFalse;
  ------------------
  |  |   18|     57|#define gFalse 0
  ------------------
  246|     57|    }
  247|  1.75k|    obj2.free();
  248|  1.75k|    obj1.arrayGet(2, &obj2);
  249|  1.75k|    if (obj2.isNum()) {
  ------------------
  |  Branch (249:9): [True: 1.75k, False: 7]
  ------------------
  250|  1.75k|      tmp.x2 = obj2.getNum();
  251|  1.75k|    } else {
  252|      7|      ok = gFalse;
  ------------------
  |  |   18|      7|#define gFalse 0
  ------------------
  253|      7|    }
  254|  1.75k|    obj2.free();
  255|  1.75k|    obj1.arrayGet(3, &obj2);
  256|  1.75k|    if (obj2.isNum()) {
  ------------------
  |  Branch (256:9): [True: 1.75k, False: 4]
  ------------------
  257|  1.75k|      tmp.y2 = obj2.getNum();
  258|  1.75k|    } else {
  259|      4|      ok = gFalse;
  ------------------
  |  |   18|      4|#define gFalse 0
  ------------------
  260|      4|    }
  261|  1.75k|    obj2.free();
  262|  1.75k|    if (ok) {
  ------------------
  |  Branch (262:9): [True: 1.69k, False: 67]
  ------------------
  263|       |      // limit the box coords so they can be converted to 32-bit ints later
  264|  1.69k|      if (tmp.x1 < -1e9) {
  ------------------
  |  Branch (264:11): [True: 0, False: 1.69k]
  ------------------
  265|      0|	tmp.x1 = -1e9;
  266|  1.69k|      } else if (tmp.x1 > 1e9) {
  ------------------
  |  Branch (266:18): [True: 0, False: 1.69k]
  ------------------
  267|      0|	tmp.x1 = 1e9;
  268|      0|      }
  269|  1.69k|      if (tmp.y1 < -1e9) {
  ------------------
  |  Branch (269:11): [True: 0, False: 1.69k]
  ------------------
  270|      0|	tmp.y1 = -1e9;
  271|  1.69k|      } else if (tmp.y1 > 1e9) {
  ------------------
  |  Branch (271:18): [True: 0, False: 1.69k]
  ------------------
  272|      0|	tmp.y1 = 1e9;
  273|      0|      }
  274|  1.69k|      if (tmp.x2 < -1e9) {
  ------------------
  |  Branch (274:11): [True: 0, False: 1.69k]
  ------------------
  275|      0|	tmp.x2 = -1e9;
  276|  1.69k|      } else if (tmp.x2 > 1e9) {
  ------------------
  |  Branch (276:18): [True: 1, False: 1.69k]
  ------------------
  277|      1|	tmp.x2 = 1e9;
  278|      1|      }
  279|  1.69k|      if (tmp.y2 < -1e9) {
  ------------------
  |  Branch (279:11): [True: 0, False: 1.69k]
  ------------------
  280|      0|	tmp.y2 = -1e9;
  281|  1.69k|      } else if (tmp.y2 > 1e9) {
  ------------------
  |  Branch (281:18): [True: 8, False: 1.68k]
  ------------------
  282|      8|	tmp.y2 = 1e9;
  283|      8|      }
  284|  1.69k|      if (tmp.x1 > tmp.x2) {
  ------------------
  |  Branch (284:11): [True: 14, False: 1.67k]
  ------------------
  285|     14|	t = tmp.x1; tmp.x1 = tmp.x2; tmp.x2 = t;
  286|     14|      }
  287|  1.69k|      if (tmp.y1 > tmp.y2) {
  ------------------
  |  Branch (287:11): [True: 0, False: 1.69k]
  ------------------
  288|      0|	t = tmp.y1; tmp.y1 = tmp.y2; tmp.y2 = t;
  289|      0|      }
  290|  1.69k|      *box = tmp;
  291|  1.69k|    }
  292|   759k|  } else {
  293|   759k|    ok = gFalse;
  ------------------
  |  |   18|   759k|#define gFalse 0
  ------------------
  294|   759k|  }
  295|   761k|  obj1.free();
  296|   761k|  return ok;
  297|   761k|}
_ZN4PageC2EP6PDFDociP4DictP9PageAttrs:
  303|   150k|Page::Page(PDFDoc *docA, int numA, Dict *pageDict, PageAttrs *attrsA) {
  304|   150k|  ok = gTrue;
  ------------------
  |  |   17|   150k|#define gTrue 1
  ------------------
  305|   150k|  doc = docA;
  306|   150k|  xref = doc->getXRef();
  307|   150k|  num = numA;
  308|       |
  309|       |  // get attributes
  310|   150k|  attrs = attrsA;
  311|   150k|  attrs->clipBoxes();
  312|       |
  313|       |  // annotations
  314|   150k|  pageDict->lookupNF("Annots", &annots);
  315|   150k|  if (!(annots.isRef() || annots.isArray() || annots.isNull())) {
  ------------------
  |  Branch (315:9): [True: 277, False: 150k]
  |  Branch (315:27): [True: 135k, False: 14.4k]
  |  Branch (315:47): [True: 14.2k, False: 205]
  ------------------
  316|    205|    error(errSyntaxError, -1,
  317|    205|	  "Page annotations object (page {0:d}) is wrong type ({1:s})",
  318|    205|	  num, annots.getTypeName());
  319|    205|    annots.free();
  320|    205|    goto err2;
  321|    205|  }
  322|       |
  323|       |  // contents
  324|   150k|  pageDict->lookupNF("Contents", &contents);
  325|   150k|  if (!(contents.isRef() || contents.isArray() ||
  ------------------
  |  Branch (325:9): [True: 208, False: 149k]
  |  Branch (325:29): [True: 224, False: 149k]
  ------------------
  326|   149k|	contents.isNull())) {
  ------------------
  |  Branch (326:2): [True: 149k, False: 10]
  ------------------
  327|     10|    error(errSyntaxError, -1,
  328|     10|	  "Page contents object (page {0:d}) is wrong type ({1:s})",
  329|     10|	  num, contents.getTypeName());
  330|     10|    contents.free();
  331|     10|    goto err1;
  332|     10|  }
  333|       |
  334|       |  // thumbnail
  335|   150k|  pageDict->lookupNF("Thumb", &thumbnail);
  336|   150k|  if (!thumbnail.isRef()) {
  ------------------
  |  Branch (336:7): [True: 149k, False: 122]
  ------------------
  337|   149k|    if (!thumbnail.isNull()) {
  ------------------
  |  Branch (337:9): [True: 378, False: 149k]
  ------------------
  338|    378|      thumbnail.free();
  339|    378|      thumbnail.initNull();
  340|    378|    }
  341|   149k|  }
  342|       |
  343|   150k|  return;
  344|       |
  345|    205| err2:
  346|    205|  annots.initNull();
  347|    215| err1:
  348|    215|  contents.initNull();
  349|    215|  thumbnail.initNull();
  350|    215|  ok = gFalse;
  ------------------
  |  |   18|    215|#define gFalse 0
  ------------------
  351|    215|}
_ZN4PageC2EP6PDFDoci:
  353|  9.43k|Page::Page(PDFDoc *docA, int numA) {
  354|  9.43k|  doc = docA;
  355|  9.43k|  xref = doc->getXRef();
  356|  9.43k|  num = numA;
  357|  9.43k|  attrs = new PageAttrs();
  358|  9.43k|  annots.initNull();
  359|  9.43k|  contents.initNull();
  360|  9.43k|  thumbnail.initNull();
  361|  9.43k|  ok = gTrue;
  ------------------
  |  |   17|  9.43k|#define gTrue 1
  ------------------
  362|  9.43k|}
_ZN4PageD2Ev:
  364|   159k|Page::~Page() {
  365|   159k|  delete attrs;
  366|   159k|  annots.free();
  367|   159k|  contents.free();
  368|   159k|  thumbnail.free();
  369|   159k|}

_ZN12PDFRectangleC2Ev:
   29|  1.57M|  PDFRectangle() { x1 = y1 = x2 = y2 = 0; }
_ZN4Page4isOkEv:
  123|   150k|  GBool isOk() { return ok; }
_ZN4Page9getAnnotsEP6Object:
  155|   319k|  Object *getAnnots(Object *obj) { return annots.fetch(xref, obj); }

_ZN6ParserC2EP4XRefP5Lexeri:
   22|   363k|Parser::Parser(XRef *xrefA, Lexer *lexerA, GBool allowStreamsA) {
   23|   363k|  xref = xrefA;
   24|   363k|  lexer = lexerA;
   25|   363k|  inlineImg = 0;
   26|   363k|  allowStreams = allowStreamsA;
   27|   363k|  lexer->getObj(&buf1);
   28|   363k|  lexer->getObj(&buf2);
   29|   363k|}
_ZN6ParserD2Ev:
   31|   363k|Parser::~Parser() {
   32|   363k|  buf1.free();
   33|   363k|  buf2.free();
   34|   363k|  delete lexer;
   35|   363k|}
_ZN6Parser6getObjEP6ObjectiPh14CryptAlgorithmiiii:
   40|   122M|		       int objNum, int objGen, int recursion) {
   41|   122M|  char *key;
   42|   122M|  Stream *str;
   43|   122M|  Object obj2;
   44|   122M|  int num;
   45|   122M|  DecryptStream *decrypt;
   46|   122M|  GString *s, *s2;
   47|   122M|  int c;
   48|       |
   49|       |  // refill buffer after inline image data
   50|   122M|  if (inlineImg == 2) {
  ------------------
  |  Branch (50:7): [True: 55.7k, False: 122M]
  ------------------
   51|  55.7k|    buf1.free();
   52|  55.7k|    buf2.free();
   53|  55.7k|    lexer->getObj(&buf1);
   54|  55.7k|    lexer->getObj(&buf2);
   55|  55.7k|    inlineImg = 0;
   56|  55.7k|  }
   57|       |
   58|       |  // array
   59|   122M|  if (!simpleOnly && recursion < objectRecursionLimit && buf1.isCmd("[")) {
  ------------------
  |  |   20|   146M|#define objectRecursionLimit 500
  ------------------
  |  Branch (59:7): [True: 23.2M, False: 99.7M]
  |  Branch (59:22): [True: 11.0M, False: 12.2M]
  |  Branch (59:58): [True: 677k, False: 10.3M]
  ------------------
   60|   677k|    shift();
   61|   677k|    obj->initArray(xref);
   62|  21.0M|    while (!buf1.isCmd("]") && !buf1.isEOF())
  ------------------
  |  Branch (62:12): [True: 20.6M, False: 331k]
  |  Branch (62:32): [True: 20.3M, False: 345k]
  ------------------
   63|  20.3M|      obj->arrayAdd(getObj(&obj2, gFalse, fileKey, encAlgorithm, keyLength,
  ------------------
  |  |   18|  20.3M|#define gFalse 0
  ------------------
   64|  20.3M|			   objNum, objGen, recursion + 1));
   65|   677k|    if (buf1.isEOF())
  ------------------
  |  Branch (65:9): [True: 345k, False: 331k]
  ------------------
   66|   345k|      error(errSyntaxError, getPos(), "End of file inside array");
   67|   677k|    shift();
   68|       |
   69|       |  // dictionary or stream
   70|   122M|  } else if (!simpleOnly && recursion < objectRecursionLimit &&
  ------------------
  |  |   20|   144M|#define objectRecursionLimit 500
  ------------------
  |  Branch (70:14): [True: 22.5M, False: 99.7M]
  |  Branch (70:29): [True: 10.3M, False: 12.2M]
  ------------------
   71|  10.3M|	     buf1.isCmd("<<")) {
  ------------------
  |  Branch (71:7): [True: 633k, False: 9.69M]
  ------------------
   72|   633k|    shift();
   73|   633k|    obj->initDict(xref);
   74|  16.6M|    while (!buf1.isCmd(">>") && !buf1.isEOF()) {
  ------------------
  |  Branch (74:12): [True: 16.0M, False: 562k]
  |  Branch (74:33): [True: 16.0M, False: 32.2k]
  ------------------
   75|  16.0M|      if (!buf1.isName()) {
  ------------------
  |  Branch (75:11): [True: 13.2M, False: 2.79M]
  ------------------
   76|  13.2M|	error(errSyntaxError, getPos(),
   77|  13.2M|	      "Dictionary key must be a name object");
   78|  13.2M|	shift();
   79|  13.2M|      } else {
   80|  2.79M|	key = copyString(buf1.getName());
   81|  2.79M|	shift();
   82|  2.79M|	if (buf1.isEOF() || buf1.isError()) {
  ------------------
  |  Branch (82:6): [True: 2.14k, False: 2.78M]
  |  Branch (82:22): [True: 36.6k, False: 2.75M]
  ------------------
   83|  38.8k|	  gfree(key);
   84|  38.8k|	  break;
   85|  38.8k|	}
   86|  2.75M|	obj->dictAdd(key, getObj(&obj2, gFalse,
  ------------------
  |  |   18|  2.75M|#define gFalse 0
  ------------------
   87|  2.75M|				 fileKey, encAlgorithm, keyLength,
   88|  2.75M|				 objNum, objGen, recursion + 1));
   89|  2.75M|      }
   90|  16.0M|    }
   91|   633k|    if (buf1.isEOF())
  ------------------
  |  Branch (91:9): [True: 34.4k, False: 598k]
  ------------------
   92|  34.4k|      error(errSyntaxError, getPos(), "End of file inside dictionary");
   93|       |    // stream objects are not allowed inside content streams or
   94|       |    // object streams
   95|   633k|    if (allowStreams && buf2.isCmd("stream")) {
  ------------------
  |  Branch (95:9): [True: 386k, False: 247k]
  |  Branch (95:25): [True: 101k, False: 284k]
  ------------------
   96|   101k|      if ((str = makeStream(obj, fileKey, encAlgorithm, keyLength,
  ------------------
  |  Branch (96:11): [True: 94.7k, False: 6.71k]
  ------------------
   97|   101k|			    objNum, objGen, recursion + 1))) {
   98|  94.7k|	obj->initStream(str);
   99|  94.7k|      } else {
  100|  6.71k|	obj->free();
  101|  6.71k|	obj->initError();
  102|  6.71k|      }
  103|   531k|    } else {
  104|   531k|      shift();
  105|   531k|    }
  106|       |
  107|       |  // indirect reference or integer
  108|   121M|  } else if (buf1.isInt()) {
  ------------------
  |  Branch (108:14): [True: 4.84M, False: 116M]
  ------------------
  109|  4.84M|    num = buf1.getInt();
  110|  4.84M|    shift();
  111|  4.84M|    if (buf1.isInt() && buf2.isCmd("R")) {
  ------------------
  |  Branch (111:9): [True: 2.16M, False: 2.68M]
  |  Branch (111:25): [True: 628k, False: 1.53M]
  ------------------
  112|   628k|      int gen = buf1.getInt();
  113|   628k|      if (num >= 0 && gen >= 0) {
  ------------------
  |  Branch (113:11): [True: 626k, False: 2.33k]
  |  Branch (113:23): [True: 624k, False: 1.46k]
  ------------------
  114|   624k|	obj->initRef(num, gen);
  115|   624k|      } else {
  116|  3.79k|	error(errSyntaxError, getPos(),
  117|  3.79k|	      "Negative number or generation in indirect reference");
  118|  3.79k|	obj->initError();
  119|  3.79k|      }
  120|   628k|      shift();
  121|   628k|      shift();
  122|  4.21M|    } else {
  123|  4.21M|      obj->initInt(num);
  124|  4.21M|    }
  125|       |
  126|       |  // string
  127|   116M|  } else if (buf1.isString() && fileKey) {
  ------------------
  |  Branch (127:14): [True: 512k, False: 116M]
  |  Branch (127:33): [True: 27.8k, False: 484k]
  ------------------
  128|  27.8k|    s = buf1.getString();
  129|  27.8k|    s2 = new GString();
  130|  27.8k|    obj2.initNull();
  131|  27.8k|    decrypt = new DecryptStream(new MemStream(s->getCString(), 0,
  132|  27.8k|					      s->getLength(), &obj2),
  133|  27.8k|				fileKey, encAlgorithm, keyLength,
  134|  27.8k|				objNum, objGen);
  135|  27.8k|    decrypt->reset();
  136|  1.31M|    while ((c = decrypt->getChar()) != EOF) {
  ------------------
  |  Branch (136:12): [True: 1.28M, False: 27.8k]
  ------------------
  137|  1.28M|      s2->append((char)c);
  138|  1.28M|    }
  139|  27.8k|    delete decrypt;
  140|  27.8k|    obj->initString(s2);
  141|  27.8k|    shift();
  142|       |
  143|       |  // simple object
  144|   116M|  } else {
  145|   116M|    buf1.copy(obj);
  146|   116M|    shift();
  147|   116M|  }
  148|       |
  149|   122M|  return obj;
  150|   122M|}
_ZN6Parser10makeStreamEP6ObjectPh14CryptAlgorithmiiii:
  154|   101k|			   int objNum, int objGen, int recursion) {
  155|       |  // get stream start position
  156|   101k|  lexer->skipToNextLine();
  157|   101k|  Stream *curStr = lexer->getStream();
  158|   101k|  if (!curStr) {
  ------------------
  |  Branch (158:7): [True: 3.08k, False: 98.3k]
  ------------------
  159|  3.08k|    return NULL;
  160|  3.08k|  }
  161|  98.3k|  GFileOffset pos = curStr->getPos();
  162|       |
  163|  98.3k|  GBool haveLength = gFalse;
  ------------------
  |  |   18|  98.3k|#define gFalse 0
  ------------------
  164|  98.3k|  GFileOffset length = 0;
  165|  98.3k|  GFileOffset endPos;
  166|       |
  167|       |  // check for length in damaged file
  168|  98.3k|  if (xref && xref->getStreamEnd(pos, &endPos)) {
  ------------------
  |  Branch (168:7): [True: 98.0k, False: 311]
  |  Branch (168:15): [True: 63.4k, False: 34.5k]
  ------------------
  169|  63.4k|    length = endPos - pos;
  170|  63.4k|    haveLength = gTrue;
  ------------------
  |  |   17|  63.4k|#define gTrue 1
  ------------------
  171|       |
  172|       |  // get length from the stream object
  173|  63.4k|  } else {
  174|  34.8k|    Object obj;
  175|  34.8k|    dict->dictLookup("Length", &obj, recursion);
  176|  34.8k|    if (obj.isInt()) {
  ------------------
  |  Branch (176:9): [True: 23.0k, False: 11.8k]
  ------------------
  177|  23.0k|      length = (GFileOffset)(Guint)obj.getInt();
  178|  23.0k|      haveLength = gTrue;
  ------------------
  |  |   17|  23.0k|#define gTrue 1
  ------------------
  179|  23.0k|    } else {
  180|  11.8k|      error(errSyntaxError, getPos(),
  181|  11.8k|	    "Missing or invalid 'Length' attribute in stream");
  182|  11.8k|    }
  183|  34.8k|    obj.free();
  184|  34.8k|  }
  185|       |
  186|       |  // in badly damaged PDF files, we can run off the end of the input
  187|       |  // stream immediately after the "stream" token
  188|  98.3k|  if (!lexer->getStream()) {
  ------------------
  |  Branch (188:7): [True: 0, False: 98.3k]
  ------------------
  189|      0|    return NULL;
  190|      0|  }
  191|       |
  192|       |  // copy the base stream (Lexer will free stream objects when it gets
  193|       |  // to end of stream -- which can happen in the shift() calls below)
  194|  98.3k|  BaseStream *baseStr =
  195|  98.3k|      (BaseStream *)lexer->getStream()->getBaseStream()->copy();
  196|       |
  197|       |  // 'Length' attribute is missing -- search for 'endstream'
  198|  98.3k|  if (!haveLength) {
  ------------------
  |  Branch (198:7): [True: 11.8k, False: 86.5k]
  ------------------
  199|  11.8k|    GBool foundEndstream = gFalse;
  ------------------
  |  |   18|  11.8k|#define gFalse 0
  ------------------
  200|  11.8k|    char endstreamBuf[8];
  201|  11.8k|    if ((curStr = lexer->getStream())) {
  ------------------
  |  Branch (201:9): [True: 11.8k, False: 0]
  ------------------
  202|  11.8k|      int c;
  203|  8.72M|      while ((c = curStr->getChar()) != EOF) {
  ------------------
  |  Branch (203:14): [True: 8.71M, False: 3.62k]
  ------------------
  204|  8.71M|	if (c == 'e' &&
  ------------------
  |  Branch (204:6): [True: 267k, False: 8.45M]
  ------------------
  205|   267k|	    curStr->getBlock(endstreamBuf, 8) == 8 &&
  ------------------
  |  Branch (205:6): [True: 265k, False: 2.13k]
  ------------------
  206|   265k|	    !memcmp(endstreamBuf, "ndstream", 8)) {
  ------------------
  |  Branch (206:6): [True: 8.20k, False: 257k]
  ------------------
  207|  8.20k|	  length = curStr->getPos() - 9 - pos;
  208|  8.20k|	  foundEndstream = gTrue;
  ------------------
  |  |   17|  8.20k|#define gTrue 1
  ------------------
  209|  8.20k|	  break;
  210|  8.20k|	}
  211|  8.71M|      }
  212|  11.8k|    }
  213|  11.8k|    if (!foundEndstream) {
  ------------------
  |  Branch (213:9): [True: 3.62k, False: 8.20k]
  ------------------
  214|  3.62k|      error(errSyntaxError, getPos(), "Couldn't find 'endstream' for stream");
  215|  3.62k|      delete baseStr;
  216|  3.62k|      return NULL;
  217|  3.62k|    }
  218|  11.8k|  }
  219|       |
  220|       |  // make new base stream
  221|  94.7k|  Stream *str = baseStr->makeSubStream(pos, gTrue, length, dict);
  ------------------
  |  |   17|  94.7k|#define gTrue 1
  ------------------
  222|       |
  223|       |  // look for the 'endstream' marker
  224|  94.7k|  if (haveLength) {
  ------------------
  |  Branch (224:7): [True: 86.5k, False: 8.20k]
  ------------------
  225|       |    // skip over stream data
  226|  86.5k|    lexer->setPos(pos + length);
  227|       |
  228|       |    // check for 'endstream'
  229|       |    // NB: we never reuse the Parser object to parse objects after a
  230|       |    // stream, and we could (if the PDF file is damaged) be in the
  231|       |    // middle of binary data at this point, so we check the stream
  232|       |    // data directly for 'endstream', rather than calling shift() to
  233|       |    // parse objects
  234|  86.5k|    GBool foundEndstream = gFalse;
  ------------------
  |  |   18|  86.5k|#define gFalse 0
  ------------------
  235|  86.5k|    char endstreamBuf[8];
  236|  86.5k|    if ((curStr = lexer->getStream())) {
  ------------------
  |  Branch (236:9): [True: 86.5k, False: 0]
  ------------------
  237|       |      // skip up to 100 whitespace chars
  238|  86.5k|      int c;
  239|  95.9k|      for (int i = 0; i < 100; ++i) {
  ------------------
  |  Branch (239:23): [True: 95.9k, False: 42]
  ------------------
  240|  95.9k|	c = curStr->getChar();
  241|  95.9k|	if (!Lexer::isSpace(c)) {
  ------------------
  |  Branch (241:6): [True: 86.4k, False: 9.43k]
  ------------------
  242|  86.4k|	  break;
  243|  86.4k|	}
  244|  95.9k|      }
  245|  86.5k|      if (c == 'e') {
  ------------------
  |  Branch (245:11): [True: 66.2k, False: 20.2k]
  ------------------
  246|  66.2k|	if (curStr->getBlock(endstreamBuf, 8) == 8 &&
  ------------------
  |  Branch (246:6): [True: 66.1k, False: 138]
  ------------------
  247|  66.1k|	    !memcmp(endstreamBuf, "ndstream", 8)) {
  ------------------
  |  Branch (247:6): [True: 63.7k, False: 2.40k]
  ------------------
  248|  63.7k|	  foundEndstream = gTrue;
  ------------------
  |  |   17|  63.7k|#define gTrue 1
  ------------------
  249|  63.7k|	}
  250|  66.2k|      }
  251|  86.5k|    }
  252|  86.5k|    if (!foundEndstream) {
  ------------------
  |  Branch (252:9): [True: 22.7k, False: 63.7k]
  ------------------
  253|  22.7k|      error(errSyntaxError, getPos(), "Missing 'endstream'");
  254|       |      // kludge for broken PDF files: just add 5k to the length, and
  255|       |      // hope it's enough
  256|       |      // (dict is now owned by str, so we need to copy it before deleting str)
  257|  22.7k|      Object obj;
  258|  22.7k|      dict->copy(&obj);
  259|  22.7k|      delete str;
  260|  22.7k|      length += 5000;
  261|  22.7k|      str = baseStr->makeSubStream(pos, gTrue, length, &obj);
  ------------------
  |  |   17|  22.7k|#define gTrue 1
  ------------------
  262|  22.7k|    }
  263|  86.5k|  }
  264|       |
  265|       |  // free the copied base stream
  266|  94.7k|  delete baseStr;
  267|       |
  268|       |  // handle decryption
  269|  94.7k|  if (fileKey) {
  ------------------
  |  Branch (269:7): [True: 10.5k, False: 84.2k]
  ------------------
  270|       |    // the 'Crypt' filter is used to mark unencrypted metadata streams
  271|       |    //~ this should also check for an empty DecodeParams entry
  272|  10.5k|    GBool encrypted = gTrue;
  ------------------
  |  |   17|  10.5k|#define gTrue 1
  ------------------
  273|  10.5k|    Object obj;
  274|  10.5k|    dict->dictLookup("Filter", &obj, recursion);
  275|  10.5k|    if (obj.isName("Crypt")) {
  ------------------
  |  Branch (275:9): [True: 73, False: 10.4k]
  ------------------
  276|     73|      encrypted = gFalse;
  ------------------
  |  |   18|     73|#define gFalse 0
  ------------------
  277|  10.4k|    } else if (obj.isArray() && obj.arrayGetLength() >= 1) {
  ------------------
  |  Branch (277:16): [True: 1.89k, False: 8.53k]
  |  Branch (277:33): [True: 1.83k, False: 60]
  ------------------
  278|  1.83k|      Object obj2;
  279|  1.83k|      if (obj.arrayGet(0, &obj2)->isName("Crypt")) {
  ------------------
  |  Branch (279:11): [True: 0, False: 1.83k]
  ------------------
  280|      0|	encrypted = gFalse;
  ------------------
  |  |   18|      0|#define gFalse 0
  ------------------
  281|      0|      }
  282|  1.83k|      obj2.free();
  283|  1.83k|    }
  284|  10.5k|    obj.free();
  285|  10.5k|    if (encrypted) {
  ------------------
  |  Branch (285:9): [True: 10.4k, False: 73]
  ------------------
  286|  10.4k|      str = new DecryptStream(str, fileKey, encAlgorithm, keyLength,
  287|  10.4k|			      objNum, objGen);
  288|  10.4k|    }
  289|  10.5k|  }
  290|       |
  291|       |  // get filters
  292|  94.7k|  str = str->addFilters(dict, recursion);
  293|       |
  294|  94.7k|  return str;
  295|  98.3k|}
_ZN6Parser5shiftEv:
  297|   141M|void Parser::shift() {
  298|   141M|  if (inlineImg > 0) {
  ------------------
  |  Branch (298:7): [True: 526k, False: 140M]
  ------------------
  299|   526k|    if (inlineImg < 2) {
  ------------------
  |  Branch (299:9): [True: 290k, False: 235k]
  ------------------
  300|   290k|      ++inlineImg;
  301|   290k|    } else {
  302|       |      // in a damaged content stream, if 'ID' shows up in the middle
  303|       |      // of a dictionary, we need to reset
  304|   235k|      inlineImg = 0;
  305|   235k|    }
  306|   140M|  } else if (buf2.isCmd("ID")) {
  ------------------
  |  Branch (306:14): [True: 291k, False: 140M]
  ------------------
  307|   291k|    lexer->skipChar();		// skip char after 'ID' command
  308|   291k|    inlineImg = 1;
  309|   291k|  }
  310|   141M|  buf1.free();
  311|   141M|  buf1 = buf2;
  312|   141M|  if (inlineImg > 0)		// don't buffer inline image data
  ------------------
  |  Branch (312:7): [True: 582k, False: 140M]
  ------------------
  313|   582k|    buf2.initNull();
  314|   140M|  else
  315|   140M|    lexer->getObj(&buf2);
  316|   141M|}

_ZN6Parser6getPosEv:
   50|  13.6M|  GFileOffset getPos() { return lexer->getPos(); }

_ZN15SecurityHandler4makeEP6PDFDocP6Object:
   24|    213|SecurityHandler *SecurityHandler::make(PDFDoc *docA, Object *encryptDictA) {
   25|    213|  Object filterObj;
   26|    213|  SecurityHandler *secHdlr;
   27|       |
   28|    213|  encryptDictA->dictLookup("Filter", &filterObj);
   29|    213|  if (filterObj.isName("Standard")) {
  ------------------
  |  Branch (29:7): [True: 211, False: 2]
  ------------------
   30|    211|    secHdlr = new StandardSecurityHandler(docA, encryptDictA);
   31|    211|  } else if (filterObj.isName()) {
  ------------------
  |  Branch (31:14): [True: 2, False: 0]
  ------------------
   32|      2|    error(errSyntaxError, -1, "Couldn't find the '{0:s}' security handler",
   33|      2|	  filterObj.getName());
   34|      2|    secHdlr = NULL;
   35|      2|  } else {
   36|      0|    error(errSyntaxError, -1,
   37|      0|	  "Missing or invalid 'Filter' entry in encryption dictionary");
   38|       |    secHdlr = NULL;
   39|      0|  }
   40|    213|  filterObj.free();
   41|    213|  return secHdlr;
   42|    213|}
_ZN15SecurityHandlerC2EP6PDFDoc:
   44|    211|SecurityHandler::SecurityHandler(PDFDoc *docA) {
   45|    211|  doc = docA;
   46|    211|}
_ZN15SecurityHandlerD2Ev:
   48|    211|SecurityHandler::~SecurityHandler() {
   49|    211|}
_ZN15SecurityHandler15checkEncryptionEP7GStringS1_:
   52|    209|				       GString *userPassword) {
   53|    209|  void *authData;
   54|    209|  GBool ok;
   55|    209|  int i;
   56|       |
   57|    209|  if (ownerPassword || userPassword) {
  ------------------
  |  Branch (57:7): [True: 0, False: 209]
  |  Branch (57:24): [True: 0, False: 209]
  ------------------
   58|      0|    authData = makeAuthData(ownerPassword, userPassword);
   59|    209|  } else {
   60|    209|    authData = NULL;
   61|    209|  }
   62|    209|  ok = authorize(authData);
   63|    209|  if (authData) {
  ------------------
  |  Branch (63:7): [True: 0, False: 209]
  ------------------
   64|      0|    freeAuthData(authData);
   65|      0|  }
   66|    209|  for (i = 0; !ok && i < 3; ++i) {
  ------------------
  |  Branch (66:15): [True: 26, False: 183]
  |  Branch (66:22): [True: 26, False: 0]
  ------------------
   67|     26|    if (!(authData = getAuthData())) {
  ------------------
  |  Branch (67:9): [True: 26, False: 0]
  ------------------
   68|     26|      break;
   69|     26|    }
   70|      0|    ok = authorize(authData);
   71|      0|    if (authData) {
  ------------------
  |  Branch (71:9): [True: 0, False: 0]
  ------------------
   72|      0|      freeAuthData(authData);
   73|      0|    }
   74|      0|  }
   75|    209|  if (!ok) {
  ------------------
  |  Branch (75:7): [True: 26, False: 183]
  ------------------
   76|     26|    error(errCommandLine, -1, "Incorrect password");
   77|     26|  }
   78|    209|  return ok;
   79|    209|}
_ZN23StandardSecurityHandlerC2EP6PDFDocP6Object:
  108|    211|  SecurityHandler(docA)
  109|    211|{
  110|    211|  Object versionObj, revisionObj, lengthObj;
  111|    211|  Object ownerKeyObj, userKeyObj, ownerEncObj, userEncObj;
  112|    211|  Object permObj, fileIDObj, fileIDObj1;
  113|    211|  Object cryptFiltersObj, streamFilterObj, stringFilterObj;
  114|    211|  Object cryptFilterObj, cfmObj, cfLengthObj;
  115|    211|  Object encryptMetadataObj;
  116|       |
  117|    211|  ok = gFalse;
  ------------------
  |  |   18|    211|#define gFalse 0
  ------------------
  118|    211|  fileID = NULL;
  119|    211|  ownerKey = NULL;
  120|    211|  userKey = NULL;
  121|    211|  ownerEnc = NULL;
  122|    211|  userEnc = NULL;
  123|    211|  fileKeyLength = 0;
  124|    211|  encVersion = -1;
  125|    211|  encRevision = -1;
  126|       |
  127|       |  //--- get the main parameters
  128|    211|  encryptDictA->dictLookup("V", &versionObj);
  129|    211|  encryptDictA->dictLookup("R", &revisionObj);
  130|    211|  encryptDictA->dictLookup("Length", &lengthObj);
  131|    211|  encryptDictA->dictLookup("O", &ownerKeyObj);
  132|    211|  encryptDictA->dictLookup("U", &userKeyObj);
  133|    211|  encryptDictA->dictLookup("OE", &ownerEncObj);
  134|    211|  encryptDictA->dictLookup("UE", &userEncObj);
  135|    211|  encryptDictA->dictLookup("P", &permObj);
  136|    211|  doc->getXRef()->getTrailerDict()->dictLookup("ID", &fileIDObj);
  137|    211|  if (!versionObj.isInt() ||
  ------------------
  |  Branch (137:7): [True: 2, False: 209]
  ------------------
  138|    209|      !revisionObj.isInt() ||
  ------------------
  |  Branch (138:7): [True: 0, False: 209]
  ------------------
  139|    209|      !permObj.isInt() ||
  ------------------
  |  Branch (139:7): [True: 0, False: 209]
  ------------------
  140|    209|      !ownerKeyObj.isString() ||
  ------------------
  |  Branch (140:7): [True: 0, False: 209]
  ------------------
  141|    209|      !userKeyObj.isString()) {
  ------------------
  |  Branch (141:7): [True: 0, False: 209]
  ------------------
  142|      2|    error(errSyntaxError, -1, "Invalid encryption parameters");
  143|      2|    goto done;
  144|      2|  }
  145|    209|  encVersion = versionObj.getInt();
  146|    209|  encRevision = revisionObj.getInt();
  147|    209|  encAlgorithm = cryptRC4;
  148|       |  // revision 2 forces a 40-bit key - some buggy PDF generators
  149|       |  // set the Length value incorrectly
  150|    209|  if (encRevision == 2 || !lengthObj.isInt()) {
  ------------------
  |  Branch (150:7): [True: 0, False: 209]
  |  Branch (150:27): [True: 50, False: 159]
  ------------------
  151|     50|    fileKeyLength = 5;
  152|    159|  } else {
  153|    159|    fileKeyLength = lengthObj.getInt() / 8;
  154|    159|  }
  155|    209|  encryptMetadata = gTrue;
  ------------------
  |  |   17|    209|#define gTrue 1
  ------------------
  156|       |
  157|       |  //--- check for a crypt filter (which can modify the parameters)
  158|       |  //~ this currently only handles a subset of crypt filter functionality
  159|       |  //~ (in particular, it ignores the EFF entry in encryptDictA, and
  160|       |  //~ doesn't handle the case where StmF, StrF, and EFF are not all the
  161|       |  //~ same)
  162|    209|  if ((encVersion == 4 || encVersion == 5) &&
  ------------------
  |  Branch (162:8): [True: 133, False: 76]
  |  Branch (162:27): [True: 76, False: 0]
  ------------------
  163|    209|      (encRevision == 4 || encRevision == 5 || encRevision == 6)) {
  ------------------
  |  Branch (163:8): [True: 57, False: 152]
  |  Branch (163:28): [True: 0, False: 152]
  |  Branch (163:48): [True: 152, False: 0]
  ------------------
  164|    209|    encryptDictA->dictLookup("CF", &cryptFiltersObj);
  165|    209|    encryptDictA->dictLookup("StmF", &streamFilterObj);
  166|    209|    encryptDictA->dictLookup("StrF", &stringFilterObj);
  167|    209|    if (cryptFiltersObj.isDict() &&
  ------------------
  |  Branch (167:9): [True: 206, False: 3]
  ------------------
  168|    206|	streamFilterObj.isName() &&
  ------------------
  |  Branch (168:2): [True: 197, False: 9]
  ------------------
  169|    197|	stringFilterObj.isName() &&
  ------------------
  |  Branch (169:2): [True: 195, False: 2]
  ------------------
  170|    195|	!strcmp(streamFilterObj.getName(), stringFilterObj.getName())) {
  ------------------
  |  Branch (170:2): [True: 187, False: 8]
  ------------------
  171|    187|      if (!strcmp(streamFilterObj.getName(), "Identity")) {
  ------------------
  |  Branch (171:11): [True: 0, False: 187]
  ------------------
  172|       |	// no encryption on streams or strings
  173|      0|	stringFilterObj.free();
  174|      0|	streamFilterObj.free();
  175|      0|	cryptFiltersObj.free();
  176|      0|	goto done;
  177|      0|      }
  178|    187|      if (cryptFiltersObj.dictLookup(streamFilterObj.getName(),
  ------------------
  |  Branch (178:11): [True: 159, False: 28]
  ------------------
  179|    187|				     &cryptFilterObj)->isDict()) {
  180|    159|	cryptFilterObj.dictLookup("CFM", &cfmObj);
  181|    159|	if (cfmObj.isName("V2")) {
  ------------------
  |  Branch (181:6): [True: 2, False: 157]
  ------------------
  182|      2|	  if (cryptFilterObj.dictLookup("Length",
  ------------------
  |  Branch (182:8): [True: 1, False: 1]
  ------------------
  183|      2|					&cfLengthObj)->isInt()) {
  184|      1|	    fileKeyLength = cfLengthObj.getInt();
  185|      1|	  }
  186|      2|	  cfLengthObj.free();
  187|      2|	  encVersion = 2;
  188|      2|	  encRevision = 3;
  189|    157|	} else if (cfmObj.isName("AESV2")) {
  ------------------
  |  Branch (189:13): [True: 54, False: 103]
  ------------------
  190|     54|	  if (cryptFilterObj.dictLookup("Length",
  ------------------
  |  Branch (190:8): [True: 16, False: 38]
  ------------------
  191|     54|					&cfLengthObj)->isInt()) {
  192|     16|	    fileKeyLength = cfLengthObj.getInt();
  193|     16|	  }
  194|     54|	  cfLengthObj.free();
  195|     54|	  encVersion = 2;
  196|     54|	  encRevision = 3;
  197|     54|	  encAlgorithm = cryptAES;
  198|    103|	} else if (cfmObj.isName("AESV3")) {
  ------------------
  |  Branch (198:13): [True: 95, False: 8]
  ------------------
  199|     95|	  if (cryptFilterObj.dictLookup("Length",
  ------------------
  |  Branch (199:8): [True: 2, False: 93]
  ------------------
  200|     95|					&cfLengthObj)->isInt()) {
  201|      2|	    fileKeyLength = cfLengthObj.getInt();
  202|      2|	  }
  203|     95|	  cfLengthObj.free();
  204|     95|	  encVersion = 5;
  205|     95|	  if (encRevision != 5 && encRevision != 6) {
  ------------------
  |  Branch (205:8): [True: 95, False: 0]
  |  Branch (205:28): [True: 0, False: 95]
  ------------------
  206|      0|	    encRevision = 6;
  207|      0|	  }
  208|     95|	  encAlgorithm = cryptAES256;
  209|       |	  // The PDF 2.0 spec says Length and CF.Length are both deprecated.
  210|       |	  // Acrobat X honors Length and ignores CF.Length.
  211|       |	  // I think it's safest to ignore both.
  212|     95|	  fileKeyLength = 32;
  213|     95|	}
  214|    159|	cfmObj.free();
  215|    159|      }
  216|    187|      cryptFilterObj.free();
  217|    187|    }
  218|    209|    stringFilterObj.free();
  219|    209|    streamFilterObj.free();
  220|    209|    cryptFiltersObj.free();
  221|    209|    if (encryptDictA->dictLookup("EncryptMetadata",
  ------------------
  |  Branch (221:9): [True: 0, False: 209]
  ------------------
  222|    209|				 &encryptMetadataObj)->isBool()) {
  223|      0|      encryptMetadata = encryptMetadataObj.getBool();
  224|      0|    }
  225|    209|    encryptMetadataObj.free();
  226|    209|  }
  227|       |
  228|       |  //--- version-specific parameters
  229|    209|  if (encRevision <= 4) {
  ------------------
  |  Branch (229:7): [True: 57, False: 152]
  ------------------
  230|     57|    if (ownerKeyObj.getString()->getLength() != 32 ||
  ------------------
  |  Branch (230:9): [True: 10, False: 47]
  ------------------
  231|     47|	userKeyObj.getString()->getLength() != 32) {
  ------------------
  |  Branch (231:2): [True: 8, False: 39]
  ------------------
  232|     18|      error(errSyntaxError, -1, "Invalid encryption key length");
  233|       |      // this is non-fatal -- see below
  234|     18|    }
  235|    152|  } else if (encRevision <= 6) {
  ------------------
  |  Branch (235:14): [True: 152, False: 0]
  ------------------
  236|       |    // the spec says 48 bytes, but Acrobat pads them out longer
  237|    152|    if (ownerKeyObj.getString()->getLength() < 48 ||
  ------------------
  |  Branch (237:9): [True: 0, False: 152]
  ------------------
  238|    152|	userKeyObj.getString()->getLength() < 48 ||
  ------------------
  |  Branch (238:2): [True: 2, False: 150]
  ------------------
  239|    150|	!ownerEncObj.isString() ||
  ------------------
  |  Branch (239:2): [True: 0, False: 150]
  ------------------
  240|    150|	ownerEncObj.getString()->getLength() != 32 ||
  ------------------
  |  Branch (240:2): [True: 0, False: 150]
  ------------------
  241|    150|	!userEncObj.isString() ||
  ------------------
  |  Branch (241:2): [True: 1, False: 149]
  ------------------
  242|    149|	userEncObj.getString()->getLength() != 32) {
  ------------------
  |  Branch (242:2): [True: 0, False: 149]
  ------------------
  243|      3|      error(errSyntaxError, -1, "Invalid encryption key length");
  244|      3|      goto done;
  245|      3|    }
  246|    152|  }
  247|    206|  permFlags = permObj.getInt();
  248|    206|  ownerKey = ownerKeyObj.getString()->copy();
  249|    206|  userKey = userKeyObj.getString()->copy();
  250|    206|  if (encRevision <= 4) {
  ------------------
  |  Branch (250:7): [True: 57, False: 149]
  ------------------
  251|       |    // Adobe apparently zero-pads the U value (and maybe the O value?)
  252|       |    // if it's short
  253|    121|    while (ownerKey->getLength() < 32) {
  ------------------
  |  Branch (253:12): [True: 64, False: 57]
  ------------------
  254|     64|      ownerKey->append((char)0x00);
  255|     64|    }
  256|     92|    while (userKey->getLength() < 32) {
  ------------------
  |  Branch (256:12): [True: 35, False: 57]
  ------------------
  257|     35|      userKey->append((char)0x00);
  258|     35|    }
  259|     57|  }
  260|    206|  if (encVersion >= 1 && encVersion <= 2 &&
  ------------------
  |  Branch (260:7): [True: 206, False: 0]
  |  Branch (260:26): [True: 56, False: 150]
  ------------------
  261|     56|      encRevision >= 2 && encRevision <= 3) {
  ------------------
  |  Branch (261:7): [True: 56, False: 0]
  |  Branch (261:27): [True: 56, False: 0]
  ------------------
  262|     56|    if (fileIDObj.isArray()) {
  ------------------
  |  Branch (262:9): [True: 56, False: 0]
  ------------------
  263|     56|      if (fileIDObj.arrayGet(0, &fileIDObj1)->isString()) {
  ------------------
  |  Branch (263:11): [True: 56, False: 0]
  ------------------
  264|     56|	fileID = fileIDObj1.getString()->copy();
  265|     56|      } else {
  266|      0|	fileID = new GString();
  267|      0|      }
  268|     56|      fileIDObj1.free();
  269|     56|    } else {
  270|      0|      fileID = new GString();
  271|      0|    }
  272|     56|    if (fileKeyLength > 16 || fileKeyLength <= 0) {
  ------------------
  |  Branch (272:9): [True: 1, False: 55]
  |  Branch (272:31): [True: 0, False: 55]
  ------------------
  273|      1|      fileKeyLength = 16;
  274|      1|    }
  275|     56|    ok = gTrue;
  ------------------
  |  |   17|     56|#define gTrue 1
  ------------------
  276|    150|  } else if (encVersion == 5 && (encRevision == 5 || encRevision == 6)) {
  ------------------
  |  Branch (276:14): [True: 146, False: 4]
  |  Branch (276:34): [True: 0, False: 146]
  |  Branch (276:54): [True: 146, False: 0]
  ------------------
  277|    146|    fileID = new GString(); // unused for V=R=5
  278|    146|    ownerEnc = ownerEncObj.getString()->copy();
  279|    146|    userEnc = userEncObj.getString()->copy();
  280|    146|    if (fileKeyLength > 32 || fileKeyLength <= 0) {
  ------------------
  |  Branch (280:9): [True: 7, False: 139]
  |  Branch (280:31): [True: 4, False: 135]
  ------------------
  281|     11|      fileKeyLength = 32;
  282|     11|    }
  283|    146|    ok = gTrue;
  ------------------
  |  |   17|    146|#define gTrue 1
  ------------------
  284|    146|  } else {
  285|      4|    error(errUnimplemented, -1,
  286|      4|	  "Unsupported version/revision ({0:d}/{1:d}) of Standard security handler",
  287|      4|	  encVersion, encRevision);
  288|      4|  }
  289|       |
  290|    211| done:
  291|    211|  fileIDObj.free();
  292|    211|  permObj.free();
  293|    211|  userEncObj.free();
  294|    211|  ownerEncObj.free();
  295|    211|  userKeyObj.free();
  296|    211|  ownerKeyObj.free();
  297|    211|  lengthObj.free();
  298|    211|  revisionObj.free();
  299|    211|  versionObj.free();
  300|    211|}
_ZN23StandardSecurityHandlerD2Ev:
  302|    211|StandardSecurityHandler::~StandardSecurityHandler() {
  303|    211|  if (fileID) {
  ------------------
  |  Branch (303:7): [True: 202, False: 9]
  ------------------
  304|    202|    delete fileID;
  305|    202|  }
  306|    211|  if (ownerKey) {
  ------------------
  |  Branch (306:7): [True: 206, False: 5]
  ------------------
  307|    206|    delete ownerKey;
  308|    206|  }
  309|    211|  if (userKey) {
  ------------------
  |  Branch (309:7): [True: 206, False: 5]
  ------------------
  310|    206|    delete userKey;
  311|    206|  }
  312|    211|  if (ownerEnc) {
  ------------------
  |  Branch (312:7): [True: 146, False: 65]
  ------------------
  313|    146|    delete ownerEnc;
  314|    146|  }
  315|    211|  if (userEnc) {
  ------------------
  |  Branch (315:7): [True: 146, False: 65]
  ------------------
  316|    146|    delete userEnc;
  317|    146|  }
  318|    211|}
_ZN23StandardSecurityHandler13isUnencryptedEv:
  320|    211|GBool StandardSecurityHandler::isUnencrypted() {
  321|    211|  return encVersion == -1 && encRevision == -1;
  ------------------
  |  Branch (321:10): [True: 2, False: 209]
  |  Branch (321:30): [True: 2, False: 0]
  ------------------
  322|    211|}
_ZN23StandardSecurityHandler11getAuthDataEv:
  332|     26|void *StandardSecurityHandler::getAuthData() {
  333|     26|  PDFCore *core;
  334|     26|  GString *password;
  335|       |
  336|     26|  if (!(core = doc->getCore()) ||
  ------------------
  |  Branch (336:7): [True: 26, False: 0]
  ------------------
  337|     26|      !(password = core->getPassword())) {
  ------------------
  |  Branch (337:7): [True: 0, False: 0]
  ------------------
  338|     26|    return NULL;
  339|     26|  }
  340|      0|  return new StandardAuthData(password, password->copy());
  341|     26|}
_ZN23StandardSecurityHandler9authorizeEPv:
  347|    209|GBool StandardSecurityHandler::authorize(void *authData) {
  348|    209|  GString *ownerPassword, *userPassword;
  349|       |
  350|    209|  if (!ok) {
  ------------------
  |  Branch (350:7): [True: 7, False: 202]
  ------------------
  351|      7|    return gFalse;
  ------------------
  |  |   18|      7|#define gFalse 0
  ------------------
  352|      7|  }
  353|    202|  if (authData) {
  ------------------
  |  Branch (353:7): [True: 0, False: 202]
  ------------------
  354|      0|    ownerPassword = ((StandardAuthData *)authData)->ownerPassword;
  355|      0|    userPassword = ((StandardAuthData *)authData)->userPassword;
  356|    202|  } else {
  357|    202|    ownerPassword = NULL;
  358|    202|    userPassword = NULL;
  359|    202|  }
  360|    202|  if (!Decrypt::makeFileKey(encVersion, encRevision, fileKeyLength,
  ------------------
  |  Branch (360:7): [True: 19, False: 183]
  ------------------
  361|    202|			    ownerKey, userKey, ownerEnc, userEnc,
  362|    202|			    permFlags, fileID,
  363|    202|			    ownerPassword, userPassword, fileKey,
  364|    202|			    encryptMetadata, &ownerPasswordOk)) {
  365|     19|    return gFalse;
  ------------------
  |  |   18|     19|#define gFalse 0
  ------------------
  366|     19|  }
  367|    183|  return gTrue;
  ------------------
  |  |   17|    183|#define gTrue 1
  ------------------
  368|    202|}

_ZN23StandardSecurityHandler18getPermissionFlagsEv:
   99|    183|  virtual int getPermissionFlags() { return permFlags; }
_ZN23StandardSecurityHandler18getOwnerPasswordOkEv:
  100|    183|  virtual GBool getOwnerPasswordOk() { return ownerPasswordOk; }
_ZN23StandardSecurityHandler10getFileKeyEv:
  101|    183|  virtual Guchar *getFileKey() { return fileKey; }
_ZN23StandardSecurityHandler16getFileKeyLengthEv:
  102|    183|  virtual int getFileKeyLength() { return fileKeyLength; }
_ZN23StandardSecurityHandler13getEncVersionEv:
  103|    183|  virtual int getEncVersion() { return encVersion; }
_ZN23StandardSecurityHandler15getEncAlgorithmEv:
  104|    183|  virtual CryptAlgorithm getEncAlgorithm() { return encAlgorithm; }

_ZN6StreamC2Ev:
   62|  2.61M|Stream::Stream() {
   63|  2.61M|}
_ZN6StreamD2Ev:
   65|  2.57M|Stream::~Stream() {
   66|  2.57M|}
_ZN6Stream5closeEv:
   68|  40.7k|void Stream::close() {
   69|  40.7k|}
_ZN6Stream8getBlockEPci:
   76|   308k|int Stream::getBlock(char *buf, int size) {
   77|   308k|  int n, c;
   78|       |
   79|   308k|  n = 0;
   80|   195M|  while (n < size) {
  ------------------
  |  Branch (80:10): [True: 195M, False: 297k]
  ------------------
   81|   195M|    if ((c = getChar()) == EOF) {
  ------------------
  |  Branch (81:9): [True: 11.1k, False: 195M]
  ------------------
   82|  11.1k|      break;
   83|  11.1k|    }
   84|   195M|    buf[n++] = (char)c;
   85|   195M|  }
   86|   308k|  return n;
   87|   308k|}
_ZN6Stream12discardCharsEj:
  110|   436k|Guint Stream::discardChars(Guint n) {
  111|   436k|  char buf[4096];
  112|   436k|  Guint count, i, j;
  113|       |
  114|   436k|  count = 0;
  115|   825k|  while (count < n) {
  ------------------
  |  Branch (115:10): [True: 414k, False: 411k]
  ------------------
  116|   414k|    if ((i = n - count) > sizeof(buf)) {
  ------------------
  |  Branch (116:9): [True: 57.7k, False: 356k]
  ------------------
  117|  57.7k|      i = (Guint)sizeof(buf);
  118|  57.7k|    }
  119|   414k|    j = (Guint)getBlock(buf, (int)i);
  120|   414k|    count += j;
  121|   414k|    if (j != i) {
  ------------------
  |  Branch (121:9): [True: 25.6k, False: 389k]
  ------------------
  122|  25.6k|      break;
  123|  25.6k|    }
  124|   414k|  }
  125|   436k|  return count;
  126|   436k|}
_ZN6Stream10addFiltersEP6Objecti:
  133|  94.7k|Stream *Stream::addFilters(Object *dict, int recursion) {
  134|  94.7k|  Object obj, obj2;
  135|  94.7k|  Object params, params2;
  136|  94.7k|  Stream *str;
  137|  94.7k|  GBool ok;
  138|  94.7k|  int i;
  139|       |
  140|  94.7k|  str = this;
  141|  94.7k|  dict->dictLookup("Filter", &obj, recursion);
  142|  94.7k|  if (obj.isNull()) {
  ------------------
  |  Branch (142:7): [True: 30.3k, False: 64.3k]
  ------------------
  143|  30.3k|    obj.free();
  144|  30.3k|    dict->dictLookup("F", &obj, recursion);
  145|  30.3k|  }
  146|  94.7k|  dict->dictLookup("DecodeParms", &params, recursion);
  147|  94.7k|  if (params.isNull()) {
  ------------------
  |  Branch (147:7): [True: 85.7k, False: 8.98k]
  ------------------
  148|  85.7k|    params.free();
  149|  85.7k|    dict->dictLookup("DP", &params, recursion);
  150|  85.7k|  }
  151|  94.7k|  ok = gTrue;
  ------------------
  |  |   17|  94.7k|#define gTrue 1
  ------------------
  152|  94.7k|  if (obj.isName()) {
  ------------------
  |  Branch (152:7): [True: 48.4k, False: 46.3k]
  ------------------
  153|  48.4k|    str = makeFilter(obj.getName(), str, &params, recursion, &ok);
  154|  48.4k|  } else if (obj.isArray()) {
  ------------------
  |  Branch (154:14): [True: 17.7k, False: 28.5k]
  ------------------
  155|  40.3k|    for (i = 0; ok && i < obj.arrayGetLength(); ++i) {
  ------------------
  |  Branch (155:17): [True: 36.4k, False: 3.91k]
  |  Branch (155:23): [True: 22.5k, False: 13.8k]
  ------------------
  156|  22.5k|      obj.arrayGet(i, &obj2, recursion);
  157|  22.5k|      if (params.isArray() && i < params.arrayGetLength()) {
  ------------------
  |  Branch (157:11): [True: 74, False: 22.4k]
  |  Branch (157:31): [True: 41, False: 33]
  ------------------
  158|     41|	params.arrayGet(i, &params2, recursion);
  159|  22.5k|      } else {
  160|  22.5k|	params2.initNull();
  161|  22.5k|      }
  162|  22.5k|      if (obj2.isName()) {
  ------------------
  |  Branch (162:11): [True: 19.4k, False: 3.15k]
  ------------------
  163|  19.4k|	str = makeFilter(obj2.getName(), str, &params2, recursion, &ok);
  164|  19.4k|      } else {
  165|  3.15k|	error(errSyntaxError, getPos(), "Bad filter name");
  166|  3.15k|	str = new EOFStream(str);
  167|  3.15k|	ok = gFalse;
  ------------------
  |  |   18|  3.15k|#define gFalse 0
  ------------------
  168|  3.15k|      }
  169|  22.5k|      obj2.free();
  170|  22.5k|      params2.free();
  171|  22.5k|    }
  172|  28.5k|  } else if (!obj.isNull()) {
  ------------------
  |  Branch (172:14): [True: 1.57k, False: 26.9k]
  ------------------
  173|  1.57k|    error(errSyntaxError, getPos(), "Bad 'Filter' attribute in stream");
  174|  1.57k|  }
  175|  94.7k|  obj.free();
  176|  94.7k|  params.free();
  177|       |
  178|  94.7k|  return str;
  179|  94.7k|}
_ZN6Stream10makeFilterEPcPS_P6ObjectiPi:
  182|  67.8k|			   int recursion, GBool *ok) {
  183|  67.8k|  int pred;			// parameters
  184|  67.8k|  int colors;
  185|  67.8k|  int bits;
  186|  67.8k|  int early;
  187|  67.8k|  int encoding;
  188|  67.8k|  GBool endOfLine, byteAlign, endOfBlock, black;
  189|  67.8k|  int columns, rows;
  190|  67.8k|  int colorXform;
  191|  67.8k|  Object globals, obj;
  192|       |
  193|  67.8k|  if (!strcmp(name, "ASCIIHexDecode") || !strcmp(name, "AHx")) {
  ------------------
  |  Branch (193:7): [True: 149, False: 67.6k]
  |  Branch (193:42): [True: 852, False: 66.8k]
  ------------------
  194|  1.00k|    str = new ASCIIHexStream(str);
  195|  66.8k|  } else if (!strcmp(name, "ASCII85Decode") || !strcmp(name, "A85")) {
  ------------------
  |  Branch (195:14): [True: 3.12k, False: 63.7k]
  |  Branch (195:48): [True: 547, False: 63.1k]
  ------------------
  196|  3.66k|    str = new ASCII85Stream(str);
  197|  63.1k|  } else if (!strcmp(name, "LZWDecode") || !strcmp(name, "LZW")) {
  ------------------
  |  Branch (197:14): [True: 291, False: 62.8k]
  |  Branch (197:44): [True: 1.16k, False: 61.7k]
  ------------------
  198|  1.45k|    pred = 1;
  199|  1.45k|    columns = 1;
  200|  1.45k|    colors = 1;
  201|  1.45k|    bits = 8;
  202|  1.45k|    early = 1;
  203|  1.45k|    if (params->isDict()) {
  ------------------
  |  Branch (203:9): [True: 496, False: 955]
  ------------------
  204|    496|      params->dictLookup("Predictor", &obj, recursion);
  205|    496|      if (obj.isInt())
  ------------------
  |  Branch (205:11): [True: 311, False: 185]
  ------------------
  206|    311|	pred = obj.getInt();
  207|    496|      obj.free();
  208|    496|      params->dictLookup("Columns", &obj, recursion);
  209|    496|      if (obj.isInt())
  ------------------
  |  Branch (209:11): [True: 314, False: 182]
  ------------------
  210|    314|	columns = obj.getInt();
  211|    496|      obj.free();
  212|    496|      params->dictLookup("Colors", &obj, recursion);
  213|    496|      if (obj.isInt())
  ------------------
  |  Branch (213:11): [True: 45, False: 451]
  ------------------
  214|     45|	colors = obj.getInt();
  215|    496|      obj.free();
  216|    496|      params->dictLookup("BitsPerComponent", &obj, recursion);
  217|    496|      if (obj.isInt())
  ------------------
  |  Branch (217:11): [True: 284, False: 212]
  ------------------
  218|    284|	bits = obj.getInt();
  219|    496|      obj.free();
  220|    496|      params->dictLookup("EarlyChange", &obj, recursion);
  221|    496|      if (obj.isInt())
  ------------------
  |  Branch (221:11): [True: 35, False: 461]
  ------------------
  222|     35|	early = obj.getInt();
  223|    496|      obj.free();
  224|    496|    }
  225|  1.45k|    str = new LZWStream(str, pred, columns, colors, bits, early);
  226|  61.7k|  } else if (!strcmp(name, "RunLengthDecode") || !strcmp(name, "RL")) {
  ------------------
  |  Branch (226:14): [True: 236, False: 61.4k]
  |  Branch (226:50): [True: 800, False: 60.6k]
  ------------------
  227|  1.03k|    str = new RunLengthStream(str);
  228|  60.6k|  } else if (!strcmp(name, "CCITTFaxDecode") || !strcmp(name, "CCF")) {
  ------------------
  |  Branch (228:14): [True: 1.49k, False: 59.1k]
  |  Branch (228:49): [True: 1.01k, False: 58.1k]
  ------------------
  229|  2.50k|    encoding = 0;
  230|  2.50k|    endOfLine = gFalse;
  ------------------
  |  |   18|  2.50k|#define gFalse 0
  ------------------
  231|  2.50k|    byteAlign = gFalse;
  ------------------
  |  |   18|  2.50k|#define gFalse 0
  ------------------
  232|  2.50k|    columns = 1728;
  233|  2.50k|    rows = 0;
  234|  2.50k|    endOfBlock = gTrue;
  ------------------
  |  |   17|  2.50k|#define gTrue 1
  ------------------
  235|  2.50k|    black = gFalse;
  ------------------
  |  |   18|  2.50k|#define gFalse 0
  ------------------
  236|  2.50k|    if (params->isDict()) {
  ------------------
  |  Branch (236:9): [True: 1.62k, False: 886]
  ------------------
  237|  1.62k|      params->dictLookup("K", &obj, recursion);
  238|  1.62k|      if (obj.isInt()) {
  ------------------
  |  Branch (238:11): [True: 154, False: 1.46k]
  ------------------
  239|    154|	encoding = obj.getInt();
  240|    154|      }
  241|  1.62k|      obj.free();
  242|  1.62k|      params->dictLookup("EndOfLine", &obj, recursion);
  243|  1.62k|      if (obj.isBool()) {
  ------------------
  |  Branch (243:11): [True: 0, False: 1.62k]
  ------------------
  244|      0|	endOfLine = obj.getBool();
  245|      0|      }
  246|  1.62k|      obj.free();
  247|  1.62k|      params->dictLookup("EncodedByteAlign", &obj, recursion);
  248|  1.62k|      if (obj.isBool()) {
  ------------------
  |  Branch (248:11): [True: 0, False: 1.62k]
  ------------------
  249|      0|	byteAlign = obj.getBool();
  250|      0|      }
  251|  1.62k|      obj.free();
  252|  1.62k|      params->dictLookup("Columns", &obj, recursion);
  253|  1.62k|      if (obj.isInt()) {
  ------------------
  |  Branch (253:11): [True: 714, False: 909]
  ------------------
  254|    714|	columns = obj.getInt();
  255|    714|      }
  256|  1.62k|      obj.free();
  257|  1.62k|      params->dictLookup("Rows", &obj, recursion);
  258|  1.62k|      if (obj.isInt()) {
  ------------------
  |  Branch (258:11): [True: 301, False: 1.32k]
  ------------------
  259|    301|	rows = obj.getInt();
  260|    301|      }
  261|  1.62k|      obj.free();
  262|  1.62k|      params->dictLookup("EndOfBlock", &obj, recursion);
  263|  1.62k|      if (obj.isBool()) {
  ------------------
  |  Branch (263:11): [True: 96, False: 1.52k]
  ------------------
  264|     96|	endOfBlock = obj.getBool();
  265|     96|      }
  266|  1.62k|      obj.free();
  267|  1.62k|      params->dictLookup("BlackIs1", &obj, recursion);
  268|  1.62k|      if (obj.isBool()) {
  ------------------
  |  Branch (268:11): [True: 1.04k, False: 578]
  ------------------
  269|  1.04k|	black = obj.getBool();
  270|  1.04k|      }
  271|  1.62k|      obj.free();
  272|  1.62k|    }
  273|  2.50k|    str = new CCITTFaxStream(str, encoding, endOfLine, byteAlign,
  274|  2.50k|			     columns, rows, endOfBlock, black);
  275|  58.1k|  } else if (!strcmp(name, "DCTDecode") || !strcmp(name, "DCT")) {
  ------------------
  |  Branch (275:14): [True: 829, False: 57.3k]
  |  Branch (275:44): [True: 1.53k, False: 55.8k]
  ------------------
  276|  2.36k|    colorXform = -1;
  277|  2.36k|    if (params->isDict()) {
  ------------------
  |  Branch (277:9): [True: 15, False: 2.35k]
  ------------------
  278|     15|      if (params->dictLookup("ColorTransform", &obj, recursion)->isInt()) {
  ------------------
  |  Branch (278:11): [True: 0, False: 15]
  ------------------
  279|      0|	colorXform = obj.getInt();
  280|      0|      }
  281|     15|      obj.free();
  282|     15|    }
  283|  2.36k|    str = new DCTStream(str, colorXform);
  284|  55.8k|  } else if (!strcmp(name, "FlateDecode") || !strcmp(name, "Fl")) {
  ------------------
  |  Branch (284:14): [True: 40.2k, False: 15.5k]
  |  Branch (284:46): [True: 619, False: 14.9k]
  ------------------
  285|  40.8k|    pred = 1;
  286|  40.8k|    columns = 1;
  287|  40.8k|    colors = 1;
  288|  40.8k|    bits = 8;
  289|  40.8k|    if (params->isDict()) {
  ------------------
  |  Branch (289:9): [True: 3.07k, False: 37.7k]
  ------------------
  290|  3.07k|      params->dictLookup("Predictor", &obj, recursion);
  291|  3.07k|      if (obj.isInt())
  ------------------
  |  Branch (291:11): [True: 3.00k, False: 67]
  ------------------
  292|  3.00k|	pred = obj.getInt();
  293|  3.07k|      obj.free();
  294|  3.07k|      params->dictLookup("Columns", &obj, recursion);
  295|  3.07k|      if (obj.isInt())
  ------------------
  |  Branch (295:11): [True: 2.75k, False: 318]
  ------------------
  296|  2.75k|	columns = obj.getInt();
  297|  3.07k|      obj.free();
  298|  3.07k|      params->dictLookup("Colors", &obj, recursion);
  299|  3.07k|      if (obj.isInt())
  ------------------
  |  Branch (299:11): [True: 920, False: 2.15k]
  ------------------
  300|    920|	colors = obj.getInt();
  301|  3.07k|      obj.free();
  302|  3.07k|      params->dictLookup("BitsPerComponent", &obj, recursion);
  303|  3.07k|      if (obj.isInt())
  ------------------
  |  Branch (303:11): [True: 13, False: 3.06k]
  ------------------
  304|     13|	bits = obj.getInt();
  305|  3.07k|      obj.free();
  306|  3.07k|    }
  307|  40.8k|    str = new FlateStream(str, pred, columns, colors, bits);
  308|  40.8k|  } else if (!strcmp(name, "JBIG2Decode")) {
  ------------------
  |  Branch (308:14): [True: 5.31k, False: 9.63k]
  ------------------
  309|  5.31k|    if (params->isDict()) {
  ------------------
  |  Branch (309:9): [True: 1.76k, False: 3.55k]
  ------------------
  310|  1.76k|      params->dictLookup("JBIG2Globals", &globals, recursion);
  311|  1.76k|    }
  312|  5.31k|    str = new JBIG2Stream(str, &globals);
  313|  5.31k|    globals.free();
  314|  9.63k|  } else if (!strcmp(name, "JPXDecode")) {
  ------------------
  |  Branch (314:14): [True: 2.31k, False: 7.31k]
  ------------------
  315|  2.31k|    str = new JPXStream(str);
  316|  7.31k|  } else if (!strcmp(name, "Crypt")) {
  ------------------
  |  Branch (316:14): [True: 438, False: 6.88k]
  ------------------
  317|       |    // this is handled in Parser::makeStream()
  318|  6.88k|  } else {
  319|  6.88k|    error(errSyntaxError, getPos(), "Unknown filter '{0:s}'", name);
  320|  6.88k|    str = new EOFStream(str);
  321|  6.88k|    *ok = gFalse;
  ------------------
  |  |   18|  6.88k|#define gFalse 0
  ------------------
  322|  6.88k|  }
  323|  67.8k|  return str;
  324|  67.8k|}
_ZN10BaseStreamC2EP6Object:
  330|  1.42M|BaseStream::BaseStream(Object *dictA) {
  331|  1.42M|  dict = *dictA;
  332|  1.42M|}
_ZN10BaseStreamD2Ev:
  334|  1.40M|BaseStream::~BaseStream() {
  335|  1.40M|  dict.free();
  336|  1.40M|}
_ZN12FilterStreamC2EP6Stream:
  342|  1.18M|FilterStream::FilterStream(Stream *strA) {
  343|  1.18M|  str = strA;
  344|  1.18M|}
_ZN12FilterStream5closeEv:
  349|   882k|void FilterStream::close() {
  350|   882k|  str->close();
  351|   882k|}
_ZN15StreamPredictorC2EP6Streamiiii:
  477|  9.83k|				 int widthA, int nCompsA, int nBitsA) {
  478|  9.83k|  str = strA;
  479|  9.83k|  predictor = predictorA;
  480|  9.83k|  width = widthA;
  481|  9.83k|  nComps = nCompsA;
  482|  9.83k|  nBits = nBitsA;
  483|  9.83k|  predLine = NULL;
  484|  9.83k|  ok = gFalse;
  ------------------
  |  |   18|  9.83k|#define gFalse 0
  ------------------
  485|       |
  486|  9.83k|  nVals = width * nComps;
  487|  9.83k|  pixBytes = (nComps * nBits + 7) >> 3;
  488|  9.83k|  rowBytes = ((nVals * nBits + 7) >> 3) + pixBytes;
  489|  9.83k|  if (width <= 0 || nComps <= 0 || nBits <= 0 ||
  ------------------
  |  Branch (489:7): [True: 264, False: 9.57k]
  |  Branch (489:21): [True: 222, False: 9.35k]
  |  Branch (489:36): [True: 253, False: 9.09k]
  ------------------
  490|  9.09k|      nComps > gfxColorMaxComps ||
  ------------------
  |  |  111|  9.09k|#define gfxColorMaxComps funcMaxOutputs
  |  |  ------------------
  |  |  |  |   27|  18.9k|#define funcMaxOutputs       32
  |  |  ------------------
  ------------------
  |  Branch (490:7): [True: 21, False: 9.07k]
  ------------------
  491|  9.07k|      nBits > 16 ||
  ------------------
  |  Branch (491:7): [True: 0, False: 9.07k]
  ------------------
  492|  9.07k|      width >= INT_MAX / nComps ||      // check for overflow in nVals 
  ------------------
  |  Branch (492:7): [True: 447, False: 8.63k]
  ------------------
  493|  8.63k|      nVals >= (INT_MAX - 7) / nBits) { // check for overflow in rowBytes
  ------------------
  |  Branch (493:7): [True: 484, False: 8.14k]
  ------------------
  494|  1.69k|    return;
  495|  1.69k|  }
  496|  8.14k|  predLine = (Guchar *)gmalloc(rowBytes);
  497|       |
  498|  8.14k|  reset();
  499|       |
  500|  8.14k|  ok = gTrue;
  ------------------
  |  |   17|  8.14k|#define gTrue 1
  ------------------
  501|  8.14k|}
_ZN15StreamPredictorD2Ev:
  503|  9.38k|StreamPredictor::~StreamPredictor() {
  504|  9.38k|  gfree(predLine);
  505|  9.38k|}
_ZN15StreamPredictor5resetEv:
  507|  10.2k|void StreamPredictor::reset() {
  508|  10.2k|  memset(predLine, 0, rowBytes);
  509|  10.2k|  predIdx = rowBytes;
  510|  10.2k|}
_ZN15StreamPredictor8lookCharEv:
  512|  49.7k|int StreamPredictor::lookChar() {
  513|  49.7k|  if (predIdx >= rowBytes) {
  ------------------
  |  Branch (513:7): [True: 10.8k, False: 38.9k]
  ------------------
  514|  10.8k|    if (!getNextLine()) {
  ------------------
  |  Branch (514:9): [True: 971, False: 9.83k]
  ------------------
  515|    971|      return EOF;
  516|    971|    }
  517|  10.8k|  }
  518|  48.7k|  return predLine[predIdx];
  519|  49.7k|}
_ZN15StreamPredictor7getCharEv:
  521|  1.97M|int StreamPredictor::getChar() {
  522|  1.97M|  if (predIdx >= rowBytes) {
  ------------------
  |  Branch (522:7): [True: 1.13M, False: 831k]
  ------------------
  523|  1.13M|    if (!getNextLine()) {
  ------------------
  |  Branch (523:9): [True: 1.25k, False: 1.13M]
  ------------------
  524|  1.25k|      return EOF;
  525|  1.25k|    }
  526|  1.13M|  }
  527|  1.96M|  return predLine[predIdx++];
  528|  1.97M|}
_ZN15StreamPredictor8getBlockEPci:
  530|  2.11k|int StreamPredictor::getBlock(char *blk, int size) {
  531|  2.11k|  int n, m;
  532|       |
  533|  2.11k|  n = 0;
  534|  1.55M|  while (n < size) {
  ------------------
  |  Branch (534:10): [True: 1.55M, False: 1.84k]
  ------------------
  535|  1.55M|    if (predIdx >= rowBytes) {
  ------------------
  |  Branch (535:9): [True: 1.54M, False: 1.63k]
  ------------------
  536|  1.54M|      if (!getNextLine()) {
  ------------------
  |  Branch (536:11): [True: 269, False: 1.54M]
  ------------------
  537|    269|	break;
  538|    269|      }
  539|  1.54M|    }
  540|  1.54M|    m = rowBytes - predIdx;
  541|  1.54M|    if (m > size - n) {
  ------------------
  |  Branch (541:9): [True: 1.51k, False: 1.54M]
  ------------------
  542|  1.51k|      m = size - n;
  543|  1.51k|    }
  544|  1.54M|    memcpy(blk + n, predLine + predIdx, m);
  545|  1.54M|    predIdx += m;
  546|  1.54M|    n += m;
  547|  1.54M|  }
  548|  2.11k|  return n;
  549|  2.11k|}
_ZN15StreamPredictor11getNextLineEv:
  551|  2.69M|GBool StreamPredictor::getNextLine() {
  552|  2.69M|  int curPred;
  553|  2.69M|  Guchar upLeftBuf[gfxColorMaxComps * 2 + 1];
  554|  2.69M|  int left, up, upLeft, p, pa, pb, pc;
  555|  2.69M|  int c;
  556|  2.69M|  Gulong inBuf, outBuf, bitMask;
  557|  2.69M|  int inBits, outBits;
  558|  2.69M|  int i, j, k, kk;
  559|       |
  560|       |  // get PNG optimum predictor number
  561|  2.69M|  if (predictor >= 10) {
  ------------------
  |  Branch (561:7): [True: 1.52M, False: 1.17M]
  ------------------
  562|  1.52M|    if ((curPred = str->getRawChar()) == EOF) {
  ------------------
  |  Branch (562:9): [True: 1.02k, False: 1.52M]
  ------------------
  563|  1.02k|      return gFalse;
  ------------------
  |  |   18|  1.02k|#define gFalse 0
  ------------------
  564|  1.02k|    }
  565|  1.52M|    curPred += 10;
  566|  1.52M|  } else {
  567|  1.17M|    curPred = predictor;
  568|  1.17M|  }
  569|       |
  570|       |  // read the raw line, apply PNG (byte) predictor
  571|  2.69M|  memset(upLeftBuf, 0, pixBytes + 1);
  572|  12.5M|  for (i = pixBytes; i < rowBytes; ++i) {
  ------------------
  |  Branch (572:22): [True: 9.80M, False: 2.69M]
  ------------------
  573|  23.1M|    for (j = pixBytes; j > 0; --j) {
  ------------------
  |  Branch (573:24): [True: 13.3M, False: 9.80M]
  ------------------
  574|  13.3M|      upLeftBuf[j] = upLeftBuf[j-1];
  575|  13.3M|    }
  576|  9.80M|    upLeftBuf[0] = predLine[i];
  577|  9.80M|    if ((c = str->getRawChar()) == EOF) {
  ------------------
  |  Branch (577:9): [True: 2.05k, False: 9.80M]
  ------------------
  578|  2.05k|      if (i > pixBytes) {
  ------------------
  |  Branch (578:11): [True: 578, False: 1.47k]
  ------------------
  579|       |	// this ought to return false, but some (broken) PDF files
  580|       |	// contain truncated image data, and Adobe apparently reads the
  581|       |	// last partial line
  582|    578|	break;
  583|    578|      }
  584|  1.47k|      return gFalse;
  ------------------
  |  |   18|  1.47k|#define gFalse 0
  ------------------
  585|  2.05k|    }
  586|  9.80M|    switch (curPred) {
  587|  81.9k|    case 11:			// PNG sub
  ------------------
  |  Branch (587:5): [True: 81.9k, False: 9.72M]
  ------------------
  588|  81.9k|      predLine[i] = (Guchar)(predLine[i - pixBytes] + c);
  589|  81.9k|      break;
  590|  26.7k|    case 12:			// PNG up
  ------------------
  |  Branch (590:5): [True: 26.7k, False: 9.77M]
  ------------------
  591|  26.7k|      predLine[i] = (Guchar)(predLine[i] + c);
  592|  26.7k|      break;
  593|  2.04k|    case 13:			// PNG average
  ------------------
  |  Branch (593:5): [True: 2.04k, False: 9.80M]
  ------------------
  594|  2.04k|      predLine[i] = (Guchar)(((predLine[i - pixBytes] + predLine[i]) >> 1) + c);
  595|  2.04k|      break;
  596|     60|    case 14:			// PNG Paeth
  ------------------
  |  Branch (596:5): [True: 60, False: 9.80M]
  ------------------
  597|     60|      left = predLine[i - pixBytes];
  598|     60|      up = predLine[i];
  599|     60|      upLeft = upLeftBuf[pixBytes];
  600|     60|      p = left + up - upLeft;
  601|     60|      if ((pa = p - left) < 0)
  ------------------
  |  Branch (601:11): [True: 20, False: 40]
  ------------------
  602|     20|	pa = -pa;
  603|     60|      if ((pb = p - up) < 0)
  ------------------
  |  Branch (603:11): [True: 13, False: 47]
  ------------------
  604|     13|	pb = -pb;
  605|     60|      if ((pc = p - upLeft) < 0)
  ------------------
  |  Branch (605:11): [True: 12, False: 48]
  ------------------
  606|     12|	pc = -pc;
  607|     60|      if (pa <= pb && pa <= pc)
  ------------------
  |  Branch (607:11): [True: 23, False: 37]
  |  Branch (607:23): [True: 21, False: 2]
  ------------------
  608|     21|	predLine[i] = (Guchar)(left + c);
  609|     39|      else if (pb <= pc)
  ------------------
  |  Branch (609:16): [True: 35, False: 4]
  ------------------
  610|     35|	predLine[i] = (Guchar)(up + c);
  611|      4|      else
  612|      4|	predLine[i] = (Guchar)(upLeft + c);
  613|     60|      break;
  614|  6.48M|    case 10:			// PNG none
  ------------------
  |  Branch (614:5): [True: 6.48M, False: 3.32M]
  ------------------
  615|  9.69M|    default:			// no predictor or TIFF predictor
  ------------------
  |  Branch (615:5): [True: 3.20M, False: 6.59M]
  ------------------
  616|  9.69M|      predLine[i] = (Guchar)c;
  617|  9.69M|      break;
  618|  9.80M|    }
  619|  9.80M|  }
  620|       |
  621|       |  // apply TIFF (component) predictor
  622|  2.69M|  if (predictor == 2) {
  ------------------
  |  Branch (622:7): [True: 1.17M, False: 1.52M]
  ------------------
  623|  1.17M|    if (nBits == 8) {
  ------------------
  |  Branch (623:9): [True: 3.33k, False: 1.17M]
  ------------------
  624|  15.2k|      for (i = pixBytes; i < rowBytes; ++i) {
  ------------------
  |  Branch (624:26): [True: 11.9k, False: 3.33k]
  ------------------
  625|  11.9k|	predLine[i] = (Guchar)(predLine[i] + predLine[i - nComps]);
  626|  11.9k|      }
  627|  1.17M|    } else if (nBits == 16) {
  ------------------
  |  Branch (627:16): [True: 146, False: 1.17M]
  ------------------
  628|    438|      for (i = pixBytes; i < rowBytes; i += 2) {
  ------------------
  |  Branch (628:26): [True: 292, False: 146]
  ------------------
  629|    292|	c = ((predLine[i] + predLine[i - 2*nComps]) << 8) +
  630|    292|	    predLine[i + 1] + predLine[i + 1 - 2*nComps];
  631|    292|	predLine[i] = (Guchar)(c >> 8);
  632|    292|	predLine[i+1] = (Guchar)(c & 0xff);
  633|    292|      }
  634|  1.17M|    } else {
  635|  1.17M|      memset(upLeftBuf, 0, nComps);
  636|  1.17M|      bitMask = (1 << nBits) - 1;
  637|  1.17M|      inBuf = outBuf = 0;
  638|  1.17M|      inBits = outBits = 0;
  639|  1.17M|      j = k = pixBytes;
  640|  3.51M|      for (i = 0; i < width; ++i) {
  ------------------
  |  Branch (640:19): [True: 2.34M, False: 1.17M]
  ------------------
  641|  7.37M|	for (kk = 0; kk < nComps; ++kk) {
  ------------------
  |  Branch (641:15): [True: 5.02M, False: 2.34M]
  ------------------
  642|  5.02M|	  if (inBits < nBits) {
  ------------------
  |  Branch (642:8): [True: 2.17M, False: 2.85M]
  ------------------
  643|  2.17M|	    inBuf = (inBuf << 8) | (predLine[j++] & 0xff);
  644|  2.17M|	    inBits += 8;
  645|  2.17M|	  }
  646|  5.02M|	  upLeftBuf[kk] = (Guchar)((upLeftBuf[kk] +
  647|  5.02M|				    (inBuf >> (inBits - nBits))) & bitMask);
  648|  5.02M|	  inBits -= nBits;
  649|  5.02M|	  outBuf = (outBuf << nBits) | upLeftBuf[kk];
  650|  5.02M|	  outBits += nBits;
  651|  5.02M|	  if (outBits >= 8) {
  ------------------
  |  Branch (651:8): [True: 1.00M, False: 4.02M]
  ------------------
  652|  1.00M|	    predLine[k++] = (Guchar)(outBuf >> (outBits - 8));
  653|  1.00M|	    outBits -= 8;
  654|  1.00M|	  }
  655|  5.02M|	}
  656|  2.34M|      }
  657|  1.17M|      if (outBits > 0) {
  ------------------
  |  Branch (657:11): [True: 1.17M, False: 223]
  ------------------
  658|  1.17M|	predLine[k++] = (Guchar)((outBuf << (8 - outBits)) +
  659|  1.17M|				 (inBuf & ((1 << (8 - outBits)) - 1)));
  660|  1.17M|      }
  661|  1.17M|    }
  662|  1.17M|  }
  663|       |
  664|       |  // reset to start of line
  665|  2.69M|  predIdx = pixBytes;
  666|       |
  667|  2.69M|  return gTrue;
  ------------------
  |  |   17|  2.69M|#define gTrue 1
  ------------------
  668|  2.69M|}
_ZN9MemStreamC2EPcjjP6Object:
  878|  1.34M|    BaseStream(dictA) {
  879|  1.34M|  buf = bufA;
  880|  1.34M|  start = startA;
  881|  1.34M|  length = lengthA;
  882|  1.34M|  bufEnd = buf + start + length;
  883|  1.34M|  bufPtr = buf + start;
  884|  1.34M|  needFree = gFalse;
  ------------------
  |  |   18|  1.34M|#define gFalse 0
  ------------------
  885|  1.34M|}
_ZN9MemStreamD2Ev:
  887|  1.31M|MemStream::~MemStream() {
  888|  1.31M|  if (needFree) {
  ------------------
  |  Branch (888:7): [True: 0, False: 1.31M]
  ------------------
  889|      0|    gfree(buf);
  890|      0|  }
  891|  1.31M|}
_ZN9MemStream4copyEv:
  893|  1.07M|Stream *MemStream::copy() {
  894|  1.07M|  Object dictA;
  895|       |
  896|  1.07M|  dict.copy(&dictA);
  897|  1.07M|  return new MemStream(buf, start, length, &dictA);
  898|  1.07M|}
_ZN9MemStream13makeSubStreamElilP6Object:
  901|   230k|				 GFileOffset lengthA, Object *dictA) {
  902|   230k|  MemStream *subStr;
  903|   230k|  Guint newStart, newLength;
  904|       |
  905|   230k|  if (startA < start) {
  ------------------
  |  Branch (905:7): [True: 0, False: 230k]
  ------------------
  906|      0|    newStart = start;
  907|   230k|  } else if (startA > start + length) {
  ------------------
  |  Branch (907:14): [True: 91, False: 230k]
  ------------------
  908|     91|    newStart = start + (int)length;
  909|   230k|  } else {
  910|   230k|    newStart = (int)startA;
  911|   230k|  }
  912|   230k|  if (!limited || newStart + lengthA > start + length) {
  ------------------
  |  Branch (912:7): [True: 113k, False: 117k]
  |  Branch (912:19): [True: 32.9k, False: 84.5k]
  ------------------
  913|   146k|    newLength = start + length - newStart;
  914|   146k|  } else {
  915|  84.5k|    newLength = (Guint)lengthA;
  916|  84.5k|  }
  917|   230k|  subStr = new MemStream(buf, newStart, newLength, dictA);
  918|   230k|  return subStr;
  919|   230k|}
_ZN9MemStream5resetEv:
  921|   397k|void MemStream::reset() {
  922|   397k|  bufPtr = buf + start;
  923|   397k|}
_ZN9MemStream5closeEv:
  925|   971k|void MemStream::close() {
  926|   971k|}
_ZN9MemStream8getBlockEPci:
  928|   555k|int MemStream::getBlock(char *blk, int size) {
  929|   555k|  int n;
  930|       |
  931|   555k|  if (size <= 0) {
  ------------------
  |  Branch (931:7): [True: 0, False: 555k]
  ------------------
  932|      0|    return 0;
  933|      0|  }
  934|   555k|  if (bufEnd - bufPtr < size) {
  ------------------
  |  Branch (934:7): [True: 39.7k, False: 516k]
  ------------------
  935|  39.7k|    n = (int)(bufEnd - bufPtr);
  936|   516k|  } else {
  937|   516k|    n = size;
  938|   516k|  }
  939|   555k|  memcpy(blk, bufPtr, n);
  940|   555k|  bufPtr += n;
  941|   555k|  return n;
  942|   555k|}
_ZN9MemStream6setPosEli:
  944|  91.5k|void MemStream::setPos(GFileOffset pos, int dir) {
  945|  91.5k|  Guint i;
  946|       |
  947|  91.5k|  if (dir >= 0) {
  ------------------
  |  Branch (947:7): [True: 86.8k, False: 4.70k]
  ------------------
  948|  86.8k|    i = (Guint)pos;
  949|  86.8k|  } else {
  950|  4.70k|    if (pos > start + length) {
  ------------------
  |  Branch (950:9): [True: 0, False: 4.70k]
  ------------------
  951|      0|      i = 0;
  952|  4.70k|    } else {
  953|  4.70k|      i = (Guint)(start + length - pos);
  954|  4.70k|    }
  955|  4.70k|  }
  956|  91.5k|  if (i < start) {
  ------------------
  |  Branch (956:7): [True: 1.25k, False: 90.2k]
  ------------------
  957|  1.25k|    i = start;
  958|  90.2k|  } else if (i > start + length) {
  ------------------
  |  Branch (958:14): [True: 6.14k, False: 84.1k]
  ------------------
  959|  6.14k|    i = start + length;
  960|  6.14k|  }
  961|  91.5k|  bufPtr = buf + i;
  962|  91.5k|}
_ZN9MemStream9moveStartEi:
  964|  2.22k|void MemStream::moveStart(int delta) {
  965|  2.22k|  start += delta;
  966|  2.22k|  length -= delta;
  967|  2.22k|  bufPtr = buf + start;
  968|  2.22k|}
_ZN11EmbedStreamC2EP6StreamP6Objectil:
  976|  81.5k|    BaseStream(dictA) {
  977|  81.5k|  str = strA;
  978|  81.5k|  limited = limitedA;
  979|  81.5k|  length = lengthA;
  980|  81.5k|}
_ZN11EmbedStream4copyEv:
  985|  40.7k|Stream *EmbedStream::copy() {
  986|  40.7k|  Object dictA;
  987|       |
  988|  40.7k|  dict.copy(&dictA);
  989|  40.7k|  return new EmbedStream(str, &dictA, limited, length);
  990|  40.7k|}
_ZN11EmbedStream7getCharEv:
  998|  6.38M|int EmbedStream::getChar() {
  999|  6.38M|  if (limited && !length) {
  ------------------
  |  Branch (999:7): [True: 4.92M, False: 1.45M]
  |  Branch (999:18): [True: 26.7k, False: 4.90M]
  ------------------
 1000|  26.7k|    return EOF;
 1001|  26.7k|  }
 1002|  6.35M|  --length;
 1003|  6.35M|  return str->getChar();
 1004|  6.38M|}
_ZN11EmbedStream8lookCharEv:
 1006|  2.55M|int EmbedStream::lookChar() {
 1007|  2.55M|  if (limited && !length) {
  ------------------
  |  Branch (1007:7): [True: 2.45M, False: 96.8k]
  |  Branch (1007:18): [True: 1.59k, False: 2.45M]
  ------------------
 1008|  1.59k|    return EOF;
 1009|  1.59k|  }
 1010|  2.55M|  return str->lookChar();
 1011|  2.55M|}
_ZN14ASCIIHexStreamC2EP6Stream:
 1042|  8.70k|    FilterStream(strA) {
 1043|  8.70k|  buf = EOF;
 1044|  8.70k|  eof = gFalse;
  ------------------
  |  |   18|  8.70k|#define gFalse 0
  ------------------
 1045|  8.70k|}
_ZN14ASCIIHexStreamD2Ev:
 1047|  8.61k|ASCIIHexStream::~ASCIIHexStream() {
 1048|  8.61k|  delete str;
 1049|  8.61k|}
_ZN14ASCIIHexStream4copyEv:
 1051|  7.70k|Stream *ASCIIHexStream::copy() {
 1052|  7.70k|  return new ASCIIHexStream(str->copy());
 1053|  7.70k|}
_ZN14ASCIIHexStream5resetEv:
 1055|  2.57k|void ASCIIHexStream::reset() {
 1056|  2.57k|  str->reset();
 1057|  2.57k|  buf = EOF;
 1058|  2.57k|  eof = gFalse;
  ------------------
  |  |   18|  2.57k|#define gFalse 0
  ------------------
 1059|  2.57k|}
_ZN14ASCIIHexStream8lookCharEv:
 1061|  39.1k|int ASCIIHexStream::lookChar() {
 1062|  39.1k|  int c1, c2, x;
 1063|       |
 1064|  39.1k|  if (buf != EOF)
  ------------------
  |  Branch (1064:7): [True: 135, False: 39.0k]
  ------------------
 1065|    135|    return buf;
 1066|  39.0k|  if (eof) {
  ------------------
  |  Branch (1066:7): [True: 9.22k, False: 29.7k]
  ------------------
 1067|  9.22k|    buf = EOF;
 1068|  9.22k|    return EOF;
 1069|  9.22k|  }
 1070|  33.4k|  do {
 1071|  33.4k|    c1 = str->getChar();
 1072|  33.4k|  } while (isspace(c1));
  ------------------
  |  Branch (1072:12): [True: 3.70k, False: 29.7k]
  ------------------
 1073|  29.7k|  if (c1 == '>') {
  ------------------
  |  Branch (1073:7): [True: 692, False: 29.0k]
  ------------------
 1074|    692|    eof = gTrue;
  ------------------
  |  |   17|    692|#define gTrue 1
  ------------------
 1075|    692|    buf = EOF;
 1076|    692|    return buf;
 1077|    692|  }
 1078|  37.6k|  do {
 1079|  37.6k|    c2 = str->getChar();
 1080|  37.6k|  } while (isspace(c2));
  ------------------
  |  Branch (1080:12): [True: 8.52k, False: 29.0k]
  ------------------
 1081|  29.0k|  if (c2 == '>') {
  ------------------
  |  Branch (1081:7): [True: 716, False: 28.3k]
  ------------------
 1082|    716|    eof = gTrue;
  ------------------
  |  |   17|    716|#define gTrue 1
  ------------------
 1083|    716|    c2 = '0';
 1084|    716|  }
 1085|  29.0k|  if (c1 >= '0' && c1 <= '9') {
  ------------------
  |  Branch (1085:7): [True: 22.3k, False: 6.70k]
  |  Branch (1085:20): [True: 454, False: 21.9k]
  ------------------
 1086|    454|    x = (c1 - '0') << 4;
 1087|  28.6k|  } else if (c1 >= 'A' && c1 <= 'F') {
  ------------------
  |  Branch (1087:14): [True: 21.8k, False: 6.80k]
  |  Branch (1087:27): [True: 221, False: 21.6k]
  ------------------
 1088|    221|    x = (c1 - 'A' + 10) << 4;
 1089|  28.4k|  } else if (c1 >= 'a' && c1 <= 'f') {
  ------------------
  |  Branch (1089:14): [True: 21.1k, False: 7.22k]
  |  Branch (1089:27): [True: 1.15k, False: 20.0k]
  ------------------
 1090|  1.15k|    x = (c1 - 'a' + 10) << 4;
 1091|  27.2k|  } else if (c1 == EOF) {
  ------------------
  |  Branch (1091:14): [True: 847, False: 26.4k]
  ------------------
 1092|    847|    eof = gTrue;
  ------------------
  |  |   17|    847|#define gTrue 1
  ------------------
 1093|    847|    x = 0;
 1094|  26.4k|  } else {
 1095|  26.4k|    error(errSyntaxError, getPos(),
 1096|  26.4k|	  "Illegal character <{0:02x}> in ASCIIHex stream", c1);
 1097|  26.4k|    x = 0;
 1098|  26.4k|  }
 1099|  29.0k|  if (c2 >= '0' && c2 <= '9') {
  ------------------
  |  Branch (1099:7): [True: 22.2k, False: 6.86k]
  |  Branch (1099:20): [True: 3.20k, False: 19.0k]
  ------------------
 1100|  3.20k|    x += c2 - '0';
 1101|  25.8k|  } else if (c2 >= 'A' && c2 <= 'F') {
  ------------------
  |  Branch (1101:14): [True: 19.0k, False: 6.88k]
  |  Branch (1101:27): [True: 354, False: 18.6k]
  ------------------
 1102|    354|    x += c2 - 'A' + 10;
 1103|  25.5k|  } else if (c2 >= 'a' && c2 <= 'f') {
  ------------------
  |  Branch (1103:14): [True: 16.3k, False: 9.17k]
  |  Branch (1103:27): [True: 1.39k, False: 14.9k]
  ------------------
 1104|  1.39k|    x += c2 - 'a' + 10;
 1105|  24.1k|  } else if (c2 == EOF) {
  ------------------
  |  Branch (1105:14): [True: 1.14k, False: 23.0k]
  ------------------
 1106|  1.14k|    eof = gTrue;
  ------------------
  |  |   17|  1.14k|#define gTrue 1
  ------------------
 1107|  1.14k|    x = 0;
 1108|  23.0k|  } else {
 1109|  23.0k|    error(errSyntaxError, getPos(),
 1110|  23.0k|	  "Illegal character <{0:02x}> in ASCIIHex stream", c2);
 1111|  23.0k|  }
 1112|  29.0k|  buf = x & 0xff;
 1113|  29.0k|  return buf;
 1114|  29.7k|}
_ZN13ASCII85StreamC2EP6Stream:
 1139|  15.5k|    FilterStream(strA) {
 1140|  15.5k|  index = n = 0;
 1141|  15.5k|  eof = gFalse;
  ------------------
  |  |   18|  15.5k|#define gFalse 0
  ------------------
 1142|  15.5k|}
_ZN13ASCII85StreamD2Ev:
 1144|  15.4k|ASCII85Stream::~ASCII85Stream() {
 1145|  15.4k|  delete str;
 1146|  15.4k|}
_ZN13ASCII85Stream4copyEv:
 1148|  11.8k|Stream *ASCII85Stream::copy() {
 1149|  11.8k|  return new ASCII85Stream(str->copy());
 1150|  11.8k|}
_ZN13ASCII85Stream5resetEv:
 1152|  3.71k|void ASCII85Stream::reset() {
 1153|  3.71k|  str->reset();
 1154|  3.71k|  index = n = 0;
 1155|  3.71k|  eof = gFalse;
  ------------------
  |  |   18|  3.71k|#define gFalse 0
  ------------------
 1156|  3.71k|}
_ZN13ASCII85Stream8lookCharEv:
 1158|  5.43M|int ASCII85Stream::lookChar() {
 1159|  5.43M|  int k;
 1160|  5.43M|  Gulong t;
 1161|       |
 1162|  5.43M|  if (index >= n) {
  ------------------
  |  Branch (1162:7): [True: 1.00M, False: 4.42M]
  ------------------
 1163|  1.00M|    if (eof)
  ------------------
  |  Branch (1163:9): [True: 3.61k, False: 1.00M]
  ------------------
 1164|  3.61k|      return EOF;
 1165|  1.00M|    index = 0;
 1166|  1.05M|    do {
 1167|  1.05M|      c[0] = str->getChar();
 1168|  1.05M|    } while (Lexer::isSpace(c[0]));
  ------------------
  |  Branch (1168:14): [True: 50.4k, False: 1.00M]
  ------------------
 1169|  1.00M|    if (c[0] == '~' || c[0] == EOF) {
  ------------------
  |  Branch (1169:9): [True: 347, False: 1.00M]
  |  Branch (1169:24): [True: 138, False: 1.00M]
  ------------------
 1170|    485|      eof = gTrue;
  ------------------
  |  |   17|    485|#define gTrue 1
  ------------------
 1171|    485|      n = 0;
 1172|    485|      return EOF;
 1173|  1.00M|    } else if (c[0] == 'z') {
  ------------------
  |  Branch (1173:16): [True: 530, False: 1.00M]
  ------------------
 1174|    530|      b[0] = b[1] = b[2] = b[3] = 0;
 1175|    530|      n = 4;
 1176|  1.00M|    } else {
 1177|  5.00M|      for (k = 1; k < 5; ++k) {
  ------------------
  |  Branch (1177:19): [True: 4.00M, False: 1.00M]
  ------------------
 1178|  4.33M|	do {
 1179|  4.33M|	  c[k] = str->getChar();
 1180|  4.33M|	} while (Lexer::isSpace(c[k]));
  ------------------
  |  Branch (1180:11): [True: 325k, False: 4.00M]
  ------------------
 1181|  4.00M|	if (c[k] == '~' || c[k] == EOF)
  ------------------
  |  Branch (1181:6): [True: 1.31k, False: 4.00M]
  |  Branch (1181:21): [True: 1.87k, False: 4.00M]
  ------------------
 1182|  3.18k|	  break;
 1183|  4.00M|      }
 1184|  1.00M|      n = k - 1;
 1185|  1.00M|      if (k < 5 && (c[k] == '~' || c[k] == EOF)) {
  ------------------
  |  Branch (1185:11): [True: 3.18k, False: 1.00M]
  |  Branch (1185:21): [True: 1.31k, False: 1.87k]
  |  Branch (1185:36): [True: 1.87k, False: 0]
  ------------------
 1186|  11.0k|	for (++k; k < 5; ++k)
  ------------------
  |  Branch (1186:12): [True: 7.81k, False: 3.18k]
  ------------------
 1187|  7.81k|	  c[k] = 0x21 + 84;
 1188|  3.18k|	eof = gTrue;
  ------------------
  |  |   17|  3.18k|#define gTrue 1
  ------------------
 1189|  3.18k|      }
 1190|  1.00M|      t = 0;
 1191|  6.02M|      for (k = 0; k < 5; ++k)
  ------------------
  |  Branch (1191:19): [True: 5.02M, False: 1.00M]
  ------------------
 1192|  5.02M|	t = t * 85 + (c[k] - 0x21);
 1193|  5.02M|      for (k = 3; k >= 0; --k) {
  ------------------
  |  Branch (1193:19): [True: 4.01M, False: 1.00M]
  ------------------
 1194|  4.01M|	b[k] = (int)(t & 0xff);
 1195|  4.01M|	t >>= 8;
 1196|  4.01M|      }
 1197|  1.00M|    }
 1198|  1.00M|  }
 1199|  5.42M|  return b[index];
 1200|  5.43M|}
_ZN9LZWStreamC2EP6Streamiiiii:
 1226|  12.1k|    FilterStream(strA) {
 1227|  12.1k|  if (predictor != 1) {
  ------------------
  |  Branch (1227:7): [True: 2.72k, False: 9.45k]
  ------------------
 1228|  2.72k|    pred = new StreamPredictor(this, predictor, columns, colors, bits);
 1229|  2.72k|    if (!pred->isOk()) {
  ------------------
  |  Branch (1229:9): [True: 255, False: 2.47k]
  ------------------
 1230|    255|      delete pred;
 1231|    255|      pred = NULL;
 1232|    255|    }
 1233|  9.45k|  } else {
 1234|  9.45k|    pred = NULL;
 1235|  9.45k|  }
 1236|  12.1k|  early = earlyA;
 1237|  12.1k|  eof = gFalse;
  ------------------
  |  |   18|  12.1k|#define gFalse 0
  ------------------
 1238|  12.1k|  inputBits = 0;
 1239|  12.1k|  clearTable();
 1240|  12.1k|  checkForDecompressionBombs = gTrue;
  ------------------
  |  |   17|  12.1k|#define gTrue 1
  ------------------
 1241|  12.1k|}
_ZN9LZWStreamD2Ev:
 1243|  12.0k|LZWStream::~LZWStream() {
 1244|  12.0k|  if (pred) {
  ------------------
  |  Branch (1244:7): [True: 2.45k, False: 9.60k]
  ------------------
 1245|  2.45k|    delete pred;
 1246|  2.45k|  }
 1247|  12.0k|  delete str;
 1248|  12.0k|}
_ZN9LZWStream4copyEv:
 1250|  10.7k|Stream *LZWStream::copy() {
 1251|  10.7k|  if (pred) {
  ------------------
  |  Branch (1251:7): [True: 2.41k, False: 8.31k]
  ------------------
 1252|  2.41k|    return new LZWStream(str->copy(), pred->getPredictor(),
 1253|  2.41k|			 pred->getWidth(), pred->getNComps(),
 1254|  2.41k|			 pred->getNBits(), early);
 1255|  8.31k|  } else {
 1256|  8.31k|    return new LZWStream(str->copy(), 1, 0, 0, 0, early);
 1257|  8.31k|  }
 1258|  10.7k|}
_ZN9LZWStream7getCharEv:
 1265|  3.39M|int LZWStream::getChar() {
 1266|  3.39M|  if (pred) {
  ------------------
  |  Branch (1266:7): [True: 1.85M, False: 1.54M]
  ------------------
 1267|  1.85M|    return pred->getChar();
 1268|  1.85M|  }
 1269|  1.54M|  if (eof) {
  ------------------
  |  Branch (1269:7): [True: 1.63k, False: 1.53M]
  ------------------
 1270|  1.63k|    return EOF;
 1271|  1.63k|  }
 1272|  1.53M|  if (seqIndex >= seqLength) {
  ------------------
  |  Branch (1272:7): [True: 1.50M, False: 35.4k]
  ------------------
 1273|  1.50M|    if (!processNextCode()) {
  ------------------
  |  Branch (1273:9): [True: 1.49k, False: 1.50M]
  ------------------
 1274|  1.49k|      return EOF;
 1275|  1.49k|    }
 1276|  1.50M|  }
 1277|  1.53M|  return seqBuf[seqIndex++];
 1278|  1.53M|}
_ZN9LZWStream8lookCharEv:
 1280|  32.0k|int LZWStream::lookChar() {
 1281|  32.0k|  if (pred) {
  ------------------
  |  Branch (1281:7): [True: 10.5k, False: 21.4k]
  ------------------
 1282|  10.5k|    return pred->lookChar();
 1283|  10.5k|  }
 1284|  21.4k|  if (eof) {
  ------------------
  |  Branch (1284:7): [True: 190, False: 21.2k]
  ------------------
 1285|    190|    return EOF;
 1286|    190|  }
 1287|  21.2k|  if (seqIndex >= seqLength) {
  ------------------
  |  Branch (1287:7): [True: 19.0k, False: 2.24k]
  ------------------
 1288|  19.0k|    if (!processNextCode()) {
  ------------------
  |  Branch (1288:9): [True: 894, False: 18.1k]
  ------------------
 1289|    894|      return EOF;
 1290|    894|    }
 1291|  19.0k|  }
 1292|  20.3k|  return seqBuf[seqIndex];
 1293|  21.2k|}
_ZN9LZWStream10getRawCharEv:
 1295|  2.19M|int LZWStream::getRawChar() {
 1296|  2.19M|  if (eof) {
  ------------------
  |  Branch (1296:7): [True: 964, False: 2.19M]
  ------------------
 1297|    964|    return EOF;
 1298|    964|  }
 1299|  2.19M|  if (seqIndex >= seqLength) {
  ------------------
  |  Branch (1299:7): [True: 2.18M, False: 6.09k]
  ------------------
 1300|  2.18M|    if (!processNextCode()) {
  ------------------
  |  Branch (1300:9): [True: 847, False: 2.18M]
  ------------------
 1301|    847|      return EOF;
 1302|    847|    }
 1303|  2.18M|  }
 1304|  2.18M|  return seqBuf[seqIndex++];
 1305|  2.19M|}
_ZN9LZWStream8getBlockEPci:
 1307|  1.41k|int LZWStream::getBlock(char *blk, int size) {
 1308|  1.41k|  int n, m;
 1309|       |
 1310|  1.41k|  if (pred) {
  ------------------
  |  Branch (1310:7): [True: 221, False: 1.19k]
  ------------------
 1311|    221|    return pred->getBlock(blk, size);
 1312|    221|  }
 1313|  1.19k|  if (eof) {
  ------------------
  |  Branch (1313:7): [True: 577, False: 613]
  ------------------
 1314|    577|    return 0;
 1315|    577|  }
 1316|    613|  n = 0;
 1317|  4.93k|  while (n < size) {
  ------------------
  |  Branch (1317:10): [True: 4.63k, False: 299]
  ------------------
 1318|  4.63k|    if (seqIndex >= seqLength) {
  ------------------
  |  Branch (1318:9): [True: 4.56k, False: 74]
  ------------------
 1319|  4.56k|      if (!processNextCode()) {
  ------------------
  |  Branch (1319:11): [True: 314, False: 4.24k]
  ------------------
 1320|    314|	break;
 1321|    314|      }
 1322|  4.56k|    }
 1323|  4.32k|    m = seqLength - seqIndex;
 1324|  4.32k|    if (m > size - n) {
  ------------------
  |  Branch (1324:9): [True: 299, False: 4.02k]
  ------------------
 1325|    299|      m = size - n;
 1326|    299|    }
 1327|  4.32k|    memcpy(blk + n, seqBuf + seqIndex, m);
 1328|  4.32k|    seqIndex += m;
 1329|  4.32k|    n += m;
 1330|  4.32k|  }
 1331|    613|  return n;
 1332|  1.19k|}
_ZN9LZWStream5resetEv:
 1334|  3.59k|void LZWStream::reset() {
 1335|  3.59k|  str->reset();
 1336|  3.59k|  if (pred) {
  ------------------
  |  Branch (1336:7): [True: 870, False: 2.72k]
  ------------------
 1337|    870|    pred->reset();
 1338|    870|  }
 1339|  3.59k|  eof = gFalse;
  ------------------
  |  |   18|  3.59k|#define gFalse 0
  ------------------
 1340|  3.59k|  inputBits = 0;
 1341|  3.59k|  clearTable();
 1342|  3.59k|  totalIn = totalOut = 0;
 1343|  3.59k|}
_ZN9LZWStream15processNextCodeEv:
 1345|  3.71M|GBool LZWStream::processNextCode() {
 1346|  3.71M|  int code;
 1347|  3.71M|  int nextLength;
 1348|  3.71M|  int i, j;
 1349|       |
 1350|       |  // check for EOF
 1351|  3.71M|  if (eof) {
  ------------------
  |  Branch (1351:7): [True: 0, False: 3.71M]
  ------------------
 1352|      0|    return gFalse;
  ------------------
  |  |   18|      0|#define gFalse 0
  ------------------
 1353|      0|  }
 1354|       |
 1355|       |  // check for eod and clear-table codes
 1356|  3.71M| start:
 1357|  3.71M|  code = getCode();
 1358|  3.71M|  if (code == EOF || code == 257) {
  ------------------
  |  Branch (1358:7): [True: 77, False: 3.71M]
  |  Branch (1358:22): [True: 325, False: 3.71M]
  ------------------
 1359|    402|    eof = gTrue;
  ------------------
  |  |   17|    402|#define gTrue 1
  ------------------
 1360|    402|    return gFalse;
  ------------------
  |  |   18|    402|#define gFalse 0
  ------------------
 1361|    402|  }
 1362|  3.71M|  if (code == 256) {
  ------------------
  |  Branch (1362:7): [True: 1.82k, False: 3.71M]
  ------------------
 1363|  1.82k|    clearTable();
 1364|  1.82k|    goto start;
 1365|  1.82k|  }
 1366|  3.71M|  if (nextCode >= 4097) {
  ------------------
  |  Branch (1366:7): [True: 490, False: 3.71M]
  ------------------
 1367|    490|    error(errSyntaxError, getPos(),
 1368|    490|	  "Bad LZW stream - expected clear-table code");
 1369|    490|    clearTable();
 1370|    490|  }
 1371|       |
 1372|       |  // process the next code
 1373|  3.71M|  nextLength = seqLength + 1;
 1374|  3.71M|  if (code < 256) {
  ------------------
  |  Branch (1374:7): [True: 3.68M, False: 26.0k]
  ------------------
 1375|  3.68M|    seqBuf[0] = (Guchar)code;
 1376|  3.68M|    seqLength = 1;
 1377|  3.68M|  } else if (code < nextCode) {
  ------------------
  |  Branch (1377:14): [True: 22.6k, False: 3.40k]
  ------------------
 1378|  22.6k|    seqLength = table[code].length;
 1379|  46.1k|    for (i = seqLength - 1, j = code; i > 0; --i) {
  ------------------
  |  Branch (1379:39): [True: 23.4k, False: 22.6k]
  ------------------
 1380|  23.4k|      seqBuf[i] = table[j].tail;
 1381|  23.4k|      j = table[j].head;
 1382|  23.4k|    }
 1383|  22.6k|    seqBuf[0] = (Guchar)j;
 1384|  22.6k|  } else if (code == nextCode) {
  ------------------
  |  Branch (1384:14): [True: 255, False: 3.14k]
  ------------------
 1385|    255|    seqBuf[seqLength] = (Guchar)newChar;
 1386|    255|    ++seqLength;
 1387|  3.14k|  } else {
 1388|  3.14k|    error(errSyntaxError, getPos(), "Bad LZW stream - unexpected code");
 1389|  3.14k|    eof = gTrue;
  ------------------
  |  |   17|  3.14k|#define gTrue 1
  ------------------
 1390|  3.14k|    return gFalse;
  ------------------
  |  |   18|  3.14k|#define gFalse 0
  ------------------
 1391|  3.14k|  }
 1392|  3.70M|  newChar = seqBuf[0];
 1393|  3.70M|  if (first) {
  ------------------
  |  Branch (1393:7): [True: 5.45k, False: 3.70M]
  ------------------
 1394|  5.45k|    first = gFalse;
  ------------------
  |  |   18|  5.45k|#define gFalse 0
  ------------------
 1395|  3.70M|  } else {
 1396|  3.70M|    table[nextCode].length = nextLength;
 1397|  3.70M|    table[nextCode].head = prevCode;
 1398|  3.70M|    table[nextCode].tail = (Guchar)newChar;
 1399|  3.70M|    ++nextCode;
 1400|  3.70M|    if (nextCode + early == 512)
  ------------------
  |  Branch (1400:9): [True: 2.09k, False: 3.70M]
  ------------------
 1401|  2.09k|      nextBits = 10;
 1402|  3.70M|    else if (nextCode + early == 1024)
  ------------------
  |  Branch (1402:14): [True: 1.06k, False: 3.70M]
  ------------------
 1403|  1.06k|      nextBits = 11;
 1404|  3.70M|    else if (nextCode + early == 2048)
  ------------------
  |  Branch (1404:14): [True: 957, False: 3.69M]
  ------------------
 1405|    957|      nextBits = 12;
 1406|  3.70M|  }
 1407|  3.70M|  prevCode = code;
 1408|  3.70M|  totalOut += seqLength;
 1409|       |
 1410|       |  // check for a 'decompression bomb'
 1411|  3.70M|  if (checkForDecompressionBombs &&
  ------------------
  |  Branch (1411:7): [True: 3.70M, False: 0]
  ------------------
 1412|  3.70M|      totalOut > decompressionBombSizeThreshold &&
  ------------------
  |  |   55|  7.41M|#define decompressionBombSizeThreshold 50000000
  ------------------
  |  Branch (1412:7): [True: 0, False: 3.70M]
  ------------------
 1413|      0|      totalIn < totalOut / decompressionBombRatioThreshold) {
  ------------------
  |  |   56|      0|#define decompressionBombRatioThreshold 200
  ------------------
  |  Branch (1413:7): [True: 0, False: 0]
  ------------------
 1414|      0|    error(errSyntaxError, getPos(), "Decompression bomb in LZW stream");
 1415|      0|    eof = gTrue;
  ------------------
  |  |   17|      0|#define gTrue 1
  ------------------
 1416|      0|    return gFalse;
  ------------------
  |  |   18|      0|#define gFalse 0
  ------------------
 1417|      0|  }
 1418|       |
 1419|       |  // reset buffer
 1420|  3.70M|  seqIndex = 0;
 1421|       |
 1422|  3.70M|  return gTrue;
  ------------------
  |  |   17|  3.70M|#define gTrue 1
  ------------------
 1423|  3.70M|}
_ZN9LZWStream10clearTableEv:
 1425|  18.0k|void LZWStream::clearTable() {
 1426|  18.0k|  nextCode = 258;
 1427|  18.0k|  nextBits = 9;
 1428|  18.0k|  seqIndex = seqLength = 0;
 1429|  18.0k|  first = gTrue;
  ------------------
  |  |   17|  18.0k|#define gTrue 1
  ------------------
 1430|  18.0k|}
_ZN9LZWStream7getCodeEv:
 1432|  3.71M|int LZWStream::getCode() {
 1433|  3.71M|  int c;
 1434|  3.71M|  int code;
 1435|       |
 1436|  8.75M|  while (inputBits < nextBits) {
  ------------------
  |  Branch (1436:10): [True: 5.04M, False: 3.71M]
  ------------------
 1437|  5.04M|    if ((c = str->getChar()) == EOF)
  ------------------
  |  Branch (1437:9): [True: 77, False: 5.04M]
  ------------------
 1438|     77|      return EOF;
 1439|  5.04M|    inputBuf = (inputBuf << 8) | (c & 0xff);
 1440|  5.04M|    inputBits += 8;
 1441|  5.04M|    ++totalIn;
 1442|  5.04M|  }
 1443|  3.71M|  code = (inputBuf >> (inputBits - nextBits)) & ((1 << nextBits) - 1);
 1444|  3.71M|  inputBits -= nextBits;
 1445|  3.71M|  return code;
 1446|  3.71M|}
_ZN15RunLengthStreamC2EP6Stream:
 1475|  34.8k|    FilterStream(strA) {
 1476|  34.8k|  bufPtr = bufEnd = buf;
 1477|  34.8k|  eof = gFalse;
  ------------------
  |  |   18|  34.8k|#define gFalse 0
  ------------------
 1478|  34.8k|}
_ZN15RunLengthStreamD2Ev:
 1480|  34.6k|RunLengthStream::~RunLengthStream() {
 1481|  34.6k|  delete str;
 1482|  34.6k|}
_ZN15RunLengthStream4copyEv:
 1484|  33.7k|Stream *RunLengthStream::copy() {
 1485|  33.7k|  return new RunLengthStream(str->copy());
 1486|  33.7k|}
_ZN15RunLengthStream5resetEv:
 1488|  10.5k|void RunLengthStream::reset() {
 1489|  10.5k|  str->reset();
 1490|  10.5k|  bufPtr = bufEnd = buf;
 1491|  10.5k|  eof = gFalse;
  ------------------
  |  |   18|  10.5k|#define gFalse 0
  ------------------
 1492|  10.5k|}
_ZN15RunLengthStream8getBlockEPci:
 1494|  5.86k|int RunLengthStream::getBlock(char *blk, int size) {
 1495|  5.86k|  int n, m;
 1496|       |
 1497|  5.86k|  n = 0;
 1498|   103k|  while (n < size) {
  ------------------
  |  Branch (1498:10): [True: 100k, False: 3.64k]
  ------------------
 1499|   100k|    if (bufPtr >= bufEnd) {
  ------------------
  |  Branch (1499:9): [True: 94.5k, False: 5.66k]
  ------------------
 1500|  94.5k|      if (!fillBuf()) {
  ------------------
  |  Branch (1500:11): [True: 2.22k, False: 92.3k]
  ------------------
 1501|  2.22k|	break;
 1502|  2.22k|      }
 1503|  94.5k|    }
 1504|  97.9k|    m = (int)(bufEnd - bufPtr);
 1505|  97.9k|    if (m > size - n) {
  ------------------
  |  Branch (1505:9): [True: 3.63k, False: 94.3k]
  ------------------
 1506|  3.63k|      m = size - n;
 1507|  3.63k|    }
 1508|  97.9k|    memcpy(blk + n, bufPtr, m);
 1509|  97.9k|    bufPtr += m;
 1510|  97.9k|    n += m;
 1511|  97.9k|  }
 1512|  5.86k|  return n;
 1513|  5.86k|}
_ZN15RunLengthStream7fillBufEv:
 1533|   999k|GBool RunLengthStream::fillBuf() {
 1534|   999k|  int c;
 1535|   999k|  int n, i;
 1536|       |
 1537|   999k|  if (eof)
  ------------------
  |  Branch (1537:7): [True: 606k, False: 393k]
  ------------------
 1538|   606k|    return gFalse;
  ------------------
  |  |   18|   606k|#define gFalse 0
  ------------------
 1539|   393k|  c = str->getChar();
 1540|   393k|  if (c == 0x80 || c == EOF) {
  ------------------
  |  Branch (1540:7): [True: 1.29k, False: 391k]
  |  Branch (1540:20): [True: 3.15k, False: 388k]
  ------------------
 1541|  4.44k|    eof = gTrue;
  ------------------
  |  |   17|  4.44k|#define gTrue 1
  ------------------
 1542|  4.44k|    return gFalse;
  ------------------
  |  |   18|  4.44k|#define gFalse 0
  ------------------
 1543|  4.44k|  }
 1544|   388k|  if (c < 0x80) {
  ------------------
  |  Branch (1544:7): [True: 337k, False: 50.8k]
  ------------------
 1545|   337k|    n = c + 1;
 1546|  12.7M|    for (i = 0; i < n; ++i)
  ------------------
  |  Branch (1546:17): [True: 12.3M, False: 337k]
  ------------------
 1547|  12.3M|      buf[i] = (char)str->getChar();
 1548|   337k|  } else {
 1549|  50.8k|    n = 0x101 - c;
 1550|  50.8k|    c = str->getChar();
 1551|  1.57M|    for (i = 0; i < n; ++i)
  ------------------
  |  Branch (1551:17): [True: 1.52M, False: 50.8k]
  ------------------
 1552|  1.52M|      buf[i] = (char)c;
 1553|  50.8k|  }
 1554|   388k|  bufPtr = buf;
 1555|   388k|  bufEnd = buf + n;
 1556|   388k|  return gTrue;
  ------------------
  |  |   17|   388k|#define gTrue 1
  ------------------
 1557|   393k|}
_ZN14CCITTFaxStreamC2EP6Streamiiiiiii:
 1566|  28.7k|    FilterStream(strA) {
 1567|  28.7k|  encoding = encodingA;
 1568|  28.7k|  endOfLine = endOfLineA;
 1569|  28.7k|  byteAlign = byteAlignA;
 1570|  28.7k|  columns = columnsA;
 1571|  28.7k|  if (columns < 1) {
  ------------------
  |  Branch (1571:7): [True: 683, False: 28.1k]
  ------------------
 1572|    683|    columns = 1;
 1573|  28.1k|  } else if (columns > INT_MAX - 3) {
  ------------------
  |  Branch (1573:14): [True: 0, False: 28.1k]
  ------------------
 1574|      0|    columns = INT_MAX - 3;
 1575|      0|  }
 1576|  28.7k|  rows = rowsA;
 1577|  28.7k|  endOfBlock = endOfBlockA;
 1578|  28.7k|  black = blackA;
 1579|  28.7k|  blackXOR = black ? 0xff : 0x00;
  ------------------
  |  Branch (1579:14): [True: 1.51k, False: 27.2k]
  ------------------
 1580|       |  // 0 <= codingLine[0] < codingLine[1] < ... < codingLine[n] = columns
 1581|       |  // ---> max codingLine size = columns + 1
 1582|       |  // refLine has two extra guard entries at the end
 1583|       |  // ---> max refLine size = columns + 3
 1584|  28.7k|  codingLine = (int *)gmallocn(columns + 1, sizeof(int));
 1585|  28.7k|  refLine = (int *)gmallocn(columns + 3, sizeof(int));
 1586|       |
 1587|  28.7k|  eof = gFalse;
  ------------------
  |  |   18|  28.7k|#define gFalse 0
  ------------------
 1588|  28.7k|  row = 0;
 1589|  28.7k|  nextLine2D = encoding < 0;
 1590|  28.7k|  inputBits = 0;
 1591|  28.7k|  codingLine[0] = columns;
 1592|  28.7k|  nextCol = columns;
 1593|  28.7k|  a0i = 0;
 1594|  28.7k|  err = gFalse;
  ------------------
  |  |   18|  28.7k|#define gFalse 0
  ------------------
 1595|  28.7k|  nErrors = 0;
 1596|  28.7k|}
_ZN14CCITTFaxStreamD2Ev:
 1598|  28.5k|CCITTFaxStream::~CCITTFaxStream() {
 1599|  28.5k|  delete str;
 1600|  28.5k|  gfree(refLine);
 1601|  28.5k|  gfree(codingLine);
 1602|  28.5k|}
_ZN14CCITTFaxStream4copyEv:
 1604|  26.2k|Stream *CCITTFaxStream::copy() {
 1605|  26.2k|  return new CCITTFaxStream(str->copy(), encoding, endOfLine,
 1606|  26.2k|			    byteAlign, columns, rows, endOfBlock, black);
 1607|  26.2k|}
_ZN14CCITTFaxStream5resetEv:
 1609|  7.69k|void CCITTFaxStream::reset() {
 1610|  7.69k|  int code1;
 1611|       |
 1612|  7.69k|  str->reset();
 1613|  7.69k|  eof = gFalse;
  ------------------
  |  |   18|  7.69k|#define gFalse 0
  ------------------
 1614|  7.69k|  row = 0;
 1615|  7.69k|  nextLine2D = encoding < 0;
 1616|  7.69k|  inputBits = 0;
 1617|  7.69k|  codingLine[0] = columns;
 1618|  7.69k|  nextCol = columns;
 1619|  7.69k|  a0i = 0;
 1620|       |
 1621|       |  // skip any initial zero bits and end-of-line marker, and get the 2D
 1622|       |  // encoding tag
 1623|  1.28M|  while ((code1 = lookBits(12)) == 0) {
  ------------------
  |  Branch (1623:10): [True: 1.27M, False: 7.69k]
  ------------------
 1624|  1.27M|    eatBits(1);
 1625|  1.27M|  }
 1626|  7.69k|  if (code1 == 0x001) {
  ------------------
  |  Branch (1626:7): [True: 2.98k, False: 4.71k]
  ------------------
 1627|  2.98k|    eatBits(12);
 1628|  2.98k|    endOfLine = gTrue;
  ------------------
  |  |   17|  2.98k|#define gTrue 1
  ------------------
 1629|  2.98k|  }
 1630|  7.69k|  if (encoding > 0) {
  ------------------
  |  Branch (1630:7): [True: 2.53k, False: 5.16k]
  ------------------
 1631|  2.53k|    nextLine2D = !lookBits(1);
 1632|  2.53k|    eatBits(1);
 1633|  2.53k|  }
 1634|  7.69k|}
_ZN14CCITTFaxStream7getCharEv:
 1636|  84.1M|int CCITTFaxStream::getChar() {
 1637|  84.1M|  int c, bitsNeeded, bitsAvail, bitsUsed;
 1638|       |
 1639|  84.1M|  if (nextCol >= columns) {
  ------------------
  |  Branch (1639:7): [True: 1.52M, False: 82.5M]
  ------------------
 1640|  1.52M|    if (eof) {
  ------------------
  |  Branch (1640:9): [True: 1.20M, False: 323k]
  ------------------
 1641|  1.20M|      return EOF;
 1642|  1.20M|    }
 1643|   323k|    if (!readRow()) {
  ------------------
  |  Branch (1643:9): [True: 819, False: 322k]
  ------------------
 1644|    819|      return EOF;
 1645|    819|    }
 1646|   323k|  }
 1647|  82.9M|  bitsAvail = codingLine[a0i] - nextCol;
 1648|  82.9M|  if (bitsAvail > 8) {
  ------------------
  |  Branch (1648:7): [True: 76.2M, False: 6.67M]
  ------------------
 1649|  76.2M|    c = (a0i & 1) ? 0x00 : 0xff;
  ------------------
  |  Branch (1649:9): [True: 12.2M, False: 63.9M]
  ------------------
 1650|  76.2M|  } else {
 1651|  6.67M|    c = 0;
 1652|  6.67M|    bitsNeeded = 8;
 1653|  18.5M|    do {
 1654|  18.5M|      bitsUsed = (bitsAvail < bitsNeeded) ? bitsAvail : bitsNeeded;
  ------------------
  |  Branch (1654:18): [True: 11.8M, False: 6.66M]
  ------------------
 1655|  18.5M|      c <<= bitsUsed;
 1656|  18.5M|      if (!(a0i & 1)) {
  ------------------
  |  Branch (1656:11): [True: 10.5M, False: 7.98M]
  ------------------
 1657|  10.5M|	c |= 0xff >> (8 - bitsUsed);
 1658|  10.5M|      }
 1659|  18.5M|      bitsAvail -= bitsUsed;
 1660|  18.5M|      bitsNeeded -= bitsUsed;
 1661|  18.5M|      if (bitsAvail == 0) {
  ------------------
  |  Branch (1661:11): [True: 13.8M, False: 4.62M]
  ------------------
 1662|  13.8M|	if (codingLine[a0i] >= columns) {
  ------------------
  |  Branch (1662:6): [True: 384k, False: 13.5M]
  ------------------
 1663|   384k|	  c <<= bitsNeeded;
 1664|   384k|	  break;
 1665|   384k|	}
 1666|  13.5M|	++a0i;
 1667|  13.5M|	bitsAvail = codingLine[a0i] - codingLine[a0i - 1];
 1668|  13.5M|      }
 1669|  18.5M|    } while (bitsNeeded > 0);
  ------------------
  |  Branch (1669:14): [True: 11.8M, False: 6.28M]
  ------------------
 1670|  6.67M|  }
 1671|  82.9M|  nextCol += 8;
 1672|  82.9M|  c ^= blackXOR;
 1673|  82.9M|  return c;
 1674|  84.1M|}
_ZN14CCITTFaxStream8lookCharEv:
 1676|  14.2M|int CCITTFaxStream::lookChar() {
 1677|  14.2M|  int c, bitsNeeded, bitsAvail, bitsUsed, i;
 1678|       |
 1679|  14.2M|  if (nextCol >= columns) {
  ------------------
  |  Branch (1679:7): [True: 66.2k, False: 14.2M]
  ------------------
 1680|  66.2k|    if (eof) {
  ------------------
  |  Branch (1680:9): [True: 1.30k, False: 64.9k]
  ------------------
 1681|  1.30k|      return EOF;
 1682|  1.30k|    }
 1683|  64.9k|    if (!readRow()) {
  ------------------
  |  Branch (1683:9): [True: 274, False: 64.6k]
  ------------------
 1684|    274|      return EOF;
 1685|    274|    }
 1686|  64.9k|  }
 1687|  14.2M|  bitsAvail = codingLine[a0i] - nextCol;
 1688|  14.2M|  if (bitsAvail >= 8) {
  ------------------
  |  Branch (1688:7): [True: 13.9M, False: 372k]
  ------------------
 1689|  13.9M|    c = (a0i & 1) ? 0x00 : 0xff;
  ------------------
  |  Branch (1689:9): [True: 56.4k, False: 13.8M]
  ------------------
 1690|  13.9M|  } else {
 1691|   372k|    i = a0i;
 1692|   372k|    c = 0;
 1693|   372k|    bitsNeeded = 8;
 1694|  1.11M|    do {
 1695|  1.11M|      bitsUsed = (bitsAvail < bitsNeeded) ? bitsAvail : bitsNeeded;
  ------------------
  |  Branch (1695:18): [True: 744k, False: 370k]
  ------------------
 1696|  1.11M|      c <<= bitsUsed;
 1697|  1.11M|      if (!(i & 1)) {
  ------------------
  |  Branch (1697:11): [True: 596k, False: 519k]
  ------------------
 1698|   596k|	c |= 0xff >> (8 - bitsUsed);
 1699|   596k|      }
 1700|  1.11M|      bitsAvail -= bitsUsed;
 1701|  1.11M|      bitsNeeded -= bitsUsed;
 1702|  1.11M|      if (bitsAvail == 0) {
  ------------------
  |  Branch (1702:11): [True: 830k, False: 284k]
  ------------------
 1703|   830k|	if (codingLine[i] >= columns) {
  ------------------
  |  Branch (1703:6): [True: 9.06k, False: 821k]
  ------------------
 1704|  9.06k|	  c <<= bitsNeeded;
 1705|  9.06k|	  break;
 1706|  9.06k|	}
 1707|   821k|	++i;
 1708|   821k|	bitsAvail = codingLine[i] - codingLine[i - 1];
 1709|   821k|      }
 1710|  1.11M|    } while (bitsNeeded > 0);
  ------------------
  |  Branch (1710:14): [True: 742k, False: 363k]
  ------------------
 1711|   372k|  }
 1712|  14.2M|  c ^= blackXOR;
 1713|  14.2M|  return c;
 1714|  14.2M|}
_ZN14CCITTFaxStream8getBlockEPci:
 1716|    156|int CCITTFaxStream::getBlock(char *blk, int size) {
 1717|    156|  int bytesRead, bitsAvail, bitsNeeded, bitsUsed, byte, c;
 1718|       |
 1719|    156|  bytesRead = 0;
 1720|   220k|  while (bytesRead < size) {
  ------------------
  |  Branch (1720:10): [True: 220k, False: 6]
  ------------------
 1721|   220k|    if (nextCol >= columns) {
  ------------------
  |  Branch (1721:9): [True: 1.02k, False: 219k]
  ------------------
 1722|  1.02k|      if (eof) {
  ------------------
  |  Branch (1722:11): [True: 143, False: 884]
  ------------------
 1723|    143|	break;
 1724|    143|      }
 1725|    884|      if (!readRow()) {
  ------------------
  |  Branch (1725:11): [True: 7, False: 877]
  ------------------
 1726|      7|	break;
 1727|      7|      }
 1728|    884|    }
 1729|   220k|    bitsAvail = codingLine[a0i] - nextCol;
 1730|   220k|    byte = (a0i & 1) ? 0x00 : 0xff;
  ------------------
  |  Branch (1730:12): [True: 74.3k, False: 146k]
  ------------------
 1731|   220k|    if (bitsAvail > 8) {
  ------------------
  |  Branch (1731:9): [True: 64.0k, False: 156k]
  ------------------
 1732|  64.0k|      c = byte;
 1733|  64.0k|      bitsAvail -= 8;
 1734|   156k|    } else {
 1735|   156k|      c = 0;
 1736|   156k|      bitsNeeded = 8;
 1737|   610k|      do {
 1738|   610k|	bitsUsed = (bitsAvail < bitsNeeded) ? bitsAvail : bitsNeeded;
  ------------------
  |  Branch (1738:13): [True: 454k, False: 156k]
  ------------------
 1739|   610k|	c <<= bitsUsed;
 1740|   610k|	c |= byte >> (8 - bitsUsed);
 1741|   610k|	bitsAvail -= bitsUsed;
 1742|   610k|	bitsNeeded -= bitsUsed;
 1743|   610k|	if (bitsAvail == 0) {
  ------------------
  |  Branch (1743:6): [True: 520k, False: 90.8k]
  ------------------
 1744|   520k|	  if (codingLine[a0i] >= columns) {
  ------------------
  |  Branch (1744:8): [True: 1.02k, False: 518k]
  ------------------
 1745|  1.02k|	    c <<= bitsNeeded;
 1746|  1.02k|	    break;
 1747|  1.02k|	  }
 1748|   518k|	  ++a0i;
 1749|   518k|	  bitsAvail = codingLine[a0i] - codingLine[a0i - 1];
 1750|   518k|	  byte ^= 0xff;
 1751|   518k|	}
 1752|   610k|      } while (bitsNeeded > 0);
  ------------------
  |  Branch (1752:16): [True: 454k, False: 155k]
  ------------------
 1753|   156k|    }
 1754|   220k|    nextCol += 8;
 1755|   220k|    blk[bytesRead++] = (char)(c ^ blackXOR);
 1756|   220k|  }
 1757|    156|  return bytesRead;
 1758|    156|}
_ZN14CCITTFaxStream7readRowEv:
 1803|   388k|GBool CCITTFaxStream::readRow() {
 1804|   388k|  int code1, code2, code3;
 1805|   388k|  int b1i, blackPixels, i;
 1806|   388k|  GBool gotEOL;
 1807|       |
 1808|       |  // if at eof just return EOF
 1809|   388k|  if (eof) {
  ------------------
  |  Branch (1809:7): [True: 0, False: 388k]
  ------------------
 1810|      0|    return gFalse;
  ------------------
  |  |   18|      0|#define gFalse 0
  ------------------
 1811|      0|  }
 1812|       |
 1813|   388k|  err = gFalse;
  ------------------
  |  |   18|   388k|#define gFalse 0
  ------------------
 1814|       |
 1815|       |  // 2-D encoding
 1816|   388k|  if (nextLine2D) {
  ------------------
  |  Branch (1816:7): [True: 239k, False: 149k]
  ------------------
 1817|  2.47M|    for (i = 0; codingLine[i] < columns; ++i) {
  ------------------
  |  Branch (1817:17): [True: 2.23M, False: 239k]
  ------------------
 1818|  2.23M|      refLine[i] = codingLine[i];
 1819|  2.23M|    }
 1820|   239k|    refLine[i++] = columns;
 1821|   239k|    refLine[i++] = columns;
 1822|   239k|    refLine[i] = columns;
 1823|   239k|    codingLine[0] = 0;
 1824|   239k|    a0i = 0;
 1825|   239k|    b1i = 0;
 1826|   239k|    blackPixels = 0;
 1827|       |    // invariant:
 1828|       |    // refLine[b1i-1] <= codingLine[a0i] < refLine[b1i] < refLine[b1i+1]
 1829|       |    //                                                             <= columns
 1830|       |    // exception at left edge:
 1831|       |    //   codingLine[a0i = 0] = refLine[b1i = 0] = 0 is possible
 1832|       |    // exception at right edge:
 1833|       |    //   refLine[b1i] = refLine[b1i+1] = columns is possible
 1834|  1.75M|    while (codingLine[a0i] < columns) {
  ------------------
  |  Branch (1834:12): [True: 1.51M, False: 239k]
  ------------------
 1835|  1.51M|      code1 = getTwoDimCode();
 1836|  1.51M|      switch (code1) {
 1837|   211k|      case twoDimPass:
  ------------------
  |  |   25|   211k|#define twoDimPass   0
  ------------------
  |  Branch (1837:7): [True: 211k, False: 1.29M]
  ------------------
 1838|   211k|	addPixels(refLine[b1i + 1], blackPixels);
 1839|   211k|	if (refLine[b1i + 1] < columns) {
  ------------------
  |  Branch (1839:6): [True: 175k, False: 36.1k]
  ------------------
 1840|   175k|	  b1i += 2;
 1841|   175k|	}
 1842|   211k|	break;
 1843|   199k|      case twoDimHoriz:
  ------------------
  |  |   26|   199k|#define twoDimHoriz  1
  ------------------
  |  Branch (1843:7): [True: 199k, False: 1.31M]
  ------------------
 1844|   199k|	code1 = code2 = 0;
 1845|   199k|	if (blackPixels) {
  ------------------
  |  Branch (1845:6): [True: 104k, False: 94.4k]
  ------------------
 1846|   107k|	  do {
 1847|   107k|	    code1 += code3 = getBlackCode();
 1848|   107k|	  } while (code3 >= 64);
  ------------------
  |  Branch (1848:13): [True: 2.81k, False: 104k]
  ------------------
 1849|   119k|	  do {
 1850|   119k|	    code2 += code3 = getWhiteCode();
 1851|   119k|	  } while (code3 >= 64);
  ------------------
  |  Branch (1851:13): [True: 14.3k, False: 104k]
  ------------------
 1852|   104k|	} else {
 1853|   103k|	  do {
 1854|   103k|	    code1 += code3 = getWhiteCode();
 1855|   103k|	  } while (code3 >= 64);
  ------------------
  |  Branch (1855:13): [True: 9.36k, False: 94.4k]
  ------------------
 1856|  94.7k|	  do {
 1857|  94.7k|	    code2 += code3 = getBlackCode();
 1858|  94.7k|	  } while (code3 >= 64);
  ------------------
  |  Branch (1858:13): [True: 300, False: 94.4k]
  ------------------
 1859|  94.4k|	}
 1860|   199k|	addPixels(codingLine[a0i] + code1, blackPixels);
 1861|   199k|	if (codingLine[a0i] < columns) {
  ------------------
  |  Branch (1861:6): [True: 192k, False: 7.03k]
  ------------------
 1862|   192k|	  addPixels(codingLine[a0i] + code2, blackPixels ^ 1);
 1863|   192k|	}
 1864|   480k|	while (refLine[b1i] <= codingLine[a0i] && refLine[b1i] < columns) {
  ------------------
  |  Branch (1864:9): [True: 291k, False: 188k]
  |  Branch (1864:44): [True: 280k, False: 10.5k]
  ------------------
 1865|   280k|	  b1i += 2;
 1866|   280k|	}
 1867|   199k|	break;
 1868|  35.4k|      case twoDimVertR3:
  ------------------
  |  |   32|  35.4k|#define twoDimVertR3 7
  ------------------
  |  Branch (1868:7): [True: 35.4k, False: 1.47M]
  ------------------
 1869|  35.4k|	addPixels(refLine[b1i] + 3, blackPixels);
 1870|  35.4k|	blackPixels ^= 1;
 1871|  35.4k|	if (codingLine[a0i] < columns) {
  ------------------
  |  Branch (1871:6): [True: 23.9k, False: 11.5k]
  ------------------
 1872|  23.9k|	  ++b1i;
 1873|  32.2k|	  while (refLine[b1i] <= codingLine[a0i] && refLine[b1i] < columns) {
  ------------------
  |  Branch (1873:11): [True: 8.34k, False: 23.9k]
  |  Branch (1873:46): [True: 8.34k, False: 0]
  ------------------
 1874|  8.34k|	    b1i += 2;
 1875|  8.34k|	  }
 1876|  23.9k|	}
 1877|  35.4k|	break;
 1878|  14.8k|      case twoDimVertR2:
  ------------------
  |  |   30|  14.8k|#define twoDimVertR2 5
  ------------------
  |  Branch (1878:7): [True: 14.8k, False: 1.49M]
  ------------------
 1879|  14.8k|	addPixels(refLine[b1i] + 2, blackPixels);
 1880|  14.8k|	blackPixels ^= 1;
 1881|  14.8k|	if (codingLine[a0i] < columns) {
  ------------------
  |  Branch (1881:6): [True: 14.1k, False: 689]
  ------------------
 1882|  14.1k|	  ++b1i;
 1883|  16.7k|	  while (refLine[b1i] <= codingLine[a0i] && refLine[b1i] < columns) {
  ------------------
  |  Branch (1883:11): [True: 2.54k, False: 14.1k]
  |  Branch (1883:46): [True: 2.54k, False: 0]
  ------------------
 1884|  2.54k|	    b1i += 2;
 1885|  2.54k|	  }
 1886|  14.1k|	}
 1887|  14.8k|	break;
 1888|   112k|      case twoDimVertR1:
  ------------------
  |  |   28|   112k|#define twoDimVertR1 3
  ------------------
  |  Branch (1888:7): [True: 112k, False: 1.39M]
  ------------------
 1889|   112k|	addPixels(refLine[b1i] + 1, blackPixels);
 1890|   112k|	blackPixels ^= 1;
 1891|   112k|	if (codingLine[a0i] < columns) {
  ------------------
  |  Branch (1891:6): [True: 96.2k, False: 16.0k]
  ------------------
 1892|  96.2k|	  ++b1i;
 1893|   108k|	  while (refLine[b1i] <= codingLine[a0i] && refLine[b1i] < columns) {
  ------------------
  |  Branch (1893:11): [True: 12.2k, False: 96.2k]
  |  Branch (1893:46): [True: 12.2k, False: 0]
  ------------------
 1894|  12.2k|	    b1i += 2;
 1895|  12.2k|	  }
 1896|  96.2k|	}
 1897|   112k|	break;
 1898|   665k|      case twoDimVert0:
  ------------------
  |  |   27|   665k|#define twoDimVert0  2
  ------------------
  |  Branch (1898:7): [True: 665k, False: 845k]
  ------------------
 1899|   665k|	addPixels(refLine[b1i], blackPixels);
 1900|   665k|	blackPixels ^= 1;
 1901|   665k|	if (codingLine[a0i] < columns) {
  ------------------
  |  Branch (1901:6): [True: 568k, False: 96.4k]
  ------------------
 1902|   568k|	  ++b1i;
 1903|   568k|	  while (refLine[b1i] <= codingLine[a0i] && refLine[b1i] < columns) {
  ------------------
  |  Branch (1903:11): [True: 0, False: 568k]
  |  Branch (1903:46): [True: 0, False: 0]
  ------------------
 1904|      0|	    b1i += 2;
 1905|      0|	  }
 1906|   568k|	}
 1907|   665k|	break;
 1908|  31.2k|      case twoDimVertL3:
  ------------------
  |  |   33|  31.2k|#define twoDimVertL3 8
  ------------------
  |  Branch (1908:7): [True: 31.2k, False: 1.48M]
  ------------------
 1909|  31.2k|	addPixelsNeg(refLine[b1i] - 3, blackPixels);
 1910|  31.2k|	blackPixels ^= 1;
 1911|  31.2k|	if (codingLine[a0i] < columns) {
  ------------------
  |  Branch (1911:6): [True: 31.2k, False: 0]
  ------------------
 1912|  31.2k|	  if (b1i > 0) {
  ------------------
  |  Branch (1912:8): [True: 13.3k, False: 17.8k]
  ------------------
 1913|  13.3k|	    --b1i;
 1914|  17.8k|	  } else {
 1915|  17.8k|	    ++b1i;
 1916|  17.8k|	  }
 1917|  37.6k|	  while (refLine[b1i] <= codingLine[a0i] && refLine[b1i] < columns) {
  ------------------
  |  Branch (1917:11): [True: 6.40k, False: 31.2k]
  |  Branch (1917:46): [True: 6.40k, False: 0]
  ------------------
 1918|  6.40k|	    b1i += 2;
 1919|  6.40k|	  }
 1920|  31.2k|	}
 1921|  31.2k|	break;
 1922|  60.4k|      case twoDimVertL2:
  ------------------
  |  |   31|  60.4k|#define twoDimVertL2 6
  ------------------
  |  Branch (1922:7): [True: 60.4k, False: 1.45M]
  ------------------
 1923|  60.4k|	addPixelsNeg(refLine[b1i] - 2, blackPixels);
 1924|  60.4k|	blackPixels ^= 1;
 1925|  60.4k|	if (codingLine[a0i] < columns) {
  ------------------
  |  Branch (1925:6): [True: 60.4k, False: 0]
  ------------------
 1926|  60.4k|	  if (b1i > 0) {
  ------------------
  |  Branch (1926:8): [True: 44.0k, False: 16.3k]
  ------------------
 1927|  44.0k|	    --b1i;
 1928|  44.0k|	  } else {
 1929|  16.3k|	    ++b1i;
 1930|  16.3k|	  }
 1931|  98.3k|	  while (refLine[b1i] <= codingLine[a0i] && refLine[b1i] < columns) {
  ------------------
  |  Branch (1931:11): [True: 37.9k, False: 60.4k]
  |  Branch (1931:46): [True: 37.9k, False: 0]
  ------------------
 1932|  37.9k|	    b1i += 2;
 1933|  37.9k|	  }
 1934|  60.4k|	}
 1935|  60.4k|	break;
 1936|   113k|      case twoDimVertL1:
  ------------------
  |  |   29|   113k|#define twoDimVertL1 4
  ------------------
  |  Branch (1936:7): [True: 113k, False: 1.39M]
  ------------------
 1937|   113k|	addPixelsNeg(refLine[b1i] - 1, blackPixels);
 1938|   113k|	blackPixels ^= 1;
 1939|   113k|	if (codingLine[a0i] < columns) {
  ------------------
  |  Branch (1939:6): [True: 113k, False: 0]
  ------------------
 1940|   113k|	  if (b1i > 0) {
  ------------------
  |  Branch (1940:8): [True: 99.4k, False: 13.5k]
  ------------------
 1941|  99.4k|	    --b1i;
 1942|  99.4k|	  } else {
 1943|  13.5k|	    ++b1i;
 1944|  13.5k|	  }
 1945|   211k|	  while (refLine[b1i] <= codingLine[a0i] && refLine[b1i] < columns) {
  ------------------
  |  Branch (1945:11): [True: 98.2k, False: 113k]
  |  Branch (1945:46): [True: 98.2k, False: 0]
  ------------------
 1946|  98.2k|	    b1i += 2;
 1947|  98.2k|	  }
 1948|   113k|	}
 1949|   113k|	break;
 1950|  67.9k|      case EOF:
  ------------------
  |  Branch (1950:7): [True: 67.9k, False: 1.44M]
  ------------------
 1951|  67.9k|	addPixels(columns, 0);
 1952|  67.9k|	err = gTrue;
  ------------------
  |  |   17|  67.9k|#define gTrue 1
  ------------------
 1953|  67.9k|	break;
 1954|      0|      default:
  ------------------
  |  Branch (1954:7): [True: 0, False: 1.51M]
  ------------------
 1955|      0|	error(errSyntaxError, getPos(),
 1956|      0|	      "Bad 2D code {0:04x} in CCITTFax stream", code1);
 1957|      0|	addPixels(columns, 0);
 1958|      0|	err = gTrue;
  ------------------
  |  |   17|      0|#define gTrue 1
  ------------------
 1959|      0|	++nErrors;
 1960|      0|	break;
 1961|  1.51M|      }
 1962|  1.51M|    }
 1963|       |
 1964|       |  // 1-D encoding
 1965|   239k|  } else {
 1966|   149k|    codingLine[0] = 0;
 1967|   149k|    a0i = 0;
 1968|   149k|    blackPixels = 0;
 1969|  13.7M|    while (codingLine[a0i] < columns) {
  ------------------
  |  Branch (1969:12): [True: 13.6M, False: 149k]
  ------------------
 1970|  13.6M|      code1 = 0;
 1971|  13.6M|      if (blackPixels) {
  ------------------
  |  Branch (1971:11): [True: 6.74M, False: 6.86M]
  ------------------
 1972|  6.76M|	do {
 1973|  6.76M|	  code1 += code3 = getBlackCode();
 1974|  6.76M|	} while (code3 >= 64);
  ------------------
  |  Branch (1974:11): [True: 18.2k, False: 6.74M]
  ------------------
 1975|  6.86M|      } else {
 1976|  7.24M|	do {
 1977|  7.24M|	  code1 += code3 = getWhiteCode();
 1978|  7.24M|	} while (code3 >= 64);
  ------------------
  |  Branch (1978:11): [True: 374k, False: 6.86M]
  ------------------
 1979|  6.86M|      }
 1980|  13.6M|      addPixels(codingLine[a0i] + code1, blackPixels);
 1981|  13.6M|      blackPixels ^= 1;
 1982|  13.6M|    }
 1983|   149k|  }
 1984|       |
 1985|       |  // check for end-of-line marker, skipping over any extra zero bits
 1986|       |  // (if EncodedByteAlign is true and EndOfLine is false, there can
 1987|       |  // be "false" EOL markers -- i.e., if the last n unused bits in
 1988|       |  // row i are set to zero, and the first 11-n bits in row i+1
 1989|       |  // happen to be zero -- so we don't look for EOL markers in this
 1990|       |  // case)
 1991|   388k|  gotEOL = gFalse;
  ------------------
  |  |   18|   388k|#define gFalse 0
  ------------------
 1992|   388k|  if (!endOfBlock && row == rows - 1) {
  ------------------
  |  Branch (1992:7): [True: 251k, False: 137k]
  |  Branch (1992:22): [True: 242, False: 251k]
  ------------------
 1993|    242|    eof = gTrue;
  ------------------
  |  |   17|    242|#define gTrue 1
  ------------------
 1994|   388k|  } else if (endOfLine || !byteAlign) {
  ------------------
  |  Branch (1994:14): [True: 22.3k, False: 366k]
  |  Branch (1994:27): [True: 366k, False: 0]
  ------------------
 1995|   388k|    code1 = lookBits(12);
 1996|   388k|    if (endOfLine) {
  ------------------
  |  Branch (1996:9): [True: 22.3k, False: 366k]
  ------------------
 1997|  35.2M|      while (code1 != EOF && code1 != 0x001) {
  ------------------
  |  Branch (1997:14): [True: 35.2M, False: 894]
  |  Branch (1997:30): [True: 35.2M, False: 21.4k]
  ------------------
 1998|  35.2M|	eatBits(1);
 1999|  35.2M|	code1 = lookBits(12);
 2000|  35.2M|      }
 2001|   366k|    } else {
 2002|  1.32M|      while (code1 == 0) {
  ------------------
  |  Branch (2002:14): [True: 955k, False: 366k]
  ------------------
 2003|   955k|	eatBits(1);
 2004|   955k|	code1 = lookBits(12);
 2005|   955k|      }
 2006|   366k|    }
 2007|   388k|    if (code1 == 0x001) {
  ------------------
  |  Branch (2007:9): [True: 35.4k, False: 353k]
  ------------------
 2008|  35.4k|      eatBits(12);
 2009|  35.4k|      gotEOL = gTrue;
  ------------------
  |  |   17|  35.4k|#define gTrue 1
  ------------------
 2010|  35.4k|    }
 2011|   388k|  }
 2012|       |
 2013|       |  // byte-align the row
 2014|       |  // (Adobe apparently doesn't do byte alignment after EOL markers
 2015|       |  // -- I've seen CCITT image data streams in two different formats,
 2016|       |  // both with the byteAlign flag set:
 2017|       |  //   1. xx:x0:01:yy:yy
 2018|       |  //   2. xx:00:1y:yy:yy
 2019|       |  // where xx is the previous line, yy is the next line, and colons
 2020|       |  // separate bytes.)
 2021|   388k|  if (byteAlign && !gotEOL) {
  ------------------
  |  Branch (2021:7): [True: 0, False: 388k]
  |  Branch (2021:20): [True: 0, False: 0]
  ------------------
 2022|      0|    inputBits &= ~7;
 2023|      0|  }
 2024|       |
 2025|       |  // check for end of stream
 2026|   388k|  if (lookBits(1) == EOF) {
  ------------------
  |  Branch (2026:7): [True: 3.82k, False: 385k]
  ------------------
 2027|  3.82k|    eof = gTrue;
  ------------------
  |  |   17|  3.82k|#define gTrue 1
  ------------------
 2028|  3.82k|  }
 2029|       |
 2030|       |  // get 2D encoding tag
 2031|   388k|  if (!eof && encoding > 0) {
  ------------------
  |  Branch (2031:7): [True: 384k, False: 4.06k]
  |  Branch (2031:15): [True: 347k, False: 37.3k]
  ------------------
 2032|   347k|    nextLine2D = !lookBits(1);
 2033|   347k|    eatBits(1);
 2034|   347k|  }
 2035|       |
 2036|       |  // check for end-of-block marker
 2037|   388k|  if (endOfBlock && !endOfLine && byteAlign) {
  ------------------
  |  Branch (2037:7): [True: 137k, False: 251k]
  |  Branch (2037:21): [True: 117k, False: 19.3k]
  |  Branch (2037:35): [True: 0, False: 117k]
  ------------------
 2038|       |    // in this case, we didn't check for an EOL code above, so we
 2039|       |    // need to check here
 2040|      0|    code1 = lookBits(24);
 2041|      0|    if (code1 == 0x001001) {
  ------------------
  |  Branch (2041:9): [True: 0, False: 0]
  ------------------
 2042|      0|      eatBits(12);
 2043|      0|      gotEOL = gTrue;
  ------------------
  |  |   17|      0|#define gTrue 1
  ------------------
 2044|      0|    }
 2045|      0|  }
 2046|   388k|  if (endOfBlock && gotEOL) {
  ------------------
  |  Branch (2046:7): [True: 137k, False: 251k]
  |  Branch (2046:21): [True: 23.4k, False: 113k]
  ------------------
 2047|  23.4k|    code1 = lookBits(12);
 2048|  23.4k|    if (code1 == 0x001) {
  ------------------
  |  Branch (2048:9): [True: 1.20k, False: 22.2k]
  ------------------
 2049|  1.20k|      eatBits(12);
 2050|  1.20k|      if (encoding > 0) {
  ------------------
  |  Branch (2050:11): [True: 672, False: 532]
  ------------------
 2051|    672|	lookBits(1);
 2052|    672|	eatBits(1);
 2053|    672|      }
 2054|  1.20k|      if (encoding > 0) {
  ------------------
  |  Branch (2054:11): [True: 672, False: 532]
  ------------------
 2055|  3.36k|	for (i = 0; i < 4; ++i) {
  ------------------
  |  Branch (2055:14): [True: 2.68k, False: 672]
  ------------------
 2056|  2.68k|	  code1 = lookBits(12);
 2057|  2.68k|	  if (code1 != 0x001) {
  ------------------
  |  Branch (2057:8): [True: 2.42k, False: 261]
  ------------------
 2058|  2.42k|	    error(errSyntaxError, getPos(),
 2059|  2.42k|		  "Bad RTC code in CCITTFax stream");
 2060|  2.42k|	    ++nErrors;
 2061|  2.42k|	  }
 2062|  2.68k|	  eatBits(12);
 2063|  2.68k|	  if (encoding > 0) {
  ------------------
  |  Branch (2063:8): [True: 2.68k, False: 0]
  ------------------
 2064|  2.68k|	    lookBits(1);
 2065|  2.68k|	    eatBits(1);
 2066|  2.68k|	  }
 2067|  2.68k|	}
 2068|    672|      }
 2069|  1.20k|      eof = gTrue;
  ------------------
  |  |   17|  1.20k|#define gTrue 1
  ------------------
 2070|  1.20k|    }
 2071|       |
 2072|       |  // look for an end-of-line marker after an error -- we only do
 2073|       |  // this if we know the stream contains end-of-line markers because
 2074|       |  // the "just plow on" technique tends to work better otherwise
 2075|   365k|  } else if (err && endOfLine) {
  ------------------
  |  Branch (2075:14): [True: 226k, False: 138k]
  |  Branch (2075:21): [True: 2.86k, False: 224k]
  ------------------
 2076|  50.0M|    while (1) {
  ------------------
  |  Branch (2076:12): [True: 50.0M, Folded]
  ------------------
 2077|  50.0M|      code1 = lookBits(13);
 2078|  50.0M|      if (code1 == EOF) {
  ------------------
  |  Branch (2078:11): [True: 706, False: 50.0M]
  ------------------
 2079|    706|	eof = gTrue;
  ------------------
  |  |   17|    706|#define gTrue 1
  ------------------
 2080|    706|	return gFalse;
  ------------------
  |  |   18|    706|#define gFalse 0
  ------------------
 2081|    706|      }
 2082|  50.0M|      if ((code1 >> 1) == 0x001) {
  ------------------
  |  Branch (2082:11): [True: 2.15k, False: 50.0M]
  ------------------
 2083|  2.15k|	break;
 2084|  2.15k|      }
 2085|  50.0M|      eatBits(1);
 2086|  50.0M|    }
 2087|  2.15k|    eatBits(12); 
 2088|  2.15k|    if (encoding > 0) {
  ------------------
  |  Branch (2088:9): [True: 2.00k, False: 156]
  ------------------
 2089|  2.00k|      eatBits(1);
 2090|  2.00k|      nextLine2D = !(code1 & 1);
 2091|  2.00k|    }
 2092|  2.15k|  }
 2093|       |
 2094|       |  // corrupt CCITTFax streams can generate huge data expansion -- we
 2095|       |  // avoid that case by aborting decode after 1000 errors
 2096|   388k|  if (nErrors > 1000) {
  ------------------
  |  Branch (2096:7): [True: 394, False: 387k]
  ------------------
 2097|    394|    error(errSyntaxError, getPos(), "Too many errors in CCITTFaxStream - aborting decode");
 2098|    394|    eof = gTrue;
  ------------------
  |  |   17|    394|#define gTrue 1
  ------------------
 2099|    394|    return gFalse;
  ------------------
  |  |   18|    394|#define gFalse 0
  ------------------
 2100|    394|  }
 2101|       |
 2102|       |  // set up for output
 2103|   387k|  nextCol = 0;
 2104|   387k|  a0i = (codingLine[0] > 0) ? 0 : 1;
  ------------------
  |  Branch (2104:9): [True: 382k, False: 5.20k]
  ------------------
 2105|       |
 2106|   387k|  ++row;
 2107|       |
 2108|   387k|  return gTrue;
  ------------------
  |  |   17|   387k|#define gTrue 1
  ------------------
 2109|   388k|}
_ZN14CCITTFaxStream13getTwoDimCodeEv:
 2111|  1.51M|short CCITTFaxStream::getTwoDimCode() {
 2112|  1.51M|  int code;
 2113|  1.51M|  CCITTCode *p;
 2114|  1.51M|  int n;
 2115|       |
 2116|  1.51M|  code = 0; // make gcc happy
 2117|  1.51M|  if (endOfBlock) {
  ------------------
  |  Branch (2117:7): [True: 360k, False: 1.15M]
  ------------------
 2118|   360k|    if ((code = lookBits(7)) != EOF) {
  ------------------
  |  Branch (2118:9): [True: 360k, False: 284]
  ------------------
 2119|   360k|      p = &twoDimTab1[code];
 2120|   360k|      if (p->bits > 0) {
  ------------------
  |  Branch (2120:11): [True: 341k, False: 18.9k]
  ------------------
 2121|   341k|	eatBits(p->bits);
 2122|   341k|	return p->n;
 2123|   341k|      }
 2124|   360k|    }
 2125|  1.15M|  } else {
 2126|  3.18M|    for (n = 1; n <= 7; ++n) {
  ------------------
  |  Branch (2126:17): [True: 3.13M, False: 48.5k]
  ------------------
 2127|  3.13M|      if ((code = lookBits(n)) == EOF) {
  ------------------
  |  Branch (2127:11): [True: 159, False: 3.13M]
  ------------------
 2128|    159|	break;
 2129|    159|      }
 2130|  3.13M|      if (n < 7) {
  ------------------
  |  Branch (2130:11): [True: 3.03M, False: 95.0k]
  ------------------
 2131|  3.03M|	code <<= 7 - n;
 2132|  3.03M|      }
 2133|  3.13M|      p = &twoDimTab1[code];
 2134|  3.13M|      if (p->bits == n) {
  ------------------
  |  Branch (2134:11): [True: 1.10M, False: 2.03M]
  ------------------
 2135|  1.10M|	eatBits(n);
 2136|  1.10M|	return p->n;
 2137|  1.10M|      }
 2138|  3.13M|    }
 2139|  1.15M|  }
 2140|  67.9k|  error(errSyntaxError, getPos(),
 2141|  67.9k|	"Bad two dim code ({0:04x}) in CCITTFax stream", code);
 2142|  67.9k|  ++nErrors;
 2143|       |  return EOF;
 2144|  1.51M|}
_ZN14CCITTFaxStream12getWhiteCodeEv:
 2146|  7.46M|short CCITTFaxStream::getWhiteCode() {
 2147|  7.46M|  short code;
 2148|  7.46M|  CCITTCode *p;
 2149|  7.46M|  int n;
 2150|       |
 2151|  7.46M|  code = 0; // make gcc happy
 2152|  7.46M|  if (endOfBlock) {
  ------------------
  |  Branch (2152:7): [True: 5.73M, False: 1.72M]
  ------------------
 2153|  5.73M|    code = lookBits(12);
 2154|  5.73M|    if (code == EOF) {
  ------------------
  |  Branch (2154:9): [True: 1.15M, False: 4.58M]
  ------------------
 2155|  1.15M|      return 1;
 2156|  1.15M|    }
 2157|  4.58M|    if ((code >> 5) == 0) {
  ------------------
  |  Branch (2157:9): [True: 716k, False: 3.86M]
  ------------------
 2158|   716k|      p = &whiteTab1[code];
 2159|  3.86M|    } else {
 2160|  3.86M|      p = &whiteTab2[code >> 3];
 2161|  3.86M|    }
 2162|  4.58M|    if (p->bits > 0) {
  ------------------
  |  Branch (2162:9): [True: 3.88M, False: 701k]
  ------------------
 2163|  3.88M|      eatBits(p->bits);
 2164|  3.88M|      return p->n;
 2165|  3.88M|    }
 2166|  4.58M|  } else {
 2167|  8.89M|    for (n = 1; n <= 9; ++n) {
  ------------------
  |  Branch (2167:17): [True: 8.71M, False: 189k]
  ------------------
 2168|  8.71M|      code = lookBits(n);
 2169|  8.71M|      if (code == EOF) {
  ------------------
  |  Branch (2169:11): [True: 356k, False: 8.35M]
  ------------------
 2170|   356k|	return 1;
 2171|   356k|      }
 2172|  8.35M|      if (n < 9) {
  ------------------
  |  Branch (2172:11): [True: 8.14M, False: 204k]
  ------------------
 2173|  8.14M|	code = (short)(code << (9 - n));
 2174|  8.14M|      }
 2175|  8.35M|      p = &whiteTab2[code];
 2176|  8.35M|      if (p->bits == n) {
  ------------------
  |  Branch (2176:11): [True: 1.18M, False: 7.17M]
  ------------------
 2177|  1.18M|	eatBits(n);
 2178|  1.18M|	return p->n;
 2179|  1.18M|      }
 2180|  8.35M|    }
 2181|   547k|    for (n = 11; n <= 12; ++n) {
  ------------------
  |  Branch (2181:18): [True: 375k, False: 172k]
  ------------------
 2182|   375k|      code = lookBits(n);
 2183|   375k|      if (code == EOF) {
  ------------------
  |  Branch (2183:11): [True: 0, False: 375k]
  ------------------
 2184|      0|	return 1;
 2185|      0|      }
 2186|   375k|      if (n < 12) {
  ------------------
  |  Branch (2186:11): [True: 189k, False: 185k]
  ------------------
 2187|   189k|	code = (short)(code << (12 - n));
 2188|   189k|      }
 2189|   375k|      p = &whiteTab1[code];
 2190|   375k|      if (p->bits == n) {
  ------------------
  |  Branch (2190:11): [True: 16.7k, False: 358k]
  ------------------
 2191|  16.7k|	eatBits(n);
 2192|  16.7k|	return p->n;
 2193|  16.7k|      }
 2194|   375k|    }
 2195|   189k|  }
 2196|   874k|  error(errSyntaxError, getPos(),
 2197|   874k|	"Bad white code ({0:04x}) in CCITTFax stream", code);
 2198|   874k|  ++nErrors;
 2199|       |  // eat a bit and return a positive number so that the caller doesn't
 2200|       |  // go into an infinite loop
 2201|   874k|  eatBits(1);
 2202|   874k|  return 1;
 2203|  7.46M|}
_ZN14CCITTFaxStream12getBlackCodeEv:
 2205|  6.96M|short CCITTFaxStream::getBlackCode() {
 2206|  6.96M|  short code;
 2207|  6.96M|  CCITTCode *p;
 2208|  6.96M|  int n;
 2209|       |
 2210|  6.96M|  code = 0; // make gcc happy
 2211|  6.96M|  if (endOfBlock) {
  ------------------
  |  Branch (2211:7): [True: 5.57M, False: 1.39M]
  ------------------
 2212|  5.57M|    code = lookBits(13);
 2213|  5.57M|    if (code == EOF) {
  ------------------
  |  Branch (2213:9): [True: 1.15M, False: 4.41M]
  ------------------
 2214|  1.15M|      return 1;
 2215|  1.15M|    }
 2216|  4.41M|    if ((code >> 7) == 0) {
  ------------------
  |  Branch (2216:9): [True: 726k, False: 3.69M]
  ------------------
 2217|   726k|      p = &blackTab1[code];
 2218|  3.69M|    } else if ((code >> 9) == 0 && (code >> 7) != 0) {
  ------------------
  |  Branch (2218:16): [True: 55.0k, False: 3.63M]
  |  Branch (2218:36): [True: 55.0k, False: 0]
  ------------------
 2219|  55.0k|      p = &blackTab2[(code >> 1) - 64];
 2220|  3.63M|    } else {
 2221|  3.63M|      p = &blackTab3[code >> 7];
 2222|  3.63M|    }
 2223|  4.41M|    if (p->bits > 0) {
  ------------------
  |  Branch (2223:9): [True: 3.71M, False: 703k]
  ------------------
 2224|  3.71M|      eatBits(p->bits);
 2225|  3.71M|      return p->n;
 2226|  3.71M|    }
 2227|  4.41M|  } else {
 2228|  3.46M|    for (n = 2; n <= 6; ++n) {
  ------------------
  |  Branch (2228:17): [True: 3.20M, False: 260k]
  ------------------
 2229|  3.20M|      code = lookBits(n);
 2230|  3.20M|      if (code == EOF) {
  ------------------
  |  Branch (2230:11): [True: 356k, False: 2.85M]
  ------------------
 2231|   356k|	return 1;
 2232|   356k|      }
 2233|  2.85M|      if (n < 6) {
  ------------------
  |  Branch (2233:11): [True: 2.56M, False: 280k]
  ------------------
 2234|  2.56M|	code = (short)(code << (6 - n));
 2235|  2.56M|      }
 2236|  2.85M|      p = &blackTab3[code];
 2237|  2.85M|      if (p->bits == n) {
  ------------------
  |  Branch (2237:11): [True: 775k, False: 2.07M]
  ------------------
 2238|   775k|	eatBits(n);
 2239|   775k|	return p->n;
 2240|   775k|      }
 2241|  2.85M|    }
 2242|  1.55M|    for (n = 7; n <= 12; ++n) {
  ------------------
  |  Branch (2242:17): [True: 1.35M, False: 196k]
  ------------------
 2243|  1.35M|      code = lookBits(n);
 2244|  1.35M|      if (code == EOF) {
  ------------------
  |  Branch (2244:11): [True: 0, False: 1.35M]
  ------------------
 2245|      0|	return 1;
 2246|      0|      }
 2247|  1.35M|      if (n < 12) {
  ------------------
  |  Branch (2247:11): [True: 1.15M, False: 202k]
  ------------------
 2248|  1.15M|	code = (short)(code << (12 - n));
 2249|  1.15M|      }
 2250|  1.35M|      if (code >= 64) {
  ------------------
  |  Branch (2250:11): [True: 180k, False: 1.17M]
  ------------------
 2251|   180k|	p = &blackTab2[code - 64];
 2252|   180k|	if (p->bits == n) {
  ------------------
  |  Branch (2252:6): [True: 64.8k, False: 115k]
  ------------------
 2253|  64.8k|	  eatBits(n);
 2254|  64.8k|	  return p->n;
 2255|  64.8k|	}
 2256|   180k|      }
 2257|  1.35M|    }
 2258|   932k|    for (n = 10; n <= 13; ++n) {
  ------------------
  |  Branch (2258:18): [True: 757k, False: 175k]
  ------------------
 2259|   757k|      code = lookBits(n);
 2260|   757k|      if (code == EOF) {
  ------------------
  |  Branch (2260:11): [True: 0, False: 757k]
  ------------------
 2261|      0|	return 1;
 2262|      0|      }
 2263|   757k|      if (n < 13) {
  ------------------
  |  Branch (2263:11): [True: 579k, False: 177k]
  ------------------
 2264|   579k|	code = (short)(code << (13 - n));
 2265|   579k|      }
 2266|   757k|      p = &blackTab1[code];
 2267|   757k|      if (p->bits == n) {
  ------------------
  |  Branch (2267:11): [True: 20.6k, False: 736k]
  ------------------
 2268|  20.6k|	eatBits(n);
 2269|  20.6k|	return p->n;
 2270|  20.6k|      }
 2271|   757k|    }
 2272|   196k|  }
 2273|   878k|  error(errSyntaxError, getPos(),
 2274|   878k|	"Bad black code ({0:04x}) in CCITTFax stream", code);
 2275|   878k|  ++nErrors;
 2276|       |  // eat a bit and return a positive number so that the caller doesn't
 2277|       |  // go into an infinite loop
 2278|   878k|  eatBits(1);
 2279|   878k|  return 1;
 2280|  6.96M|}
_ZN14CCITTFaxStream8lookBitsEi:
 2282|   117M|short CCITTFaxStream::lookBits(int n) {
 2283|   117M|  int c;
 2284|       |
 2285|   134M|  while (inputBits < n) {
  ------------------
  |  Branch (2285:10): [True: 19.1M, False: 114M]
  ------------------
 2286|  19.1M|    if ((c = str->getChar()) == EOF) {
  ------------------
  |  Branch (2286:9): [True: 3.05M, False: 16.1M]
  ------------------
 2287|  3.05M|      if (inputBits == 0) {
  ------------------
  |  Branch (2287:11): [True: 3.03M, False: 21.2k]
  ------------------
 2288|  3.03M|	return EOF;
 2289|  3.03M|      }
 2290|       |      // near the end of the stream, the caller may ask for more bits
 2291|       |      // than are available, but there may still be a valid code in
 2292|       |      // however many bits are available -- we need to return correct
 2293|       |      // data in this case
 2294|  21.2k|      return (short)((inputBuf << (n - inputBits)) & (0xffffffff >> (32 - n)));
 2295|  3.05M|    }
 2296|  16.1M|    inputBuf = (inputBuf << 8) + c;
 2297|  16.1M|    inputBits += 8;
 2298|  16.1M|  }
 2299|   114M|  return (short)((inputBuf >> (inputBits - n)) & (0xffffffff >> (32 - n)));
 2300|   117M|}
_ZN9DCTStreamC2EP6Streami:
 2662|  72.8k|    FilterStream(strA) {
 2663|  72.8k|  int i;
 2664|       |
 2665|  72.8k|  prepared = gFalse;
  ------------------
  |  |   18|  72.8k|#define gFalse 0
  ------------------
 2666|  72.8k|  colorXform = colorXformA;
 2667|  72.8k|  progressive = interleaved = gFalse;
  ------------------
  |  |   18|  72.8k|#define gFalse 0
  ------------------
 2668|  72.8k|  width = height = 0;
 2669|  72.8k|  mcuWidth = mcuHeight = 0;
 2670|  72.8k|  numComps = 0;
 2671|  72.8k|  comp = 0;
 2672|  72.8k|  x = y = 0;
 2673|   364k|  for (i = 0; i < 4; ++i) {
  ------------------
  |  Branch (2673:15): [True: 291k, False: 72.8k]
  ------------------
 2674|   291k|    frameBuf[i] = NULL;
 2675|   291k|  }
 2676|  72.8k|  rowBuf = NULL;
 2677|  72.8k|  memset(quantTables, 0, sizeof(quantTables));
 2678|  72.8k|  memset(dcHuffTables, 0, sizeof(dcHuffTables));
 2679|  72.8k|  memset(acHuffTables, 0, sizeof(acHuffTables));
 2680|       |
 2681|  72.8k|  dctClipInit();
 2682|  72.8k|}
_ZN9DCTStreamD2Ev:
 2684|  72.6k|DCTStream::~DCTStream() {
 2685|  72.6k|  close();
 2686|  72.6k|  delete str;
 2687|  72.6k|}
_ZN9DCTStream4copyEv:
 2689|  70.4k|Stream *DCTStream::copy() {
 2690|  70.4k|  return new DCTStream(str->copy(), colorXform);
 2691|  70.4k|}
_ZN9DCTStream5resetEv:
 2693|  23.5k|void DCTStream::reset() {
 2694|  23.5k|  int i;
 2695|       |
 2696|  23.5k|  str->reset();
 2697|       |
 2698|  23.5k|  progressive = interleaved = gFalse;
  ------------------
  |  |   18|  23.5k|#define gFalse 0
  ------------------
 2699|  23.5k|  width = height = 0;
 2700|  23.5k|  numComps = 0;
 2701|  23.5k|  numQuantTables = 0;
 2702|  23.5k|  numDCHuffTables = 0;
 2703|  23.5k|  numACHuffTables = 0;
 2704|  23.5k|  gotJFIFMarker = gFalse;
  ------------------
  |  |   18|  23.5k|#define gFalse 0
  ------------------
 2705|  23.5k|  gotAdobeMarker = gFalse;
  ------------------
  |  |   18|  23.5k|#define gFalse 0
  ------------------
 2706|  23.5k|  restartInterval = 0;
 2707|       |
 2708|  23.5k|  if (!readHeader(gTrue)) {
  ------------------
  |  |   17|  23.5k|#define gTrue 1
  ------------------
  |  Branch (2708:7): [True: 12.5k, False: 10.9k]
  ------------------
 2709|       |    // force an EOF condition
 2710|  12.5k|    progressive = gTrue;
  ------------------
  |  |   17|  12.5k|#define gTrue 1
  ------------------
 2711|  12.5k|    y = height;
 2712|  12.5k|    prepared = gTrue;
  ------------------
  |  |   17|  12.5k|#define gTrue 1
  ------------------
 2713|  12.5k|    return;
 2714|  12.5k|  }
 2715|       |
 2716|       |  // compute MCU size
 2717|  10.9k|  if (numComps == 1) {
  ------------------
  |  Branch (2717:7): [True: 1.07k, False: 9.90k]
  ------------------
 2718|  1.07k|    compInfo[0].hSample = compInfo[0].vSample = 1;
 2719|  1.07k|  }
 2720|  10.9k|  mcuWidth = compInfo[0].hSample;
 2721|  10.9k|  mcuHeight = compInfo[0].vSample;
 2722|  33.1k|  for (i = 1; i < numComps; ++i) {
  ------------------
  |  Branch (2722:15): [True: 22.1k, False: 10.9k]
  ------------------
 2723|  22.1k|    if (compInfo[i].hSample > mcuWidth) {
  ------------------
  |  Branch (2723:9): [True: 241, False: 21.9k]
  ------------------
 2724|    241|      mcuWidth = compInfo[i].hSample;
 2725|    241|    }
 2726|  22.1k|    if (compInfo[i].vSample > mcuHeight) {
  ------------------
  |  Branch (2726:9): [True: 1.18k, False: 20.9k]
  ------------------
 2727|  1.18k|      mcuHeight = compInfo[i].vSample;
 2728|  1.18k|    }
 2729|  22.1k|  }
 2730|  10.9k|  mcuWidth *= 8;
 2731|  10.9k|  mcuHeight *= 8;
 2732|       |
 2733|       |  // figure out color transform
 2734|  10.9k|  if (colorXform == -1) {
  ------------------
  |  Branch (2734:7): [True: 7.24k, False: 3.73k]
  ------------------
 2735|  7.24k|    if (numComps == 3) {
  ------------------
  |  Branch (2735:9): [True: 6.80k, False: 439]
  ------------------
 2736|  6.80k|      if (gotJFIFMarker) {
  ------------------
  |  Branch (2736:11): [True: 3.87k, False: 2.93k]
  ------------------
 2737|  3.87k|	colorXform = 1;
 2738|  3.87k|      } else if (compInfo[0].id == 82 && compInfo[1].id == 71 &&
  ------------------
  |  Branch (2738:18): [True: 35, False: 2.90k]
  |  Branch (2738:42): [True: 35, False: 0]
  ------------------
 2739|     35|		 compInfo[2].id == 66) { // ASCII "RGB"
  ------------------
  |  Branch (2739:4): [True: 35, False: 0]
  ------------------
 2740|     35|	colorXform = 0;
 2741|  2.90k|      } else {
 2742|  2.90k|	colorXform = 1;
 2743|  2.90k|      }
 2744|  6.80k|    } else {
 2745|    439|      colorXform = 0;
 2746|    439|    }
 2747|  7.24k|  }
 2748|       |
 2749|  10.9k|  prepared = gFalse;
  ------------------
  |  |   18|  10.9k|#define gFalse 0
  ------------------
 2750|  10.9k|}
_ZN9DCTStream5closeEv:
 2774|  95.5k|void DCTStream::close() {
 2775|  95.5k|  int i;
 2776|       |
 2777|   477k|  for (i = 0; i < 4; ++i) {
  ------------------
  |  Branch (2777:15): [True: 382k, False: 95.5k]
  ------------------
 2778|   382k|    gfree(frameBuf[i]);
 2779|   382k|    frameBuf[i] = NULL;
 2780|   382k|  }
 2781|  95.5k|  gfree(rowBuf);
 2782|       |  rowBuf = NULL;
 2783|  95.5k|  FilterStream::close();
 2784|  95.5k|}
_ZN9DCTStream7getCharEv:
 2786|  47.2M|int DCTStream::getChar() {
 2787|  47.2M|  int c;
 2788|       |
 2789|  47.2M|  if (!prepared) {
  ------------------
  |  Branch (2789:7): [True: 10.7k, False: 47.2M]
  ------------------
 2790|  10.7k|    prepare();
 2791|  10.7k|  }
 2792|  47.2M|  if (progressive || !interleaved) {
  ------------------
  |  Branch (2792:7): [True: 38.5M, False: 8.70M]
  |  Branch (2792:22): [True: 1.89M, False: 6.80M]
  ------------------
 2793|  40.4M|    if (y >= height) {
  ------------------
  |  Branch (2793:9): [True: 13.1k, False: 40.4M]
  ------------------
 2794|  13.1k|      return EOF;
 2795|  13.1k|    }
 2796|  40.4M|    c = frameBuf[comp][y * bufWidth + x];
 2797|  40.4M|    if (++comp == numComps) {
  ------------------
  |  Branch (2797:9): [True: 23.3M, False: 17.0M]
  ------------------
 2798|  23.3M|      comp = 0;
 2799|  23.3M|      if (++x == width) {
  ------------------
  |  Branch (2799:11): [True: 198k, False: 23.1M]
  ------------------
 2800|   198k|	x = 0;
 2801|   198k|	++y;
 2802|   198k|      }
 2803|  23.3M|    }
 2804|  40.4M|  } else {
 2805|  6.80M|    if (rowBufPtr == rowBufEnd) {
  ------------------
  |  Branch (2805:9): [True: 4.86k, False: 6.80M]
  ------------------
 2806|  4.86k|      if (y + mcuHeight >= height) {
  ------------------
  |  Branch (2806:11): [True: 780, False: 4.08k]
  ------------------
 2807|    780|	return EOF;
 2808|    780|      }
 2809|  4.08k|      y += mcuHeight;
 2810|  4.08k|      if (!readMCURow()) {
  ------------------
  |  Branch (2810:11): [True: 1.25k, False: 2.83k]
  ------------------
 2811|  1.25k|	y = height;
 2812|  1.25k|	return EOF;
 2813|  1.25k|      }
 2814|  4.08k|    }
 2815|  6.80M|    c = *rowBufPtr++;
 2816|  6.80M|  }
 2817|  47.2M|  return c;
 2818|  47.2M|}
_ZN9DCTStream8lookCharEv:
 2820|  24.8M|int DCTStream::lookChar() {
 2821|  24.8M|  if (!prepared) {
  ------------------
  |  Branch (2821:7): [True: 0, False: 24.8M]
  ------------------
 2822|      0|    prepare();
 2823|      0|  }
 2824|  24.8M|  if (progressive || !interleaved) {
  ------------------
  |  Branch (2824:7): [True: 21.6M, False: 3.14M]
  |  Branch (2824:22): [True: 1.80M, False: 1.33M]
  ------------------
 2825|  23.4M|    if (y >= height) {
  ------------------
  |  Branch (2825:9): [True: 237, False: 23.4M]
  ------------------
 2826|    237|      return EOF;
 2827|    237|    }
 2828|  23.4M|    return frameBuf[comp][y * bufWidth + x];
 2829|  23.4M|  } else {
 2830|  1.33M|    if (rowBufPtr == rowBufEnd) {
  ------------------
  |  Branch (2830:9): [True: 3.21k, False: 1.33M]
  ------------------
 2831|  3.21k|      if (y + mcuHeight >= height) {
  ------------------
  |  Branch (2831:11): [True: 184, False: 3.03k]
  ------------------
 2832|    184|	return EOF;
 2833|    184|      }
 2834|  3.03k|      if (!readMCURow()) {
  ------------------
  |  Branch (2834:11): [True: 384, False: 2.64k]
  ------------------
 2835|    384|	y = height;
 2836|    384|	return EOF;
 2837|    384|      }
 2838|  3.03k|    }
 2839|  1.33M|    return *rowBufPtr;
 2840|  1.33M|  }
 2841|  24.8M|}
_ZN9DCTStream8getBlockEPci:
 2843|  3.74k|int DCTStream::getBlock(char *blk, int size) {
 2844|  3.74k|  int nRead, nAvail, n;
 2845|       |
 2846|  3.74k|  if (!prepared) {
  ------------------
  |  Branch (2846:7): [True: 221, False: 3.52k]
  ------------------
 2847|    221|    prepare();
 2848|    221|  }
 2849|  3.74k|  if (y >= height) {
  ------------------
  |  Branch (2849:7): [True: 481, False: 3.26k]
  ------------------
 2850|    481|    return 0;
 2851|    481|  }
 2852|  3.26k|  if (progressive || !interleaved) {
  ------------------
  |  Branch (2852:7): [True: 487, False: 2.78k]
  |  Branch (2852:22): [True: 830, False: 1.95k]
  ------------------
 2853|  4.58M|    for (nRead = 0; nRead < size; ++nRead) {
  ------------------
  |  Branch (2853:21): [True: 4.58M, False: 1.03k]
  ------------------
 2854|  4.58M|      blk[nRead] = (char)frameBuf[comp][y * bufWidth + x];
 2855|  4.58M|      if (++comp == numComps) {
  ------------------
  |  Branch (2855:11): [True: 1.25M, False: 3.32M]
  ------------------
 2856|  1.25M|	comp = 0;
 2857|  1.25M|	if (++x == width) {
  ------------------
  |  Branch (2857:6): [True: 142k, False: 1.11M]
  ------------------
 2858|   142k|	  x = 0;
 2859|   142k|	  ++y;
 2860|   142k|	  if (y >= height) {
  ------------------
  |  Branch (2860:8): [True: 281, False: 141k]
  ------------------
 2861|    281|	    ++nRead;
 2862|    281|	    break;
 2863|    281|	  }
 2864|   142k|	}
 2865|  1.25M|      }
 2866|  4.58M|    }
 2867|  1.95k|  } else {
 2868|  1.95k|    nRead = 0;
 2869|  5.92k|    while (nRead < size) {
  ------------------
  |  Branch (2869:12): [True: 4.60k, False: 1.32k]
  ------------------
 2870|  4.60k|      if (rowBufPtr == rowBufEnd) {
  ------------------
  |  Branch (2870:11): [True: 2.65k, False: 1.95k]
  ------------------
 2871|  2.65k|	if (y + mcuHeight >= height) {
  ------------------
  |  Branch (2871:6): [True: 91, False: 2.56k]
  ------------------
 2872|     91|	  break;
 2873|     91|	}
 2874|  2.56k|	y += mcuHeight;
 2875|  2.56k|	if (!readMCURow()) {
  ------------------
  |  Branch (2875:6): [True: 535, False: 2.02k]
  ------------------
 2876|    535|	  y = height;
 2877|    535|	  break;
 2878|    535|	}
 2879|  2.56k|      }
 2880|  3.97k|      nAvail = (int)(rowBufEnd - rowBufPtr);
 2881|  3.97k|      n = (nAvail < size - nRead) ? nAvail : size - nRead;
  ------------------
  |  Branch (2881:11): [True: 2.65k, False: 1.32k]
  ------------------
 2882|  3.97k|      memcpy(blk + nRead, rowBufPtr, n);
 2883|  3.97k|      rowBufPtr += n;
 2884|  3.97k|      nRead += n;
 2885|  3.97k|    }
 2886|  1.95k|  }
 2887|  3.26k|  return nRead;
 2888|  3.74k|}
_ZN9DCTStream7prepareEv:
 2890|  10.9k|void DCTStream::prepare() {
 2891|  10.9k|  int i;
 2892|       |
 2893|  10.9k|  if (progressive || !interleaved) {
  ------------------
  |  Branch (2893:7): [True: 5.48k, False: 5.46k]
  |  Branch (2893:22): [True: 2.51k, False: 2.94k]
  ------------------
 2894|       |
 2895|       |    // allocate a buffer for the whole image
 2896|  7.99k|    bufWidth = ((width + mcuWidth - 1) / mcuWidth) * mcuWidth;
 2897|  7.99k|    bufHeight = ((height + mcuHeight - 1) / mcuHeight) * mcuHeight;
 2898|  7.99k|    if (bufWidth <= 0 || bufHeight <= 0 ||
  ------------------
  |  Branch (2898:9): [True: 149, False: 7.84k]
  |  Branch (2898:26): [True: 0, False: 7.84k]
  ------------------
 2899|  7.84k|	bufWidth > INT_MAX / bufHeight / (int)sizeof(int)) {
  ------------------
  |  Branch (2899:2): [True: 142, False: 7.70k]
  ------------------
 2900|    291|      error(errSyntaxError, getPos(), "Invalid image size in DCT stream");
 2901|    291|      y = height;
 2902|    291|      prepared = gTrue;
  ------------------
  |  |   17|    291|#define gTrue 1
  ------------------
 2903|    291|      return;
 2904|    291|    }
 2905|  7.70k|#if USE_EXCEPTIONS
 2906|  7.70k|    try {
 2907|  7.70k|#endif
 2908|  31.3k|      for (i = 0; i < numComps; ++i) {
  ------------------
  |  Branch (2908:19): [True: 23.6k, False: 7.70k]
  ------------------
 2909|  23.6k|	frameBuf[i] = (int *)gmallocn(bufWidth * bufHeight, sizeof(int));
 2910|  23.6k|	memset(frameBuf[i], 0, bufWidth * bufHeight * sizeof(int));
 2911|  23.6k|      }
 2912|  7.70k|#if USE_EXCEPTIONS
 2913|  7.70k|    } catch (GMemException) {
 2914|      0|      error(errSyntaxError, getPos(), "Out of memory in DCT stream");
 2915|      0|      y = height;
 2916|      0|      prepared = gTrue;
  ------------------
  |  |   17|      0|#define gTrue 1
  ------------------
 2917|      0|      return;
 2918|      0|    }
 2919|      0|#endif
 2920|       |
 2921|       |    // read the image data
 2922|  15.1k|    do {
 2923|  15.1k|      restartMarker = 0xd0;
 2924|  15.1k|      restart();
 2925|  15.1k|      readScan();
 2926|  15.1k|    } while (readHeader(gFalse));
  ------------------
  |  |   18|  15.1k|#define gFalse 0
  ------------------
  |  Branch (2926:14): [True: 7.48k, False: 7.70k]
  ------------------
 2927|       |
 2928|       |    // decode
 2929|  7.70k|    decodeImage();
 2930|       |
 2931|       |    // initialize counters
 2932|  7.70k|    comp = 0;
 2933|  7.70k|    x = 0;
 2934|  7.70k|    y = 0;
 2935|       |
 2936|  7.70k|  } else {
 2937|       |
 2938|  2.94k|    if (scanInfo.numComps != numComps) {
  ------------------
  |  Branch (2938:9): [True: 0, False: 2.94k]
  ------------------
 2939|      0|      error(errSyntaxError, getPos(), "Invalid scan in sequential DCT stream");
 2940|      0|      y = height;
 2941|      0|      prepared = gTrue;
  ------------------
  |  |   17|      0|#define gTrue 1
  ------------------
 2942|      0|      return;
 2943|      0|    }
 2944|       |
 2945|       |    // allocate a buffer for one row of MCUs
 2946|  2.94k|    bufWidth = ((width + mcuWidth - 1) / mcuWidth) * mcuWidth;
 2947|  2.94k|    if (bufWidth <= 0 || bufWidth > INT_MAX / numComps / mcuHeight) {
  ------------------
  |  Branch (2947:9): [True: 134, False: 2.81k]
  |  Branch (2947:26): [True: 0, False: 2.81k]
  ------------------
 2948|    134|      error(errSyntaxError, getPos(), "Invalid image size in DCT stream");
 2949|    134|      y = height;
 2950|    134|      rowBuf = rowBufPtr = rowBufEnd = NULL;
 2951|    134|      prepared = gTrue;
  ------------------
  |  |   17|    134|#define gTrue 1
  ------------------
 2952|    134|      return;
 2953|    134|    }
 2954|  2.81k|    rowBuf = (Guchar *)gmallocn(bufWidth, numComps * mcuHeight);
 2955|  2.81k|    rowBufPtr = rowBufEnd = rowBuf;
 2956|       |
 2957|       |    // initialize counters
 2958|  2.81k|    y = -mcuHeight;
 2959|       |
 2960|  2.81k|    restartMarker = 0xd0;
 2961|  2.81k|    restart();
 2962|  2.81k|  }
 2963|       |
 2964|  10.5k|  prepared = gTrue;
  ------------------
  |  |   17|  10.5k|#define gTrue 1
  ------------------
 2965|  10.5k|}
_ZN9DCTStream7restartEv:
 2967|  20.8k|void DCTStream::restart() {
 2968|  20.8k|  int i;
 2969|       |
 2970|  20.8k|  inputBits = 0;
 2971|  20.8k|  restartCtr = restartInterval;
 2972|  79.6k|  for (i = 0; i < numComps; ++i) {
  ------------------
  |  Branch (2972:15): [True: 58.8k, False: 20.8k]
  ------------------
 2973|  58.8k|    compInfo[i].prevDC = 0;
 2974|  58.8k|  }
 2975|  20.8k|  eobRun = 0;
 2976|  20.8k|}
_ZN9DCTStream10readMCURowEv:
 2979|  9.68k|GBool DCTStream::readMCURow() {
 2980|  9.68k|  int data1[64];
 2981|  9.68k|  Guchar data2[64];
 2982|  9.68k|  Guchar *p1, *p2;
 2983|  9.68k|  int pY, pCb, pCr, pR, pG, pB;
 2984|  9.68k|  int h, v, horiz, vert, hSub, vSub;
 2985|  9.68k|  int x1, x2, y2, x3, y3, x4, y4, x5, y5, cc, i;
 2986|  9.68k|  int c;
 2987|       |
 2988|  32.1k|  for (cc = 0; cc < numComps; ++cc) {
  ------------------
  |  Branch (2988:16): [True: 22.8k, False: 9.29k]
  ------------------
 2989|  22.8k|    if (scanInfo.dcHuffTable[cc] >= numDCHuffTables ||
  ------------------
  |  Branch (2989:9): [True: 255, False: 22.5k]
  ------------------
 2990|  22.5k|	scanInfo.acHuffTable[cc] >= numACHuffTables) {
  ------------------
  |  Branch (2990:2): [True: 128, False: 22.4k]
  ------------------
 2991|    383|      error(errSyntaxError, getPos(),
 2992|    383|	    "Bad DCT data: invalid Huffman table index");
 2993|    383|      return gFalse;
  ------------------
  |  |   18|    383|#define gFalse 0
  ------------------
 2994|    383|    }
 2995|  22.4k|    if (compInfo[cc].quantTable > numQuantTables) {
  ------------------
  |  Branch (2995:9): [True: 0, False: 22.4k]
  ------------------
 2996|      0|      error(errSyntaxError, getPos(),
 2997|      0|	    "Bad DCT data: invalid quant table index");
 2998|      0|      return gFalse;
  ------------------
  |  |   18|      0|#define gFalse 0
  ------------------
 2999|      0|    }
 3000|  22.4k|  }
 3001|       |
 3002|  49.8k|  for (x1 = 0; x1 < width; x1 += mcuWidth) {
  ------------------
  |  Branch (3002:16): [True: 42.3k, False: 7.50k]
  ------------------
 3003|       |
 3004|       |    // deal with restart marker
 3005|  42.3k|    if (restartInterval > 0 && restartCtr == 0) {
  ------------------
  |  Branch (3005:9): [True: 16.3k, False: 25.9k]
  |  Branch (3005:32): [True: 1.99k, False: 14.3k]
  ------------------
 3006|  1.99k|      c = readMarker();
 3007|  1.99k|      if (c != restartMarker) {
  ------------------
  |  Branch (3007:11): [True: 452, False: 1.54k]
  ------------------
 3008|    452|	error(errSyntaxError, getPos(),
 3009|    452|	      "Bad DCT data: incorrect restart marker");
 3010|    452|	return gFalse;
  ------------------
  |  |   18|    452|#define gFalse 0
  ------------------
 3011|    452|      }
 3012|  1.54k|      if (++restartMarker == 0xd8)
  ------------------
  |  Branch (3012:11): [True: 88, False: 1.45k]
  ------------------
 3013|     88|	restartMarker = 0xd0;
 3014|  1.54k|      restart();
 3015|  1.54k|    }
 3016|       |
 3017|       |    // read one MCU
 3018|   133k|    for (cc = 0; cc < numComps; ++cc) {
  ------------------
  |  Branch (3018:18): [True: 92.5k, False: 40.5k]
  ------------------
 3019|  92.5k|      h = compInfo[cc].hSample;
 3020|  92.5k|      v = compInfo[cc].vSample;
 3021|  92.5k|      horiz = mcuWidth / h;
 3022|  92.5k|      vert = mcuHeight / v;
 3023|  92.5k|      hSub = horiz / 8;
 3024|  92.5k|      vSub = vert / 8;
 3025|   194k|      for (y2 = 0; y2 < mcuHeight; y2 += vert) {
  ------------------
  |  Branch (3025:20): [True: 103k, False: 91.1k]
  ------------------
 3026|   235k|	for (x2 = 0; x2 < mcuWidth; x2 += horiz) {
  ------------------
  |  Branch (3026:15): [True: 133k, False: 102k]
  ------------------
 3027|   133k|	  if (!readDataUnit(&dcHuffTables[scanInfo.dcHuffTable[cc]],
  ------------------
  |  Branch (3027:8): [True: 1.34k, False: 131k]
  ------------------
 3028|   133k|			    &acHuffTables[scanInfo.acHuffTable[cc]],
 3029|   133k|			    &compInfo[cc].prevDC,
 3030|   133k|			    data1)) {
 3031|  1.34k|	    return gFalse;
  ------------------
  |  |   18|  1.34k|#define gFalse 0
  ------------------
 3032|  1.34k|	  }
 3033|   131k|	  transformDataUnit(quantTables[compInfo[cc].quantTable],
 3034|   131k|			    data1, data2);
 3035|   131k|	  if (hSub == 1 && vSub == 1 && x1+x2+8 <= width) {
  ------------------
  |  Branch (3035:8): [True: 72.8k, False: 59.1k]
  |  Branch (3035:21): [True: 56.9k, False: 15.8k]
  |  Branch (3035:34): [True: 53.1k, False: 3.84k]
  ------------------
 3036|   478k|	    for (y3 = 0, i = 0; y3 < 8; ++y3, i += 8) {
  ------------------
  |  Branch (3036:26): [True: 425k, False: 53.1k]
  ------------------
 3037|   425k|	      p1 = &rowBuf[((y2+y3) * width + (x1+x2)) * numComps + cc];
 3038|   425k|	      p1[0]          = data2[i];
 3039|   425k|	      p1[  numComps] = data2[i+1];
 3040|   425k|	      p1[2*numComps] = data2[i+2];
 3041|   425k|	      p1[3*numComps] = data2[i+3];
 3042|   425k|	      p1[4*numComps] = data2[i+4];
 3043|   425k|	      p1[5*numComps] = data2[i+5];
 3044|   425k|	      p1[6*numComps] = data2[i+6];
 3045|   425k|	      p1[7*numComps] = data2[i+7];
 3046|   425k|	    }
 3047|  78.8k|	  } else if (hSub == 2 && vSub == 2 && x1+x2+16 <= width) {
  ------------------
  |  Branch (3047:15): [True: 58.9k, False: 19.9k]
  |  Branch (3047:28): [True: 9.00k, False: 49.9k]
  |  Branch (3047:41): [True: 7.46k, False: 1.54k]
  ------------------
 3048|  67.1k|	    for (y3 = 0, i = 0; y3 < 16; y3 += 2, i += 8) {
  ------------------
  |  Branch (3048:26): [True: 59.7k, False: 7.46k]
  ------------------
 3049|  59.7k|	      p1 = &rowBuf[((y2+y3) * width + (x1+x2)) * numComps + cc];
 3050|  59.7k|	      p2 = p1 + width * numComps;
 3051|  59.7k|	      p1[0] = p1[numComps] =
 3052|  59.7k|		p2[0] = p2[numComps] = data2[i];
 3053|  59.7k|	      p1[2*numComps] = p1[3*numComps] =
 3054|  59.7k|		p2[2*numComps] = p2[3*numComps] = data2[i+1];
 3055|  59.7k|	      p1[4*numComps] = p1[5*numComps] =
 3056|  59.7k|		p2[4*numComps] = p2[5*numComps] = data2[i+2];
 3057|  59.7k|	      p1[6*numComps] = p1[7*numComps] =
 3058|  59.7k|		p2[6*numComps] = p2[7*numComps] = data2[i+3];
 3059|  59.7k|	      p1[8*numComps] = p1[9*numComps] =
 3060|  59.7k|		p2[8*numComps] = p2[9*numComps] = data2[i+4];
 3061|  59.7k|	      p1[10*numComps] = p1[11*numComps] =
 3062|  59.7k|		p2[10*numComps] = p2[11*numComps] = data2[i+5];
 3063|  59.7k|	      p1[12*numComps] = p1[13*numComps] =
 3064|  59.7k|		p2[12*numComps] = p2[13*numComps] = data2[i+6];
 3065|  59.7k|	      p1[14*numComps] = p1[15*numComps] =
 3066|  59.7k|		p2[14*numComps] = p2[15*numComps] = data2[i+7];
 3067|  59.7k|	    }
 3068|  71.3k|	  } else {
 3069|  71.3k|	    p1 = &rowBuf[(y2 * width + (x1+x2)) * numComps + cc];
 3070|  71.3k|	    i = 0;
 3071|   642k|	    for (y3 = 0, y4 = 0; y3 < 8; ++y3, y4 += vSub) {
  ------------------
  |  Branch (3071:27): [True: 571k, False: 71.3k]
  ------------------
 3072|  5.14M|	      for (x3 = 0, x4 = 0; x3 < 8; ++x3, x4 += hSub) {
  ------------------
  |  Branch (3072:29): [True: 4.56M, False: 571k]
  ------------------
 3073|  10.5M|		for (y5 = 0; y5 < vSub; ++y5) {
  ------------------
  |  Branch (3073:16): [True: 5.93M, False: 4.56M]
  ------------------
 3074|  15.3M|		  for (x5 = 0; x5 < hSub && x1+x2+x4+x5 < width; ++x5) {
  ------------------
  |  Branch (3074:18): [True: 9.64M, False: 5.68M]
  |  Branch (3074:31): [True: 9.38M, False: 257k]
  ------------------
 3075|  9.38M|		    p1[((y4+y5) * width + (x4+x5)) * numComps] = data2[i];
 3076|  9.38M|		  }
 3077|  5.93M|		}
 3078|  4.56M|		++i;
 3079|  4.56M|	      }
 3080|   571k|	    }
 3081|  71.3k|	  }
 3082|   131k|	}
 3083|   103k|      }
 3084|  92.5k|    }
 3085|  40.5k|    --restartCtr;
 3086|  40.5k|  }
 3087|       |
 3088|       |  // color space conversion
 3089|  7.50k|  if (colorXform) {
  ------------------
  |  Branch (3089:7): [True: 6.39k, False: 1.11k]
  ------------------
 3090|       |    // convert YCbCr to RGB
 3091|  6.39k|    if (numComps == 3) {
  ------------------
  |  Branch (3091:9): [True: 4.72k, False: 1.67k]
  ------------------
 3092|  3.78M|      for (i = 0, p1 = rowBuf; i < width * mcuHeight; ++i, p1 += 3) {
  ------------------
  |  Branch (3092:32): [True: 3.78M, False: 4.72k]
  ------------------
 3093|  3.78M|	pY = p1[0];
 3094|  3.78M|	pCb = p1[1] - 128;
 3095|  3.78M|	pCr = p1[2] - 128;
 3096|  3.78M|	pR = ((pY << 16) + dctCrToR * pCr + 32768) >> 16;
  ------------------
  |  | 2595|  3.78M|#define dctCrToR   91881	//  1.4020
  ------------------
 3097|  3.78M|	p1[0] = dctClip(pR);
 3098|  3.78M|	pG = ((pY << 16) + dctCbToG * pCb + dctCrToG * pCr + 32768) >> 16;
  ------------------
  |  | 2596|  3.78M|#define dctCbToG  -22553	// -0.3441363
  ------------------
              	pG = ((pY << 16) + dctCbToG * pCb + dctCrToG * pCr + 32768) >> 16;
  ------------------
  |  | 2597|  3.78M|#define dctCrToG  -46802	// -0.71413636
  ------------------
 3099|  3.78M|	p1[1] = dctClip(pG);
 3100|  3.78M|	pB = ((pY << 16) + dctCbToB * pCb + 32768) >> 16;
  ------------------
  |  | 2598|  3.78M|#define dctCbToB  116130	//  1.772
  ------------------
 3101|  3.78M|	p1[2] = dctClip(pB);
 3102|  3.78M|      }
 3103|       |    // convert YCbCrK to CMYK (K is passed through unchanged)
 3104|  4.72k|    } else if (numComps == 4) {
  ------------------
  |  Branch (3104:16): [True: 0, False: 1.67k]
  ------------------
 3105|      0|      for (i = 0, p1 = rowBuf; i < width * mcuHeight; ++i, p1 += 4) {
  ------------------
  |  Branch (3105:32): [True: 0, False: 0]
  ------------------
 3106|      0|	pY = p1[0];
 3107|      0|	pCb = p1[1] - 128;
 3108|      0|	pCr = p1[2] - 128;
 3109|      0|	pR = ((pY << 16) + dctCrToR * pCr + 32768) >> 16;
  ------------------
  |  | 2595|      0|#define dctCrToR   91881	//  1.4020
  ------------------
 3110|      0|	p1[0] = (Guchar)(255 - dctClip(pR));
 3111|      0|	pG = ((pY << 16) + dctCbToG * pCb + dctCrToG * pCr + 32768) >> 16;
  ------------------
  |  | 2596|      0|#define dctCbToG  -22553	// -0.3441363
  ------------------
              	pG = ((pY << 16) + dctCbToG * pCb + dctCrToG * pCr + 32768) >> 16;
  ------------------
  |  | 2597|      0|#define dctCrToG  -46802	// -0.71413636
  ------------------
 3112|      0|	p1[1] = (Guchar)(255 - dctClip(pG));
 3113|      0|	pB = ((pY << 16) + dctCbToB * pCb + 32768) >> 16;
  ------------------
  |  | 2598|      0|#define dctCbToB  116130	//  1.772
  ------------------
 3114|      0|	p1[2] = (Guchar)(255 - dctClip(pB));
 3115|      0|      }
 3116|      0|    }
 3117|  6.39k|  }
 3118|       |
 3119|  7.50k|  rowBufPtr = rowBuf;
 3120|  7.50k|  if (y + mcuHeight <= height) {
  ------------------
  |  Branch (3120:7): [True: 7.23k, False: 275]
  ------------------
 3121|  7.23k|    rowBufEnd = rowBuf + numComps * width * mcuHeight;
 3122|  7.23k|  } else {
 3123|    275|    rowBufEnd = rowBuf + numComps * width * (height - y);
 3124|    275|  }
 3125|       |
 3126|  7.50k|  return gTrue;
  ------------------
  |  |   17|  7.50k|#define gTrue 1
  ------------------
 3127|  9.29k|}
_ZN9DCTStream8readScanEv:
 3130|  15.1k|void DCTStream::readScan() {
 3131|  15.1k|  int data[64];
 3132|  15.1k|  int x1, y1, dx1, dy1, x2, y2, y3, cc, i;
 3133|  15.1k|  int h, v, horiz, vert, vSub;
 3134|  15.1k|  int *p1;
 3135|  15.1k|  int c;
 3136|       |
 3137|  61.2k|  for (cc = 0; cc < numComps; ++cc) {
  ------------------
  |  Branch (3137:16): [True: 46.7k, False: 14.5k]
  ------------------
 3138|  46.7k|    if (scanInfo.comp[cc] &&
  ------------------
  |  Branch (3138:9): [True: 42.8k, False: 3.87k]
  ------------------
 3139|  42.8k|	(scanInfo.dcHuffTable[cc] >= numDCHuffTables ||
  ------------------
  |  Branch (3139:3): [True: 240, False: 42.5k]
  ------------------
 3140|  42.5k|	 ((!progressive || scanInfo.lastCoeff > 0) &&
  ------------------
  |  Branch (3140:5): [True: 10.5k, False: 32.0k]
  |  Branch (3140:21): [True: 31.5k, False: 474]
  ------------------
 3141|  42.1k|	  scanInfo.acHuffTable[cc] >= numACHuffTables))) {
  ------------------
  |  Branch (3141:4): [True: 383, False: 41.7k]
  ------------------
 3142|    623|      error(errSyntaxError, getPos(),
 3143|    623|	    "Bad DCT data: invalid Huffman table index");
 3144|    623|      return;
 3145|    623|    }
 3146|  46.0k|    if (compInfo[cc].quantTable > numQuantTables) {
  ------------------
  |  Branch (3146:9): [True: 0, False: 46.0k]
  ------------------
 3147|      0|      error(errSyntaxError, getPos(),
 3148|      0|	    "Bad DCT data: invalid quant table index");
 3149|      0|      return;
 3150|      0|    }
 3151|  46.0k|  }
 3152|       |
 3153|  14.5k|  if (scanInfo.numComps == 1) {
  ------------------
  |  Branch (3153:7): [True: 855, False: 13.7k]
  ------------------
 3154|  1.17k|    for (cc = 0; cc < numComps; ++cc) {
  ------------------
  |  Branch (3154:18): [True: 1.17k, False: 0]
  ------------------
 3155|  1.17k|      if (scanInfo.comp[cc]) {
  ------------------
  |  Branch (3155:11): [True: 855, False: 319]
  ------------------
 3156|    855|	break;
 3157|    855|      }
 3158|  1.17k|    }
 3159|    855|    dx1 = mcuWidth / compInfo[cc].hSample;
 3160|    855|    dy1 = mcuHeight / compInfo[cc].vSample;
 3161|  13.7k|  } else {
 3162|  13.7k|    dx1 = mcuWidth;
 3163|  13.7k|    dy1 = mcuHeight;
 3164|  13.7k|  }
 3165|       |
 3166|   107k|  for (y1 = 0; y1 < height; y1 += dy1) {
  ------------------
  |  Branch (3166:16): [True: 106k, False: 687]
  ------------------
 3167|   477k|    for (x1 = 0; x1 < width; x1 += dx1) {
  ------------------
  |  Branch (3167:18): [True: 384k, False: 92.7k]
  ------------------
 3168|       |
 3169|       |      // deal with restart marker
 3170|   384k|      if (restartInterval > 0 && restartCtr == 0) {
  ------------------
  |  Branch (3170:11): [True: 18.2k, False: 366k]
  |  Branch (3170:34): [True: 1.70k, False: 16.5k]
  ------------------
 3171|  1.70k|	c = readMarker();
 3172|  1.70k|	if (c != restartMarker) {
  ------------------
  |  Branch (3172:6): [True: 452, False: 1.24k]
  ------------------
 3173|    452|	  error(errSyntaxError, getPos(),
 3174|    452|		"Bad DCT data: incorrect restart marker");
 3175|    452|	  return;
 3176|    452|	}
 3177|  1.24k|	if (++restartMarker == 0xd8) {
  ------------------
  |  Branch (3177:6): [True: 146, False: 1.10k]
  ------------------
 3178|    146|	  restartMarker = 0xd0;
 3179|    146|	}
 3180|  1.24k|	restart();
 3181|  1.24k|      }
 3182|       |
 3183|       |      // read one MCU
 3184|  1.49M|      for (cc = 0; cc < numComps; ++cc) {
  ------------------
  |  Branch (3184:20): [True: 1.12M, False: 370k]
  ------------------
 3185|  1.12M|	if (!scanInfo.comp[cc]) {
  ------------------
  |  Branch (3185:6): [True: 32.4k, False: 1.09M]
  ------------------
 3186|  32.4k|	  continue;
 3187|  32.4k|	}
 3188|       |
 3189|  1.09M|	h = compInfo[cc].hSample;
 3190|  1.09M|	v = compInfo[cc].vSample;
 3191|  1.09M|	horiz = mcuWidth / h;
 3192|  1.09M|	vert = mcuHeight / v;
 3193|  1.09M|	vSub = vert / 8;
 3194|  2.19M|	for (y2 = 0; y2 < dy1; y2 += vert) {
  ------------------
  |  Branch (3194:15): [True: 1.11M, False: 1.08M]
  ------------------
 3195|  2.53M|	  for (x2 = 0; x2 < dx1; x2 += horiz) {
  ------------------
  |  Branch (3195:17): [True: 1.44M, False: 1.09M]
  ------------------
 3196|       |
 3197|       |	    // pull out the current values
 3198|  1.44M|	    p1 = &frameBuf[cc][(y1+y2) * bufWidth + (x1+x2)];
 3199|  12.9M|	    for (y3 = 0, i = 0; y3 < 8; ++y3, i += 8) {
  ------------------
  |  Branch (3199:26): [True: 11.5M, False: 1.44M]
  ------------------
 3200|  11.5M|	      data[i] = p1[0];
 3201|  11.5M|	      data[i+1] = p1[1];
 3202|  11.5M|	      data[i+2] = p1[2];
 3203|  11.5M|	      data[i+3] = p1[3];
 3204|  11.5M|	      data[i+4] = p1[4];
 3205|  11.5M|	      data[i+5] = p1[5];
 3206|  11.5M|	      data[i+6] = p1[6];
 3207|  11.5M|	      data[i+7] = p1[7];
 3208|  11.5M|	      p1 += bufWidth * vSub;
 3209|  11.5M|	    }
 3210|       |
 3211|       |	    // read one data unit
 3212|  1.44M|	    if (progressive) {
  ------------------
  |  Branch (3212:10): [True: 1.34M, False: 91.9k]
  ------------------
 3213|  1.34M|	      if (!readProgressiveDataUnit(
  ------------------
  |  Branch (3213:12): [True: 9.89k, False: 1.33M]
  ------------------
 3214|  1.34M|		       &dcHuffTables[scanInfo.dcHuffTable[cc]],
 3215|  1.34M|		       &acHuffTables[scanInfo.acHuffTable[cc]],
 3216|  1.34M|		       &compInfo[cc].prevDC,
 3217|  1.34M|		       data)) {
 3218|  9.89k|		return;
 3219|  9.89k|	      }
 3220|  1.34M|	    } else {
 3221|  91.9k|	      if (!readDataUnit(&dcHuffTables[scanInfo.dcHuffTable[cc]],
  ------------------
  |  Branch (3221:12): [True: 3.53k, False: 88.4k]
  ------------------
 3222|  91.9k|				&acHuffTables[scanInfo.acHuffTable[cc]],
 3223|  91.9k|				&compInfo[cc].prevDC,
 3224|  91.9k|				data)) {
 3225|  3.53k|		return;
 3226|  3.53k|	      }
 3227|  91.9k|	    }
 3228|       |
 3229|       |	    // add the data unit into frameBuf
 3230|  1.42M|	    p1 = &frameBuf[cc][(y1+y2) * bufWidth + (x1+x2)];
 3231|  12.8M|	    for (y3 = 0, i = 0; y3 < 8; ++y3, i += 8) {
  ------------------
  |  Branch (3231:26): [True: 11.4M, False: 1.42M]
  ------------------
 3232|  11.4M|	      p1[0] = data[i];
 3233|  11.4M|	      p1[1] = data[i+1];
 3234|  11.4M|	      p1[2] = data[i+2];
 3235|  11.4M|	      p1[3] = data[i+3];
 3236|  11.4M|	      p1[4] = data[i+4];
 3237|  11.4M|	      p1[5] = data[i+5];
 3238|  11.4M|	      p1[6] = data[i+6];
 3239|  11.4M|	      p1[7] = data[i+7];
 3240|  11.4M|	      p1 += bufWidth * vSub;
 3241|  11.4M|	    }
 3242|  1.42M|	  }
 3243|  1.11M|	}
 3244|  1.09M|      }
 3245|   370k|      --restartCtr;
 3246|   370k|    }
 3247|   106k|  }
 3248|  14.5k|}
_ZN9DCTStream12readDataUnitEP12DCTHuffTableS1_PiS2_:
 3253|   225k|			      int *prevDC, int data[64]) {
 3254|   225k|  int run, size, amp;
 3255|   225k|  int c;
 3256|   225k|  int i, j;
 3257|       |
 3258|   225k|  if ((size = readHuffSym(dcHuffTable)) == 9999) {
  ------------------
  |  Branch (3258:7): [True: 356, False: 224k]
  ------------------
 3259|    356|    return gFalse;
  ------------------
  |  |   18|    356|#define gFalse 0
  ------------------
 3260|    356|  }
 3261|   224k|  if (size > 0) {
  ------------------
  |  Branch (3261:7): [True: 188k, False: 36.7k]
  ------------------
 3262|   188k|    if ((amp = readAmp(size)) == 9999) {
  ------------------
  |  Branch (3262:9): [True: 1.74k, False: 186k]
  ------------------
 3263|  1.74k|      return gFalse;
  ------------------
  |  |   18|  1.74k|#define gFalse 0
  ------------------
 3264|  1.74k|    }
 3265|   188k|  } else {
 3266|  36.7k|    amp = 0;
 3267|  36.7k|  }
 3268|   223k|  data[0] = *prevDC += amp;
 3269|  14.2M|  for (i = 1; i < 64; ++i) {
  ------------------
  |  Branch (3269:15): [True: 14.0M, False: 223k]
  ------------------
 3270|  14.0M|    data[i] = 0;
 3271|  14.0M|  }
 3272|   223k|  i = 1;
 3273|  2.24M|  while (i < 64) {
  ------------------
  |  Branch (3273:10): [True: 2.14M, False: 94.7k]
  ------------------
 3274|  2.14M|    run = 0;
 3275|  2.15M|    while ((c = readHuffSym(acHuffTable)) == 0xf0 && run < 0x30) {
  ------------------
  |  Branch (3275:12): [True: 4.55k, False: 2.14M]
  |  Branch (3275:54): [True: 3.91k, False: 640]
  ------------------
 3276|  3.91k|      run += 0x10;
 3277|  3.91k|    }
 3278|  2.14M|    if (c == 9999) {
  ------------------
  |  Branch (3278:9): [True: 751, False: 2.14M]
  ------------------
 3279|    751|      return gFalse;
  ------------------
  |  |   18|    751|#define gFalse 0
  ------------------
 3280|    751|    }
 3281|  2.14M|    if (c == 0x00) {
  ------------------
  |  Branch (3281:9): [True: 125k, False: 2.02M]
  ------------------
 3282|   125k|      break;
 3283|  2.02M|    } else {
 3284|  2.02M|      run += (c >> 4) & 0x0f;
 3285|  2.02M|      size = c & 0x0f;
 3286|  2.02M|      amp = readAmp(size);
 3287|  2.02M|      if (amp == 9999) {
  ------------------
  |  Branch (3287:11): [True: 2.02k, False: 2.01M]
  ------------------
 3288|  2.02k|	return gFalse;
  ------------------
  |  |   18|  2.02k|#define gFalse 0
  ------------------
 3289|  2.02k|      }
 3290|  2.01M|      i += run;
 3291|  2.01M|      if (i < 64) {
  ------------------
  |  Branch (3291:11): [True: 1.95M, False: 67.7k]
  ------------------
 3292|  1.95M|	j = dctZigZag[i++];
 3293|  1.95M|	data[j] = amp;
 3294|  1.95M|      }
 3295|  2.01M|    }
 3296|  2.14M|  }
 3297|   220k|  return gTrue;
  ------------------
  |  |   17|   220k|#define gTrue 1
  ------------------
 3298|   223k|}
_ZN9DCTStream23readProgressiveDataUnitEP12DCTHuffTableS1_PiS2_:
 3303|  1.34M|					 int *prevDC, int data[64]) {
 3304|  1.34M|  int run, size, amp, bit, c;
 3305|  1.34M|  int i, j, k;
 3306|       |
 3307|       |  // get the DC coefficient
 3308|  1.34M|  i = scanInfo.firstCoeff;
 3309|  1.34M|  if (i == 0) {
  ------------------
  |  Branch (3309:7): [True: 544k, False: 804k]
  ------------------
 3310|   544k|    if (scanInfo.ah == 0) {
  ------------------
  |  Branch (3310:9): [True: 58.1k, False: 486k]
  ------------------
 3311|  58.1k|      if ((size = readHuffSym(dcHuffTable)) == 9999) {
  ------------------
  |  Branch (3311:11): [True: 204, False: 57.9k]
  ------------------
 3312|    204|	return gFalse;
  ------------------
  |  |   18|    204|#define gFalse 0
  ------------------
 3313|    204|      }
 3314|  57.9k|      if (size > 0) {
  ------------------
  |  Branch (3314:11): [True: 31.5k, False: 26.3k]
  ------------------
 3315|  31.5k|	if ((amp = readAmp(size)) == 9999) {
  ------------------
  |  Branch (3315:6): [True: 424, False: 31.1k]
  ------------------
 3316|    424|	  return gFalse;
  ------------------
  |  |   18|    424|#define gFalse 0
  ------------------
 3317|    424|	}
 3318|  31.5k|      } else {
 3319|  26.3k|	amp = 0;
 3320|  26.3k|      }
 3321|  57.4k|      data[0] += (*prevDC += amp) << scanInfo.al;
 3322|   486k|    } else {
 3323|   486k|      if ((bit = readBit()) == 9999) {
  ------------------
  |  Branch (3323:11): [True: 0, False: 486k]
  ------------------
 3324|      0|	return gFalse;
  ------------------
  |  |   18|      0|#define gFalse 0
  ------------------
 3325|      0|      }
 3326|   486k|      if (bit) {
  ------------------
  |  Branch (3326:11): [True: 231k, False: 254k]
  ------------------
 3327|   231k|	data[0] += 1 << scanInfo.al;
 3328|   231k|      }
 3329|   486k|    }
 3330|   544k|    ++i;
 3331|   544k|  }
 3332|  1.34M|  if (scanInfo.lastCoeff == 0) {
  ------------------
  |  Branch (3332:7): [True: 38.8k, False: 1.30M]
  ------------------
 3333|  38.8k|    return gTrue;
  ------------------
  |  |   17|  38.8k|#define gTrue 1
  ------------------
 3334|  38.8k|  }
 3335|       |
 3336|       |  // check for an EOB run
 3337|  1.30M|  if (eobRun > 0) {
  ------------------
  |  Branch (3337:7): [True: 515k, False: 793k]
  ------------------
 3338|  21.2M|    while (i <= scanInfo.lastCoeff) {
  ------------------
  |  Branch (3338:12): [True: 20.7M, False: 515k]
  ------------------
 3339|  20.7M|      j = dctZigZag[i++];
 3340|  20.7M|      if (data[j] != 0) {
  ------------------
  |  Branch (3340:11): [True: 364k, False: 20.3M]
  ------------------
 3341|   364k|	if ((bit = readBit()) == EOF) {
  ------------------
  |  Branch (3341:6): [True: 463, False: 363k]
  ------------------
 3342|    463|	  return gFalse;
  ------------------
  |  |   18|    463|#define gFalse 0
  ------------------
 3343|    463|	}
 3344|   363k|	if (bit) {
  ------------------
  |  Branch (3344:6): [True: 172k, False: 191k]
  ------------------
 3345|   172k|	  if (data[j] >= 0) {
  ------------------
  |  Branch (3345:8): [True: 73.1k, False: 99.7k]
  ------------------
 3346|  73.1k|	    data[j] += 1 << scanInfo.al;
 3347|  99.7k|	  } else {
 3348|  99.7k|	    data[j] -= 1 << scanInfo.al;
 3349|  99.7k|	  }
 3350|   172k|	}
 3351|   363k|      }
 3352|  20.7M|    }
 3353|   515k|    --eobRun;
 3354|   515k|    return gTrue;
  ------------------
  |  |   17|   515k|#define gTrue 1
  ------------------
 3355|   515k|  }
 3356|       |
 3357|       |  // read the AC coefficients
 3358|  2.57M|  while (i <= scanInfo.lastCoeff) {
  ------------------
  |  Branch (3358:10): [True: 2.14M, False: 430k]
  ------------------
 3359|  2.14M|    if ((c = readHuffSym(acHuffTable)) == 9999) {
  ------------------
  |  Branch (3359:9): [True: 3.82k, False: 2.13M]
  ------------------
 3360|  3.82k|      return gFalse;
  ------------------
  |  |   18|  3.82k|#define gFalse 0
  ------------------
 3361|  3.82k|    }
 3362|       |
 3363|       |    // ZRL
 3364|  2.13M|    if (c == 0xf0) {
  ------------------
  |  Branch (3364:9): [True: 9.37k, False: 2.12M]
  ------------------
 3365|  9.37k|      k = 0;
 3366|  46.7k|      while (k < 16 && i <= scanInfo.lastCoeff) {
  ------------------
  |  Branch (3366:14): [True: 46.7k, False: 0]
  |  Branch (3366:24): [True: 37.7k, False: 8.99k]
  ------------------
 3367|  37.7k|	j = dctZigZag[i++];
 3368|  37.7k|	if (data[j] == 0) {
  ------------------
  |  Branch (3368:6): [True: 32.0k, False: 5.70k]
  ------------------
 3369|  32.0k|	  ++k;
 3370|  32.0k|	} else {
 3371|  5.70k|	  if ((bit = readBit()) == EOF) {
  ------------------
  |  Branch (3371:8): [True: 383, False: 5.32k]
  ------------------
 3372|    383|	    return gFalse;
  ------------------
  |  |   18|    383|#define gFalse 0
  ------------------
 3373|    383|	  }
 3374|  5.32k|	  if (bit) {
  ------------------
  |  Branch (3374:8): [True: 2.38k, False: 2.93k]
  ------------------
 3375|  2.38k|	    if (data[j] >= 0) {
  ------------------
  |  Branch (3375:10): [True: 904, False: 1.48k]
  ------------------
 3376|    904|	      data[j] += 1 << scanInfo.al;
 3377|  1.48k|	    } else {
 3378|  1.48k|	      data[j] -= 1 << scanInfo.al;
 3379|  1.48k|	    }
 3380|  2.38k|	  }
 3381|  5.32k|	}
 3382|  37.7k|      }
 3383|       |
 3384|       |    // EOB run
 3385|  2.12M|    } else if ((c & 0x0f) == 0x00) {
  ------------------
  |  Branch (3385:16): [True: 355k, False: 1.77M]
  ------------------
 3386|   355k|      j = c >> 4;
 3387|   355k|      eobRun = 0;
 3388|   470k|      for (k = 0; k < j; ++k) {
  ------------------
  |  Branch (3388:19): [True: 115k, False: 355k]
  ------------------
 3389|   115k|	if ((bit = readBit()) == EOF) {
  ------------------
  |  Branch (3389:6): [True: 395, False: 115k]
  ------------------
 3390|    395|	  return gFalse;
  ------------------
  |  |   18|    395|#define gFalse 0
  ------------------
 3391|    395|	}
 3392|   115k|	eobRun = (eobRun << 1) | bit;
 3393|   115k|      }
 3394|   355k|      eobRun += 1 << j;
 3395|  8.29M|      while (i <= scanInfo.lastCoeff) {
  ------------------
  |  Branch (3395:14): [True: 7.94M, False: 354k]
  ------------------
 3396|  7.94M|	j = dctZigZag[i++];
 3397|  7.94M|	if (data[j] != 0) {
  ------------------
  |  Branch (3397:6): [True: 227k, False: 7.71M]
  ------------------
 3398|   227k|	  if ((bit = readBit()) == EOF) {
  ------------------
  |  Branch (3398:8): [True: 935, False: 226k]
  ------------------
 3399|    935|	    return gFalse;
  ------------------
  |  |   18|    935|#define gFalse 0
  ------------------
 3400|    935|	  }
 3401|   226k|	  if (bit) {
  ------------------
  |  Branch (3401:8): [True: 110k, False: 115k]
  ------------------
 3402|   110k|	    if (data[j] >= 0) {
  ------------------
  |  Branch (3402:10): [True: 46.8k, False: 63.9k]
  ------------------
 3403|  46.8k|	      data[j] += 1 << scanInfo.al;
 3404|  63.9k|	    } else {
 3405|  63.9k|	      data[j] -= 1 << scanInfo.al;
 3406|  63.9k|	    }
 3407|   110k|	  }
 3408|   226k|	}
 3409|  7.94M|      }
 3410|   354k|      --eobRun;
 3411|   354k|      break;
 3412|       |
 3413|       |    // zero run and one AC coefficient
 3414|  1.77M|    } else {
 3415|  1.77M|      run = (c >> 4) & 0x0f;
 3416|  1.77M|      size = c & 0x0f;
 3417|  1.77M|      if ((amp = readAmp(size)) == 9999) {
  ------------------
  |  Branch (3417:11): [True: 2.75k, False: 1.77M]
  ------------------
 3418|  2.75k|	return gFalse;
  ------------------
  |  |   18|  2.75k|#define gFalse 0
  ------------------
 3419|  2.75k|      }
 3420|  1.77M|      j = 0; // make gcc happy
 3421|  7.24M|      for (k = 0; k <= run && i <= scanInfo.lastCoeff; ++k) {
  ------------------
  |  Branch (3421:19): [True: 5.72M, False: 1.51M]
  |  Branch (3421:31): [True: 5.47M, False: 254k]
  ------------------
 3422|  5.47M|	j = dctZigZag[i++];
 3423|  5.94M|	while (data[j] != 0 && i <= scanInfo.lastCoeff) {
  ------------------
  |  Branch (3423:9): [True: 639k, False: 5.30M]
  |  Branch (3423:25): [True: 468k, False: 171k]
  ------------------
 3424|   468k|	  if ((bit = readBit()) == EOF) {
  ------------------
  |  Branch (3424:8): [True: 508, False: 467k]
  ------------------
 3425|    508|	    return gFalse;
  ------------------
  |  |   18|    508|#define gFalse 0
  ------------------
 3426|    508|	  }
 3427|   467k|	  if (bit) {
  ------------------
  |  Branch (3427:8): [True: 216k, False: 251k]
  ------------------
 3428|   216k|	    if (data[j] >= 0) {
  ------------------
  |  Branch (3428:10): [True: 93.1k, False: 123k]
  ------------------
 3429|  93.1k|	      data[j] += 1 << scanInfo.al;
 3430|   123k|	    } else {
 3431|   123k|	      data[j] -= 1 << scanInfo.al;
 3432|   123k|	    }
 3433|   216k|	  }
 3434|   467k|	  j = dctZigZag[i++];
 3435|   467k|	}
 3436|  5.47M|      }
 3437|  1.77M|      data[j] = amp << scanInfo.al;
 3438|  1.77M|    }
 3439|  2.13M|  }
 3440|       |
 3441|   784k|  return gTrue;
  ------------------
  |  |   17|   784k|#define gTrue 1
  ------------------
 3442|   793k|}
_ZN9DCTStream11decodeImageEv:
 3445|  7.70k|void DCTStream::decodeImage() {
 3446|  7.70k|  int dataIn[64];
 3447|  7.70k|  Guchar dataOut[64];
 3448|  7.70k|  Gushort *quantTable;
 3449|  7.70k|  int pY, pCb, pCr, pR, pG, pB;
 3450|  7.70k|  int x1, y1, x2, y2, x3, y3, x4, y4, x5, y5, cc, i;
 3451|  7.70k|  int h, v, horiz, vert, hSub, vSub;
 3452|  7.70k|  int *p0, *p1, *p2;
 3453|       |
 3454|   176k|  for (y1 = 0; y1 < bufHeight; y1 += mcuHeight) {
  ------------------
  |  Branch (3454:16): [True: 168k, False: 7.70k]
  ------------------
 3455|  1.69M|    for (x1 = 0; x1 < bufWidth; x1 += mcuWidth) {
  ------------------
  |  Branch (3455:18): [True: 1.52M, False: 168k]
  ------------------
 3456|  4.14M|      for (cc = 0; cc < numComps; ++cc) {
  ------------------
  |  Branch (3456:20): [True: 2.61M, False: 1.52M]
  ------------------
 3457|  2.61M|	quantTable = quantTables[compInfo[cc].quantTable];
 3458|  2.61M|	h = compInfo[cc].hSample;
 3459|  2.61M|	v = compInfo[cc].vSample;
 3460|  2.61M|	horiz = mcuWidth / h;
 3461|  2.61M|	vert = mcuHeight / v;
 3462|  2.61M|	hSub = horiz / 8;
 3463|  2.61M|	vSub = vert / 8;
 3464|  5.30M|	for (y2 = 0; y2 < mcuHeight; y2 += vert) {
  ------------------
  |  Branch (3464:15): [True: 2.68M, False: 2.61M]
  ------------------
 3465|  5.90M|	  for (x2 = 0; x2 < mcuWidth; x2 += horiz) {
  ------------------
  |  Branch (3465:17): [True: 3.21M, False: 2.68M]
  ------------------
 3466|       |
 3467|       |	    // pull out the coded data unit
 3468|  3.21M|	    p1 = &frameBuf[cc][(y1+y2) * bufWidth + (x1+x2)];
 3469|  28.9M|	    for (y3 = 0, i = 0; y3 < 8; ++y3, i += 8) {
  ------------------
  |  Branch (3469:26): [True: 25.7M, False: 3.21M]
  ------------------
 3470|  25.7M|	      dataIn[i]   = p1[0];
 3471|  25.7M|	      dataIn[i+1] = p1[1];
 3472|  25.7M|	      dataIn[i+2] = p1[2];
 3473|  25.7M|	      dataIn[i+3] = p1[3];
 3474|  25.7M|	      dataIn[i+4] = p1[4];
 3475|  25.7M|	      dataIn[i+5] = p1[5];
 3476|  25.7M|	      dataIn[i+6] = p1[6];
 3477|  25.7M|	      dataIn[i+7] = p1[7];
 3478|  25.7M|	      p1 += bufWidth * vSub;
 3479|  25.7M|	    }
 3480|       |
 3481|       |	    // transform
 3482|  3.21M|	    transformDataUnit(quantTable, dataIn, dataOut);
 3483|       |
 3484|       |	    // store back into frameBuf, doing replication for
 3485|       |	    // subsampled components
 3486|  3.21M|	    p1 = &frameBuf[cc][(y1+y2) * bufWidth + (x1+x2)];
 3487|  3.21M|	    if (hSub == 1 && vSub == 1) {
  ------------------
  |  Branch (3487:10): [True: 2.05M, False: 1.15M]
  |  Branch (3487:23): [True: 1.91M, False: 141k]
  ------------------
 3488|  17.2M|	      for (y3 = 0, i = 0; y3 < 8; ++y3, i += 8) {
  ------------------
  |  Branch (3488:28): [True: 15.3M, False: 1.91M]
  ------------------
 3489|  15.3M|		p1[0] = dataOut[i] & 0xff;
 3490|  15.3M|		p1[1] = dataOut[i+1] & 0xff;
 3491|  15.3M|		p1[2] = dataOut[i+2] & 0xff;
 3492|  15.3M|		p1[3] = dataOut[i+3] & 0xff;
 3493|  15.3M|		p1[4] = dataOut[i+4] & 0xff;
 3494|  15.3M|		p1[5] = dataOut[i+5] & 0xff;
 3495|  15.3M|		p1[6] = dataOut[i+6] & 0xff;
 3496|  15.3M|		p1[7] = dataOut[i+7] & 0xff;
 3497|  15.3M|		p1 += bufWidth;
 3498|  15.3M|	      }
 3499|  1.91M|	    } else if (hSub == 2 && vSub == 2) {
  ------------------
  |  Branch (3499:17): [True: 1.15M, False: 141k]
  |  Branch (3499:30): [True: 47.4k, False: 1.11M]
  ------------------
 3500|  47.4k|	      p2 = p1 + bufWidth;
 3501|   427k|	      for (y3 = 0, i = 0; y3 < 16; y3 += 2, i += 8) {
  ------------------
  |  Branch (3501:28): [True: 379k, False: 47.4k]
  ------------------
 3502|   379k|		p1[0] = p1[1] = p2[0] = p2[1] = dataOut[i] & 0xff;
 3503|   379k|		p1[2] = p1[3] = p2[2] = p2[3] = dataOut[i+1] & 0xff;
 3504|   379k|		p1[4] = p1[5] = p2[4] = p2[5] = dataOut[i+2] & 0xff;
 3505|   379k|		p1[6] = p1[7] = p2[6] = p2[7] = dataOut[i+3] & 0xff;
 3506|   379k|		p1[8] = p1[9] = p2[8] = p2[9] = dataOut[i+4] & 0xff;
 3507|   379k|		p1[10] = p1[11] = p2[10] = p2[11] = dataOut[i+5] & 0xff;
 3508|   379k|		p1[12] = p1[13] = p2[12] = p2[13] = dataOut[i+6] & 0xff;
 3509|   379k|		p1[14] = p1[15] = p2[14] = p2[15] = dataOut[i+7] & 0xff;
 3510|   379k|		p1 += bufWidth * 2;
 3511|   379k|		p2 += bufWidth * 2;
 3512|   379k|	      }
 3513|  1.25M|	    } else {
 3514|  1.25M|	      i = 0;
 3515|  11.2M|	      for (y3 = 0, y4 = 0; y3 < 8; ++y3, y4 += vSub) {
  ------------------
  |  Branch (3515:29): [True: 10.0M, False: 1.25M]
  ------------------
 3516|  90.2M|		for (x3 = 0, x4 = 0; x3 < 8; ++x3, x4 += hSub) {
  ------------------
  |  Branch (3516:24): [True: 80.1M, False: 10.0M]
  ------------------
 3517|  80.1M|		  p2 = p1 + x4;
 3518|   169M|		  for (y5 = 0; y5 < vSub; ++y5) {
  ------------------
  |  Branch (3518:18): [True: 89.2M, False: 80.1M]
  ------------------
 3519|   249M|		    for (x5 = 0; x5 < hSub; ++x5) {
  ------------------
  |  Branch (3519:20): [True: 160M, False: 89.2M]
  ------------------
 3520|   160M|		      p2[x5] = dataOut[i] & 0xff;
 3521|   160M|		    }
 3522|  89.2M|		    p2 += bufWidth;
 3523|  89.2M|		  }
 3524|  80.1M|		  ++i;
 3525|  80.1M|		}
 3526|  10.0M|		p1 += bufWidth * vSub;
 3527|  10.0M|	      }
 3528|  1.25M|	    }
 3529|  3.21M|	  }
 3530|  2.68M|	}
 3531|  2.61M|      }
 3532|       |
 3533|       |      // color space conversion
 3534|  1.52M|      if (colorXform) {
  ------------------
  |  Branch (3534:11): [True: 1.04M, False: 484k]
  ------------------
 3535|       |	// convert YCbCr to RGB
 3536|  1.04M|	if (numComps == 3) {
  ------------------
  |  Branch (3536:6): [True: 430k, False: 610k]
  ------------------
 3537|  4.02M|	  for (y2 = 0; y2 < mcuHeight; ++y2) {
  ------------------
  |  Branch (3537:17): [True: 3.59M, False: 430k]
  ------------------
 3538|  3.59M|	    p0 = &frameBuf[0][(y1+y2) * bufWidth + x1];
 3539|  3.59M|	    p1 = &frameBuf[1][(y1+y2) * bufWidth + x1];
 3540|  3.59M|	    p2 = &frameBuf[2][(y1+y2) * bufWidth + x1];
 3541|  61.0M|	    for (x2 = 0; x2 < mcuWidth; ++x2) {
  ------------------
  |  Branch (3541:19): [True: 57.4M, False: 3.59M]
  ------------------
 3542|  57.4M|	      pY = *p0;
 3543|  57.4M|	      pCb = *p1 - 128;
 3544|  57.4M|	      pCr = *p2 - 128;
 3545|  57.4M|	      pR = ((pY << 16) + dctCrToR * pCr + 32768) >> 16;
  ------------------
  |  | 2595|  57.4M|#define dctCrToR   91881	//  1.4020
  ------------------
 3546|  57.4M|	      *p0++ = dctClip(pR);
 3547|  57.4M|	      pG = ((pY << 16) + dctCbToG * pCb + dctCrToG * pCr +
  ------------------
  |  | 2596|  57.4M|#define dctCbToG  -22553	// -0.3441363
  ------------------
              	      pG = ((pY << 16) + dctCbToG * pCb + dctCrToG * pCr +
  ------------------
  |  | 2597|  57.4M|#define dctCrToG  -46802	// -0.71413636
  ------------------
 3548|  57.4M|		    32768) >> 16;
 3549|  57.4M|	      *p1++ = dctClip(pG);
 3550|  57.4M|	      pB = ((pY << 16) + dctCbToB * pCb + 32768) >> 16;
  ------------------
  |  | 2598|  57.4M|#define dctCbToB  116130	//  1.772
  ------------------
 3551|  57.4M|	      *p2++ = dctClip(pB);
 3552|  57.4M|	    }
 3553|  3.59M|	  }
 3554|       |	// convert YCbCrK to CMYK (K is passed through unchanged)
 3555|   610k|	} else if (numComps == 4) {
  ------------------
  |  Branch (3555:13): [True: 62.7k, False: 547k]
  ------------------
 3556|   671k|	  for (y2 = 0; y2 < mcuHeight; ++y2) {
  ------------------
  |  Branch (3556:17): [True: 609k, False: 62.7k]
  ------------------
 3557|   609k|	    p0 = &frameBuf[0][(y1+y2) * bufWidth + x1];
 3558|   609k|	    p1 = &frameBuf[1][(y1+y2) * bufWidth + x1];
 3559|   609k|	    p2 = &frameBuf[2][(y1+y2) * bufWidth + x1];
 3560|  10.4M|	    for (x2 = 0; x2 < mcuWidth; ++x2) {
  ------------------
  |  Branch (3560:19): [True: 9.79M, False: 609k]
  ------------------
 3561|  9.79M|	      pY = *p0;
 3562|  9.79M|	      pCb = *p1 - 128;
 3563|  9.79M|	      pCr = *p2 - 128;
 3564|  9.79M|	      pR = ((pY << 16) + dctCrToR * pCr + 32768) >> 16;
  ------------------
  |  | 2595|  9.79M|#define dctCrToR   91881	//  1.4020
  ------------------
 3565|  9.79M|	      *p0++ = 255 - dctClip(pR);
 3566|  9.79M|	      pG = ((pY << 16) + dctCbToG * pCb + dctCrToG * pCr +
  ------------------
  |  | 2596|  9.79M|#define dctCbToG  -22553	// -0.3441363
  ------------------
              	      pG = ((pY << 16) + dctCbToG * pCb + dctCrToG * pCr +
  ------------------
  |  | 2597|  9.79M|#define dctCrToG  -46802	// -0.71413636
  ------------------
 3567|  9.79M|		    32768) >> 16;
 3568|  9.79M|	      *p1++ = 255 - dctClip(pG);
 3569|  9.79M|	      pB = ((pY << 16) + dctCbToB * pCb + 32768) >> 16;
  ------------------
  |  | 2598|  9.79M|#define dctCbToB  116130	//  1.772
  ------------------
 3570|  9.79M|	      *p2++ = 255 - dctClip(pB);
 3571|  9.79M|	    }
 3572|   609k|	  }
 3573|  62.7k|	}
 3574|  1.04M|      }
 3575|  1.52M|    }
 3576|   168k|  }
 3577|  7.70k|}
_ZN9DCTStream17transformDataUnitEPtPiPh:
 3593|  3.35M|				  int dataIn[64], Guchar dataOut[64]) {
 3594|  3.35M|  int v0, v1, v2, v3, v4, v5, v6, v7;
 3595|  3.35M|  int t0, t1, t2, t3, t4, t5, t6, t7;
 3596|  3.35M|  int *p, *scale;
 3597|  3.35M|  Gushort *q;
 3598|  3.35M|  int i;
 3599|       |
 3600|       |  // dequant; inverse DCT on rows
 3601|  30.1M|  for (i = 0; i < 64; i += 8) {
  ------------------
  |  Branch (3601:15): [True: 26.8M, False: 3.35M]
  ------------------
 3602|  26.8M|    p = dataIn + i;
 3603|  26.8M|    q = quantTable + i;
 3604|  26.8M|    scale = idctScaleMat + i;
 3605|       |
 3606|       |    // check for all-zero AC coefficients
 3607|  26.8M|    if (p[1] == 0 && p[2] == 0 && p[3] == 0 &&
  ------------------
  |  Branch (3607:9): [True: 26.3M, False: 483k]
  |  Branch (3607:22): [True: 26.1M, False: 202k]
  |  Branch (3607:35): [True: 25.9M, False: 187k]
  ------------------
 3608|  25.9M|	p[4] == 0 && p[5] == 0 && p[6] == 0 && p[7] == 0) {
  ------------------
  |  Branch (3608:2): [True: 25.7M, False: 160k]
  |  Branch (3608:15): [True: 25.6M, False: 78.7k]
  |  Branch (3608:28): [True: 25.5M, False: 172k]
  |  Branch (3608:41): [True: 25.0M, False: 454k]
  ------------------
 3609|  25.0M|      t0 = p[0] * q[0] * scale[0];
 3610|  25.0M|      if (i == 0) {
  ------------------
  |  Branch (3610:11): [True: 3.13M, False: 21.9M]
  ------------------
 3611|  3.13M|	t0 += 1 << 12;		// rounding bias
 3612|  3.13M|      }
 3613|  25.0M|      p[0] = t0;
 3614|  25.0M|      p[1] = t0;
 3615|  25.0M|      p[2] = t0;
 3616|  25.0M|      p[3] = t0;
 3617|  25.0M|      p[4] = t0;
 3618|  25.0M|      p[5] = t0;
 3619|  25.0M|      p[6] = t0;
 3620|  25.0M|      p[7] = t0;
 3621|  25.0M|      continue;
 3622|  25.0M|    }
 3623|       |
 3624|       |    // stage 4
 3625|  1.74M|    v0 = p[0] * q[0] * scale[0];
 3626|  1.74M|    if (i == 0) {
  ------------------
  |  Branch (3626:9): [True: 220k, False: 1.52M]
  ------------------
 3627|   220k|      v0 += 1 << 12;		// rounding bias
 3628|   220k|    }
 3629|  1.74M|    v1 = p[4] * q[4] * scale[4];
 3630|  1.74M|    v2 = p[2] * q[2] * scale[2];
 3631|  1.74M|    v3 = p[6] * q[6] * scale[6];
 3632|  1.74M|    t0 = p[1] * q[1] * scale[1];
 3633|  1.74M|    t1 = p[7] * q[7] * scale[7];
 3634|  1.74M|    v4 = t0 - t1;
 3635|  1.74M|    v7 = t0 + t1;
 3636|  1.74M|    v5 = p[3] * q[3] * scale[3];
 3637|  1.74M|    v6 = p[5] * q[5] * scale[5];
 3638|       |
 3639|       |    // stage 3
 3640|  1.74M|    t0 = v0 - v1;
 3641|  1.74M|    v0 = v0 + v1;
 3642|  1.74M|    v1 = t0;
 3643|  1.74M|    t0 = v2 + (v2 >> 5);
 3644|  1.74M|    t1 = t0 >> 2;
 3645|  1.74M|    t2 = t1 + (v2 >> 4);	// 41/128 * v2
 3646|  1.74M|    t3 = t0 - t1;		// 99/128 * v2
 3647|  1.74M|    t4 = v3 + (v3 >> 5);
 3648|  1.74M|    t5 = t4 >> 2;
 3649|  1.74M|    t6 = t5 + (v3 >> 4);	// 41/128 * v3
 3650|  1.74M|    t7 = t4 - t5;		// 99/128 * v3
 3651|  1.74M|    v2 = t2 - t7;
 3652|  1.74M|    v3 = t3 + t6;
 3653|  1.74M|    t0 = v4 - v6;
 3654|  1.74M|    v4 = v4 + v6;
 3655|  1.74M|    v6 = t0;
 3656|  1.74M|    t0 = v7 + v5;
 3657|  1.74M|    v5 = v7 - v5;
 3658|  1.74M|    v7 = t0;
 3659|       |
 3660|       |    // stage 2
 3661|  1.74M|    t0 = v0 - v3;
 3662|  1.74M|    v0 = v0 + v3;
 3663|  1.74M|    v3 = t0;
 3664|  1.74M|    t0 = v1 - v2;
 3665|  1.74M|    v1 = v1 + v2;
 3666|  1.74M|    v2 = t0;
 3667|  1.74M|    t0 = (v4 >> 9) - v4;
 3668|  1.74M|    t1 = v4 >> 1;		// 1/2 * v4
 3669|  1.74M|    t2 = (t0 >> 2) - t0;	// 1533/2048 * v4
 3670|  1.74M|    t3 = (v7 >> 9) - v7;
 3671|  1.74M|    t4 = v7 >> 1;		// 1/2 * v7
 3672|  1.74M|    t5 = (t3 >> 2) - t3;	// 1533/2048 * v7
 3673|  1.74M|    v4 = t2 - t4;
 3674|  1.74M|    v7 = t1 + t5;
 3675|  1.74M|    t0 = (v5 >> 3) - (v5 >> 7);
 3676|  1.74M|    t1 = t0 - (v5 >> 11);
 3677|  1.74M|    t2 = t0 + (t1 >> 1);	// 719/4096 * v5
 3678|  1.74M|    t3 = v5 - t0;		// 113/256 * v5
 3679|  1.74M|    t4 = (v6 >> 3) - (v6 >> 7);
 3680|  1.74M|    t5 = t4 - (v6 >> 11);
 3681|  1.74M|    t6 = t4 + (t5 >> 1);	// 719/4096 * v6
 3682|  1.74M|    t7 = v6 - t4;		// 113/256 * v6
 3683|  1.74M|    v5 = t3 - t6;
 3684|  1.74M|    v6 = t2 + t7;
 3685|       |
 3686|       |    // stage 1
 3687|  1.74M|    p[0] = v0 + v7;
 3688|  1.74M|    p[7] = v0 - v7;
 3689|  1.74M|    p[1] = v1 + v6;
 3690|  1.74M|    p[6] = v1 - v6;
 3691|  1.74M|    p[2] = v2 + v5;
 3692|  1.74M|    p[5] = v2 - v5;
 3693|  1.74M|    p[3] = v3 + v4;
 3694|  1.74M|    p[4] = v3 - v4;
 3695|  1.74M|  }
 3696|       |
 3697|       |  // inverse DCT on columns
 3698|  30.1M|  for (i = 0; i < 8; ++i) {
  ------------------
  |  Branch (3698:15): [True: 26.8M, False: 3.35M]
  ------------------
 3699|  26.8M|    p = dataIn + i;
 3700|       |
 3701|       |    // check for all-zero AC coefficients
 3702|  26.8M|    if (p[1*8] == 0 && p[2*8] == 0 && p[3*8] == 0 &&
  ------------------
  |  Branch (3702:9): [True: 24.8M, False: 1.99M]
  |  Branch (3702:24): [True: 24.6M, False: 177k]
  |  Branch (3702:39): [True: 24.6M, False: 18.1k]
  ------------------
 3703|  24.6M|	p[4*8] == 0 && p[5*8] == 0 && p[6*8] == 0 && p[7*8] == 0) {
  ------------------
  |  Branch (3703:2): [True: 24.5M, False: 10.6k]
  |  Branch (3703:17): [True: 23.3M, False: 1.29M]
  |  Branch (3703:32): [True: 23.1M, False: 161k]
  |  Branch (3703:47): [True: 22.6M, False: 491k]
  ------------------
 3704|  22.6M|      t0 = p[0*8];
 3705|  22.6M|      p[1*8] = t0;
 3706|  22.6M|      p[2*8] = t0;
 3707|  22.6M|      p[3*8] = t0;
 3708|  22.6M|      p[4*8] = t0;
 3709|  22.6M|      p[5*8] = t0;
 3710|  22.6M|      p[6*8] = t0;
 3711|  22.6M|      p[7*8] = t0;
 3712|  22.6M|      continue;
 3713|  22.6M|    }
 3714|       |
 3715|       |    // stage 4
 3716|  4.15M|    v0 = p[0*8];
 3717|  4.15M|    v1 = p[4*8];
 3718|  4.15M|    v2 = p[2*8];
 3719|  4.15M|    v3 = p[6*8];
 3720|  4.15M|    t0 = p[1*8];
 3721|  4.15M|    t1 = p[7*8];
 3722|  4.15M|    v4 = t0 - t1;
 3723|  4.15M|    v7 = t0 + t1;
 3724|  4.15M|    v5 = p[3*8];
 3725|  4.15M|    v6 = p[5*8];
 3726|       |
 3727|       |    // stage 3
 3728|  4.15M|    t0 = v0 - v1;
 3729|  4.15M|    v0 = v0 + v1;
 3730|  4.15M|    v1 = t0;
 3731|  4.15M|    t0 = v2 + (v2 >> 5);
 3732|  4.15M|    t1 = t0 >> 2;
 3733|  4.15M|    t2 = t1 + (v2 >> 4);	// 41/128 * v2
 3734|  4.15M|    t3 = t0 - t1;		// 99/128 * v2
 3735|  4.15M|    t4 = v3 + (v3 >> 5);
 3736|  4.15M|    t5 = t4 >> 2;
 3737|  4.15M|    t6 = t5 + (v3 >> 4);	// 41/128 * v3
 3738|  4.15M|    t7 = t4 - t5;		// 99/128 * v3
 3739|  4.15M|    v2 = t2 - t7;
 3740|  4.15M|    v3 = t3 + t6;
 3741|  4.15M|    t0 = v4 - v6;
 3742|  4.15M|    v4 = v4 + v6;
 3743|  4.15M|    v6 = t0;
 3744|  4.15M|    t0 = v7 + v5;
 3745|  4.15M|    v5 = v7 - v5;
 3746|  4.15M|    v7 = t0;
 3747|       |
 3748|       |    // stage 2
 3749|  4.15M|    t0 = v0 - v3;
 3750|  4.15M|    v0 = v0 + v3;
 3751|  4.15M|    v3 = t0;
 3752|  4.15M|    t0 = v1 - v2;
 3753|  4.15M|    v1 = v1 + v2;
 3754|  4.15M|    v2 = t0;
 3755|  4.15M|    t0 = (v4 >> 9) - v4;
 3756|  4.15M|    t1 = v4 >> 1;		// 1/2 * v4
 3757|  4.15M|    t2 = (t0 >> 2) - t0;	// 1533/2048 * v4
 3758|  4.15M|    t3 = (v7 >> 9) - v7;
 3759|  4.15M|    t4 = v7 >> 1;		// 1/2 * v7
 3760|  4.15M|    t5 = (t3 >> 2) - t3;	// 1533/2048 * v7
 3761|  4.15M|    v4 = t2 - t4;
 3762|  4.15M|    v7 = t1 + t5;
 3763|  4.15M|    t0 = (v5 >> 3) - (v5 >> 7);
 3764|  4.15M|    t1 = t0 - (v5 >> 11);
 3765|  4.15M|    t2 = t0 + (t1 >> 1);	// 719/4096 * v5
 3766|  4.15M|    t3 = v5 - t0;		// 113/256 * v5
 3767|  4.15M|    t4 = (v6 >> 3) - (v6 >> 7);
 3768|  4.15M|    t5 = t4 - (v6 >> 11);
 3769|  4.15M|    t6 = t4 + (t5 >> 1);	// 719/4096 * v6
 3770|  4.15M|    t7 = v6 - t4;		// 113/256 * v6
 3771|  4.15M|    v5 = t3 - t6;
 3772|  4.15M|    v6 = t2 + t7;
 3773|       |
 3774|       |    // stage 1
 3775|  4.15M|    p[0*8] = v0 + v7;
 3776|  4.15M|    p[7*8] = v0 - v7;
 3777|  4.15M|    p[1*8] = v1 + v6;
 3778|  4.15M|    p[6*8] = v1 - v6;
 3779|  4.15M|    p[2*8] = v2 + v5;
 3780|  4.15M|    p[5*8] = v2 - v5;
 3781|  4.15M|    p[3*8] = v3 + v4;
 3782|  4.15M|    p[4*8] = v3 - v4;
 3783|  4.15M|  }
 3784|       |
 3785|       |  // convert to 8-bit integers
 3786|   217M|  for (i = 0; i < 64; ++i) {
  ------------------
  |  Branch (3786:15): [True: 214M, False: 3.35M]
  ------------------
 3787|   214M|    dataOut[i] = dctClip(128 + (dataIn[i] >> 13));
 3788|   214M|  }
 3789|  3.35M|}
_ZN9DCTStream11readHuffSymEP12DCTHuffTable:
 3791|  4.57M|int DCTStream::readHuffSym(DCTHuffTable *table) {
 3792|  4.57M|  Gushort code;
 3793|  4.57M|  int bit;
 3794|  4.57M|  int codeBits;
 3795|       |
 3796|  4.57M|  code = 0;
 3797|  4.57M|  codeBits = 0;
 3798|  11.9M|  do {
 3799|       |    // add a bit to the code
 3800|  11.9M|    if ((bit = readBit()) == EOF) {
  ------------------
  |  Branch (3800:9): [True: 4.98k, False: 11.8M]
  ------------------
 3801|  4.98k|      return 9999;
 3802|  4.98k|    }
 3803|  11.8M|    code = (Gushort)((code << 1) + bit);
 3804|  11.8M|    ++codeBits;
 3805|       |
 3806|       |    // look up code
 3807|  11.8M|    if (code < table->firstCode[codeBits]) {
  ------------------
  |  Branch (3807:9): [True: 0, False: 11.8M]
  ------------------
 3808|      0|      break;
 3809|      0|    }
 3810|  11.8M|    if (code - table->firstCode[codeBits] < table->numCodes[codeBits]) {
  ------------------
  |  Branch (3810:9): [True: 4.57M, False: 7.32M]
  ------------------
 3811|  4.57M|      code = (Gushort)(code - table->firstCode[codeBits]);
 3812|  4.57M|      return table->sym[table->firstSym[codeBits] + code];
 3813|  4.57M|    }
 3814|  11.8M|  } while (codeBits < 16);
  ------------------
  |  Branch (3814:12): [True: 7.32M, False: 153]
  ------------------
 3815|       |
 3816|    153|  error(errSyntaxError, getPos(), "Bad Huffman code in DCT stream");
 3817|    153|  return 9999;
 3818|  4.57M|}
_ZN9DCTStream7readAmpEi:
 3820|  4.01M|int DCTStream::readAmp(int size) {
 3821|  4.01M|  int amp, bit;
 3822|  4.01M|  int bits;
 3823|       |
 3824|  4.01M|  amp = 0;
 3825|  30.1M|  for (bits = 0; bits < size; ++bits) {
  ------------------
  |  Branch (3825:18): [True: 26.0M, False: 4.00M]
  ------------------
 3826|  26.0M|    if ((bit = readBit()) == EOF)
  ------------------
  |  Branch (3826:9): [True: 6.94k, False: 26.0M]
  ------------------
 3827|  6.94k|      return 9999;
 3828|  26.0M|    amp = (amp << 1) + bit;
 3829|  26.0M|  }
 3830|  4.00M|  if (amp < (1 << (size - 1)))
  ------------------
  |  Branch (3830:7): [True: 2.43M, False: 1.57M]
  ------------------
 3831|  2.43M|    amp -= (1 << size) - 1;
 3832|  4.00M|  return amp;
 3833|  4.01M|}
_ZN9DCTStream7readBitEv:
 3835|  39.6M|int DCTStream::readBit() {
 3836|  39.6M|  int bit;
 3837|  39.6M|  int c, c2;
 3838|       |
 3839|  39.6M|  if (inputBits == 0) {
  ------------------
  |  Branch (3839:7): [True: 4.97M, False: 34.6M]
  ------------------
 3840|  4.97M|    if ((c = str->getChar()) == EOF)
  ------------------
  |  Branch (3840:9): [True: 2.14k, False: 4.97M]
  ------------------
 3841|  2.14k|      return EOF;
 3842|  4.97M|    if (c == 0xff) {
  ------------------
  |  Branch (3842:9): [True: 18.8k, False: 4.95M]
  ------------------
 3843|  53.7k|      do {
 3844|  53.7k|	c2 = str->getChar();
 3845|  53.7k|      } while (c2 == 0xff);
  ------------------
  |  Branch (3845:16): [True: 34.8k, False: 18.8k]
  ------------------
 3846|  18.8k|      if (c2 != 0x00) {
  ------------------
  |  Branch (3846:11): [True: 12.6k, False: 6.25k]
  ------------------
 3847|  12.6k|	error(errSyntaxError, getPos(), "Bad DCT data: missing 00 after ff");
 3848|  12.6k|	return EOF;
 3849|  12.6k|      }
 3850|  18.8k|    }
 3851|  4.95M|    inputBuf = c;
 3852|  4.95M|    inputBits = 8;
 3853|  4.95M|  }
 3854|  39.6M|  bit = (inputBuf >> (inputBits - 1)) & 1;
 3855|  39.6M|  --inputBits;
 3856|  39.6M|  return bit;
 3857|  39.6M|}
_ZN9DCTStream10readHeaderEi:
 3859|  38.7k|GBool DCTStream::readHeader(GBool frame) {
 3860|  38.7k|  GBool haveSOF, doScan;
 3861|  38.7k|  int n, i;
 3862|  38.7k|  int c = 0;
 3863|       |
 3864|       |  // read headers
 3865|  38.7k|  haveSOF = gFalse;
  ------------------
  |  |   18|  38.7k|#define gFalse 0
  ------------------
 3866|  38.7k|  doScan = gFalse;
  ------------------
  |  |   18|  38.7k|#define gFalse 0
  ------------------
 3867|   188k|  while (!doScan) {
  ------------------
  |  Branch (3867:10): [True: 169k, False: 18.6k]
  ------------------
 3868|   169k|    c = readMarker();
 3869|   169k|    switch (c) {
 3870|  2.60k|    case 0xc0:			// SOF0 (sequential)
  ------------------
  |  Branch (3870:5): [True: 2.60k, False: 167k]
  ------------------
 3871|  10.6k|    case 0xc1:			// SOF1 (extended sequential)
  ------------------
  |  Branch (3871:5): [True: 8.09k, False: 161k]
  ------------------
 3872|  10.6k|      if (!frame) {
  ------------------
  |  Branch (3872:11): [True: 400, False: 10.2k]
  ------------------
 3873|    400|	error(errSyntaxError, getPos(),
 3874|    400|	      "Invalid DCT marker in scan <{0:02x}>", c);
 3875|    400|	return gFalse;
  ------------------
  |  |   18|    400|#define gFalse 0
  ------------------
 3876|    400|      }
 3877|  10.2k|      if (!readBaselineSOF()) {
  ------------------
  |  Branch (3877:11): [True: 1.89k, False: 8.40k]
  ------------------
 3878|  1.89k|	return gFalse;
  ------------------
  |  |   18|  1.89k|#define gFalse 0
  ------------------
 3879|  1.89k|      }
 3880|  8.40k|      haveSOF = gTrue;
  ------------------
  |  |   17|  8.40k|#define gTrue 1
  ------------------
 3881|  8.40k|      break;
 3882|  11.9k|    case 0xc2:			// SOF2 (progressive)
  ------------------
  |  Branch (3882:5): [True: 11.9k, False: 157k]
  ------------------
 3883|  11.9k|      if (!frame) {
  ------------------
  |  Branch (3883:11): [True: 400, False: 11.5k]
  ------------------
 3884|    400|	error(errSyntaxError, getPos(),
 3885|    400|	      "Invalid DCT marker in scan <{0:02x}>", c);
 3886|    400|	return gFalse;
  ------------------
  |  |   18|    400|#define gFalse 0
  ------------------
 3887|    400|      }
 3888|  11.5k|      if (!readProgressiveSOF()) {
  ------------------
  |  Branch (3888:11): [True: 1.57k, False: 10.0k]
  ------------------
 3889|  1.57k|	return gFalse;
  ------------------
  |  |   18|  1.57k|#define gFalse 0
  ------------------
 3890|  1.57k|      }
 3891|  10.0k|      haveSOF = gTrue;
  ------------------
  |  |   17|  10.0k|#define gTrue 1
  ------------------
 3892|  10.0k|      break;
 3893|  14.9k|    case 0xc4:			// DHT
  ------------------
  |  Branch (3893:5): [True: 14.9k, False: 154k]
  ------------------
 3894|  14.9k|      if (!readHuffmanTables()) {
  ------------------
  |  Branch (3894:11): [True: 527, False: 14.4k]
  ------------------
 3895|    527|	return gFalse;
  ------------------
  |  |   18|    527|#define gFalse 0
  ------------------
 3896|    527|      }
 3897|  14.4k|      break;
 3898|  17.6k|    case 0xd8:			// SOI
  ------------------
  |  Branch (3898:5): [True: 17.6k, False: 152k]
  ------------------
 3899|  17.6k|      if (!frame) {
  ------------------
  |  Branch (3899:11): [True: 381, False: 17.2k]
  ------------------
 3900|    381|	error(errSyntaxError, getPos(),
 3901|    381|	      "Invalid DCT marker in scan <{0:02x}>", c);
 3902|    381|	return gFalse;
  ------------------
  |  |   18|    381|#define gFalse 0
  ------------------
 3903|    381|      }
 3904|  17.2k|      break;
 3905|  17.2k|    case 0xd9:			// EOI
  ------------------
  |  Branch (3905:5): [True: 195, False: 169k]
  ------------------
 3906|    195|      return gFalse;
  ------------------
  |  |   18|    195|#define gFalse 0
  ------------------
 3907|  20.2k|    case 0xda:			// SOS
  ------------------
  |  Branch (3907:5): [True: 20.2k, False: 149k]
  ------------------
 3908|  20.2k|      if (frame && !haveSOF) {
  ------------------
  |  Branch (3908:11): [True: 12.6k, False: 7.60k]
  |  Branch (3908:20): [True: 214, False: 12.4k]
  ------------------
 3909|    214|	error(errSyntaxError, getPos(), "Missing SOF in DCT stream");
 3910|    214|	return gFalse;
  ------------------
  |  |   18|    214|#define gFalse 0
  ------------------
 3911|    214|      }
 3912|  20.0k|      if (!readScanInfo()) {
  ------------------
  |  Branch (3912:11): [True: 1.39k, False: 18.6k]
  ------------------
 3913|  1.39k|	return gFalse;
  ------------------
  |  |   18|  1.39k|#define gFalse 0
  ------------------
 3914|  1.39k|      }
 3915|  18.6k|      if (frame) {
  ------------------
  |  Branch (3915:11): [True: 11.1k, False: 7.48k]
  ------------------
 3916|  11.1k|	interleaved = scanInfo.numComps == numComps;
 3917|  11.1k|      }
 3918|  18.6k|      doScan = gTrue;
  ------------------
  |  |   17|  18.6k|#define gTrue 1
  ------------------
 3919|  18.6k|      break;
 3920|  20.4k|    case 0xdb:			// DQT
  ------------------
  |  Branch (3920:5): [True: 20.4k, False: 149k]
  ------------------
 3921|  20.4k|      if (!readQuantTables()) {
  ------------------
  |  Branch (3921:11): [True: 675, False: 19.8k]
  ------------------
 3922|    675|	return gFalse;
  ------------------
  |  |   18|    675|#define gFalse 0
  ------------------
 3923|    675|      }
 3924|  19.8k|      break;
 3925|  19.8k|    case 0xdd:			// DRI
  ------------------
  |  Branch (3925:5): [True: 4.52k, False: 165k]
  ------------------
 3926|  4.52k|      if (!readRestartInterval()) {
  ------------------
  |  Branch (3926:11): [True: 732, False: 3.79k]
  ------------------
 3927|    732|	return gFalse;
  ------------------
  |  |   18|    732|#define gFalse 0
  ------------------
 3928|    732|      }
 3929|  3.79k|      break;
 3930|  16.1k|    case 0xe0:			// APP0
  ------------------
  |  Branch (3930:5): [True: 16.1k, False: 153k]
  ------------------
 3931|  16.1k|      if (!frame) {
  ------------------
  |  Branch (3931:11): [True: 639, False: 15.5k]
  ------------------
 3932|    639|	error(errSyntaxError, getPos(),
 3933|    639|	      "Invalid DCT marker in scan <{0:02x}>", c);
 3934|    639|	return gFalse;
  ------------------
  |  |   18|    639|#define gFalse 0
  ------------------
 3935|    639|      }
 3936|  15.5k|      if (!readJFIFMarker()) {
  ------------------
  |  Branch (3936:11): [True: 403, False: 15.1k]
  ------------------
 3937|    403|	return gFalse;
  ------------------
  |  |   18|    403|#define gFalse 0
  ------------------
 3938|    403|      }
 3939|  15.1k|      break;
 3940|  19.3k|    case 0xee:			// APP14
  ------------------
  |  Branch (3940:5): [True: 19.3k, False: 150k]
  ------------------
 3941|  19.3k|      if (!frame) {
  ------------------
  |  Branch (3941:11): [True: 418, False: 18.8k]
  ------------------
 3942|    418|	error(errSyntaxError, getPos(),
 3943|    418|	      "Invalid DCT marker in scan <{0:02x}>", c);
 3944|    418|	return gFalse;
  ------------------
  |  |   18|    418|#define gFalse 0
  ------------------
 3945|    418|      }
 3946|  18.8k|      if (!readAdobeMarker()) {
  ------------------
  |  Branch (3946:11): [True: 1.18k, False: 17.7k]
  ------------------
 3947|  1.18k|	return gFalse;
  ------------------
  |  |   18|  1.18k|#define gFalse 0
  ------------------
 3948|  1.18k|      }
 3949|  17.7k|      break;
 3950|  17.7k|    case EOF:
  ------------------
  |  Branch (3950:5): [True: 4.99k, False: 164k]
  ------------------
 3951|  4.99k|      error(errSyntaxError, getPos(), "Bad DCT header");
 3952|  4.99k|      return gFalse;
  ------------------
  |  |   18|  4.99k|#define gFalse 0
  ------------------
 3953|  28.7k|    default:
  ------------------
  |  Branch (3953:5): [True: 28.7k, False: 141k]
  ------------------
 3954|       |      // skip APPn / COM / etc.
 3955|  28.7k|      if (c >= 0xe0) {
  ------------------
  |  Branch (3955:11): [True: 24.6k, False: 4.09k]
  ------------------
 3956|  24.6k|	n = read16() - 2;
 3957|  24.6k|	str->discardChars(n);
 3958|  24.6k|      } else {
 3959|  4.09k|	error(errSyntaxError, getPos(), "Unknown DCT marker <{0:02x}>", c);
 3960|  4.09k|	return gFalse;
  ------------------
  |  |   18|  4.09k|#define gFalse 0
  ------------------
 3961|  4.09k|      }
 3962|  24.6k|      break;
 3963|   169k|    }
 3964|   169k|  }
 3965|       |
 3966|  75.5k|  for (i = 0; i < numComps; ++i) {
  ------------------
  |  Branch (3966:15): [True: 57.0k, False: 18.4k]
  ------------------
 3967|  57.0k|    if (compInfo[i].quantTable >= numQuantTables) {
  ------------------
  |  Branch (3967:9): [True: 154, False: 56.9k]
  ------------------
 3968|    154|      error(errSyntaxError, getPos(), "Invalid DCT quant table selector");
 3969|    154|      return gFalse;
  ------------------
  |  |   18|    154|#define gFalse 0
  ------------------
 3970|    154|    }
 3971|  57.0k|  }
 3972|       |
 3973|  18.4k|  return gTrue;
  ------------------
  |  |   17|  18.4k|#define gTrue 1
  ------------------
 3974|  18.6k|}
_ZN9DCTStream15readBaselineSOFEv:
 3976|  10.2k|GBool DCTStream::readBaselineSOF() {
 3977|  10.2k|  int prec;
 3978|  10.2k|  int i;
 3979|  10.2k|  int c;
 3980|       |
 3981|  10.2k|  read16(); // length
 3982|  10.2k|  prec = str->getChar();
 3983|  10.2k|  height = read16();
 3984|  10.2k|  width = read16();
 3985|  10.2k|  numComps = str->getChar();
 3986|  10.2k|  if (numComps <= 0 || numComps > 4) {
  ------------------
  |  Branch (3986:7): [True: 794, False: 9.49k]
  |  Branch (3986:24): [True: 146, False: 9.35k]
  ------------------
 3987|    940|    error(errSyntaxError, getPos(), "Bad number of components in DCT stream");
 3988|    940|    numComps = 0;
 3989|    940|    return gFalse;
  ------------------
  |  |   18|    940|#define gFalse 0
  ------------------
 3990|    940|  }
 3991|  9.35k|  if (prec != 8) {
  ------------------
  |  Branch (3991:7): [True: 270, False: 9.08k]
  ------------------
 3992|    270|    error(errSyntaxError, getPos(), "Bad DCT precision {0:d}", prec);
 3993|    270|    return gFalse;
  ------------------
  |  |   18|    270|#define gFalse 0
  ------------------
 3994|    270|  }
 3995|  36.2k|  for (i = 0; i < numComps; ++i) {
  ------------------
  |  Branch (3995:15): [True: 27.8k, False: 8.40k]
  ------------------
 3996|  27.8k|    compInfo[i].id = str->getChar();
 3997|  27.8k|    c = str->getChar();
 3998|  27.8k|    compInfo[i].hSample = (c >> 4) & 0x0f;
 3999|  27.8k|    compInfo[i].vSample = c & 0x0f;
 4000|  27.8k|    compInfo[i].quantTable = str->getChar();
 4001|       |    // a sampling factor of 3 is allowed by the spec, but requires
 4002|       |    // messy upsampling, and appears not to be used in practice
 4003|  27.8k|    if (!(compInfo[i].hSample == 1 ||
  ------------------
  |  Branch (4003:11): [True: 19.1k, False: 8.75k]
  ------------------
 4004|  8.75k|	  compInfo[i].hSample == 2 ||
  ------------------
  |  Branch (4004:4): [True: 8.11k, False: 638]
  ------------------
 4005|    638|	  compInfo[i].hSample == 4) ||
  ------------------
  |  Branch (4005:4): [True: 384, False: 254]
  ------------------
 4006|  27.6k|	!(compInfo[i].vSample == 1 ||
  ------------------
  |  Branch (4006:4): [True: 23.0k, False: 4.59k]
  ------------------
 4007|  4.59k|	  compInfo[i].vSample == 2 ||
  ------------------
  |  Branch (4007:4): [True: 3.59k, False: 992]
  ------------------
 4008|    992|	  compInfo[i].vSample == 4)) {
  ------------------
  |  Branch (4008:4): [True: 849, False: 143]
  ------------------
 4009|    397|      error(errSyntaxError, getPos(), "Bad DCT sampling factor");
 4010|    397|      return gFalse;
  ------------------
  |  |   18|    397|#define gFalse 0
  ------------------
 4011|    397|    }
 4012|  27.4k|    if (compInfo[i].quantTable < 0 || compInfo[i].quantTable > 3) {
  ------------------
  |  Branch (4012:9): [True: 22, False: 27.4k]
  |  Branch (4012:39): [True: 264, False: 27.1k]
  ------------------
 4013|    286|      error(errSyntaxError, getPos(), "Bad DCT quant table selector");
 4014|    286|      return gFalse;
  ------------------
  |  |   18|    286|#define gFalse 0
  ------------------
 4015|    286|    }
 4016|  27.4k|  }
 4017|  8.40k|  progressive = gFalse;
  ------------------
  |  |   18|  8.40k|#define gFalse 0
  ------------------
 4018|  8.40k|  return gTrue;
  ------------------
  |  |   17|  8.40k|#define gTrue 1
  ------------------
 4019|  9.08k|}
_ZN9DCTStream18readProgressiveSOFEv:
 4021|  11.5k|GBool DCTStream::readProgressiveSOF() {
 4022|  11.5k|  int prec;
 4023|  11.5k|  int i;
 4024|  11.5k|  int c;
 4025|       |
 4026|  11.5k|  read16(); // length
 4027|  11.5k|  prec = str->getChar();
 4028|  11.5k|  height = read16();
 4029|  11.5k|  width = read16();
 4030|  11.5k|  numComps = str->getChar();
 4031|  11.5k|  if (numComps <= 0 || numComps > 4) {
  ------------------
  |  Branch (4031:7): [True: 545, False: 11.0k]
  |  Branch (4031:24): [True: 246, False: 10.7k]
  ------------------
 4032|    791|    error(errSyntaxError, getPos(), "Bad number of components in DCT stream");
 4033|    791|    numComps = 0;
 4034|    791|    return gFalse;
  ------------------
  |  |   18|    791|#define gFalse 0
  ------------------
 4035|    791|  }
 4036|  10.7k|  if (prec != 8) {
  ------------------
  |  Branch (4036:7): [True: 136, False: 10.6k]
  ------------------
 4037|    136|    error(errSyntaxError, getPos(), "Bad DCT precision {0:d}", prec);
 4038|    136|    return gFalse;
  ------------------
  |  |   18|    136|#define gFalse 0
  ------------------
 4039|    136|  }
 4040|  40.0k|  for (i = 0; i < numComps; ++i) {
  ------------------
  |  Branch (4040:15): [True: 30.0k, False: 10.0k]
  ------------------
 4041|  30.0k|    compInfo[i].id = str->getChar();
 4042|  30.0k|    c = str->getChar();
 4043|  30.0k|    compInfo[i].hSample = (c >> 4) & 0x0f;
 4044|  30.0k|    compInfo[i].vSample = c & 0x0f;
 4045|  30.0k|    compInfo[i].quantTable = str->getChar();
 4046|       |    // a sampling factor of 3 is allowed by the spec, but requires
 4047|       |    // messy upsampling, and appears not to be used in practice
 4048|  30.0k|    if (!(compInfo[i].hSample == 1 ||
  ------------------
  |  Branch (4048:11): [True: 19.5k, False: 10.5k]
  ------------------
 4049|  10.5k|	  compInfo[i].hSample == 2 ||
  ------------------
  |  Branch (4049:4): [True: 10.1k, False: 394]
  ------------------
 4050|    394|	  compInfo[i].hSample == 4) ||
  ------------------
  |  Branch (4050:4): [True: 195, False: 199]
  ------------------
 4051|  29.8k|	!(compInfo[i].vSample == 1 ||
  ------------------
  |  Branch (4051:4): [True: 28.5k, False: 1.34k]
  ------------------
 4052|  1.34k|	  compInfo[i].vSample == 2 ||
  ------------------
  |  Branch (4052:4): [True: 769, False: 579]
  ------------------
 4053|    579|	  compInfo[i].vSample == 4)) {
  ------------------
  |  Branch (4053:4): [True: 451, False: 128]
  ------------------
 4054|    327|      error(errSyntaxError, getPos(), "Bad DCT sampling factor");
 4055|    327|      return gFalse;
  ------------------
  |  |   18|    327|#define gFalse 0
  ------------------
 4056|    327|    }
 4057|  29.7k|    if (compInfo[i].quantTable < 0 || compInfo[i].quantTable > 3) {
  ------------------
  |  Branch (4057:9): [True: 0, False: 29.7k]
  |  Branch (4057:39): [True: 323, False: 29.4k]
  ------------------
 4058|    323|      error(errSyntaxError, getPos(), "Bad DCT quant table selector");
 4059|    323|      return gFalse;
  ------------------
  |  |   18|    323|#define gFalse 0
  ------------------
 4060|    323|    }
 4061|  29.7k|  }
 4062|  10.0k|  progressive = gTrue;
  ------------------
  |  |   17|  10.0k|#define gTrue 1
  ------------------
 4063|  10.0k|  return gTrue;
  ------------------
  |  |   17|  10.0k|#define gTrue 1
  ------------------
 4064|  10.6k|}
_ZN9DCTStream12readScanInfoEv:
 4066|  20.0k|GBool DCTStream::readScanInfo() {
 4067|  20.0k|  int length;
 4068|  20.0k|  int id, c;
 4069|  20.0k|  int i, j;
 4070|       |
 4071|  20.0k|  length = read16() - 2;
 4072|  20.0k|  scanInfo.numComps = str->getChar();
 4073|  20.0k|  if (scanInfo.numComps <= 0 || scanInfo.numComps > 4) {
  ------------------
  |  Branch (4073:7): [True: 395, False: 19.6k]
  |  Branch (4073:33): [True: 32, False: 19.5k]
  ------------------
 4074|    427|    error(errSyntaxError, getPos(), "Bad number of components in DCT stream");
 4075|    427|    scanInfo.numComps = 0;
 4076|    427|    return gFalse;
  ------------------
  |  |   18|    427|#define gFalse 0
  ------------------
 4077|    427|  }
 4078|  19.5k|  --length;
 4079|  19.5k|  if (length != 2 * scanInfo.numComps + 3) {
  ------------------
  |  Branch (4079:7): [True: 157, False: 19.4k]
  ------------------
 4080|    157|    error(errSyntaxError, getPos(), "Bad DCT scan info block");
 4081|    157|    return gFalse;
  ------------------
  |  |   18|    157|#define gFalse 0
  ------------------
 4082|    157|  }
 4083|  79.4k|  for (j = 0; j < numComps; ++j) {
  ------------------
  |  Branch (4083:15): [True: 59.9k, False: 19.4k]
  ------------------
 4084|  59.9k|    scanInfo.comp[j] = gFalse;
  ------------------
  |  |   18|  59.9k|#define gFalse 0
  ------------------
 4085|  59.9k|  }
 4086|  74.6k|  for (i = 0; i < scanInfo.numComps; ++i) {
  ------------------
  |  Branch (4086:15): [True: 55.5k, False: 19.1k]
  ------------------
 4087|  55.5k|    id = str->getChar();
 4088|       |    // some (broken) DCT streams reuse ID numbers, but at least they
 4089|       |    // keep the components in order, so we check compInfo[i] first to
 4090|       |    // work around the problem
 4091|  55.5k|    if (id == compInfo[i].id) {
  ------------------
  |  Branch (4091:9): [True: 51.2k, False: 4.29k]
  ------------------
 4092|  51.2k|      j = i;
 4093|  51.2k|    } else {
 4094|  16.7k|      for (j = 0; j < numComps; ++j) {
  ------------------
  |  Branch (4094:19): [True: 16.5k, False: 144]
  ------------------
 4095|  16.5k|	if (id == compInfo[j].id) {
  ------------------
  |  Branch (4095:6): [True: 4.15k, False: 12.4k]
  ------------------
 4096|  4.15k|	  break;
 4097|  4.15k|	}
 4098|  16.5k|      }
 4099|  4.29k|      if (j == numComps) {
  ------------------
  |  Branch (4099:11): [True: 144, False: 4.15k]
  ------------------
 4100|    144|	error(errSyntaxError, getPos(),
 4101|    144|	      "Bad DCT component ID in scan info block");
 4102|    144|	return gFalse;
  ------------------
  |  |   18|    144|#define gFalse 0
  ------------------
 4103|    144|      }
 4104|  4.29k|    }
 4105|  55.3k|    if (scanInfo.comp[j]) {
  ------------------
  |  Branch (4105:9): [True: 129, False: 55.2k]
  ------------------
 4106|    129|      error(errSyntaxError, getPos(),
 4107|    129|	    "Invalid DCT component ID in scan info block");
 4108|    129|      return gFalse;
  ------------------
  |  |   18|    129|#define gFalse 0
  ------------------
 4109|    129|    }
 4110|  55.2k|    scanInfo.comp[j] = gTrue;
  ------------------
  |  |   17|  55.2k|#define gTrue 1
  ------------------
 4111|  55.2k|    c = str->getChar();
 4112|  55.2k|    scanInfo.dcHuffTable[j] = (c >> 4) & 0x0f;
 4113|  55.2k|    scanInfo.acHuffTable[j] = c & 0x0f;
 4114|  55.2k|  }
 4115|  19.1k|  scanInfo.firstCoeff = str->getChar();
 4116|  19.1k|  scanInfo.lastCoeff = str->getChar();
 4117|  19.1k|  if (scanInfo.firstCoeff < 0 || scanInfo.lastCoeff > 63 ||
  ------------------
  |  Branch (4117:7): [True: 199, False: 18.9k]
  |  Branch (4117:34): [True: 218, False: 18.7k]
  ------------------
 4118|  18.7k|      scanInfo.firstCoeff > scanInfo.lastCoeff) {
  ------------------
  |  Branch (4118:7): [True: 119, False: 18.6k]
  ------------------
 4119|    536|    error(errSyntaxError, getPos(),
 4120|    536|	  "Bad DCT coefficient numbers in scan info block");
 4121|    536|    return gFalse;
  ------------------
  |  |   18|    536|#define gFalse 0
  ------------------
 4122|    536|  }
 4123|  18.6k|  c = str->getChar();
 4124|  18.6k|  scanInfo.ah = (c >> 4) & 0x0f;
 4125|  18.6k|  scanInfo.al = c & 0x0f;
 4126|  18.6k|  return gTrue;
  ------------------
  |  |   17|  18.6k|#define gTrue 1
  ------------------
 4127|  19.1k|}
_ZN9DCTStream15readQuantTablesEv:
 4129|  20.4k|GBool DCTStream::readQuantTables() {
 4130|  20.4k|  int length, prec, i, index;
 4131|       |
 4132|  20.4k|  length = read16() - 2;
 4133|  57.9k|  while (length > 0) {
  ------------------
  |  Branch (4133:10): [True: 38.1k, False: 19.8k]
  ------------------
 4134|  38.1k|    index = str->getChar();
 4135|  38.1k|    prec = (index >> 4) & 0x0f;
 4136|  38.1k|    index &= 0x0f;
 4137|  38.1k|    if (prec > 1 || index >= 4) {
  ------------------
  |  Branch (4137:9): [True: 532, False: 37.6k]
  |  Branch (4137:21): [True: 143, False: 37.4k]
  ------------------
 4138|    675|      error(errSyntaxError, getPos(), "Bad DCT quantization table");
 4139|    675|      return gFalse;
  ------------------
  |  |   18|    675|#define gFalse 0
  ------------------
 4140|    675|    }
 4141|  37.4k|    if (index >= numQuantTables) {
  ------------------
  |  Branch (4141:9): [True: 34.0k, False: 3.41k]
  ------------------
 4142|  34.0k|      numQuantTables = index + 1;
 4143|  34.0k|    }
 4144|  2.43M|    for (i = 0; i < 64; ++i) {
  ------------------
  |  Branch (4144:17): [True: 2.39M, False: 37.4k]
  ------------------
 4145|  2.39M|      if (prec) {
  ------------------
  |  Branch (4145:11): [True: 34.1k, False: 2.36M]
  ------------------
 4146|  34.1k|	quantTables[index][dctZigZag[i]] = (Gushort)read16();
 4147|  2.36M|      } else {
 4148|  2.36M|	quantTables[index][dctZigZag[i]] = (Gushort)str->getChar();
 4149|  2.36M|      }
 4150|  2.39M|    }
 4151|  37.4k|    if (prec) {
  ------------------
  |  Branch (4151:9): [True: 534, False: 36.9k]
  ------------------
 4152|    534|      length -= 129;
 4153|  36.9k|    } else {
 4154|  36.9k|      length -= 65;
 4155|  36.9k|    }
 4156|  37.4k|  }
 4157|  19.8k|  return gTrue;
  ------------------
  |  |   17|  19.8k|#define gTrue 1
  ------------------
 4158|  20.4k|}
_ZN9DCTStream17readHuffmanTablesEv:
 4160|  14.9k|GBool DCTStream::readHuffmanTables() {
 4161|  14.9k|  DCTHuffTable *tbl;
 4162|  14.9k|  int length;
 4163|  14.9k|  int index;
 4164|  14.9k|  Gushort code;
 4165|  14.9k|  Guchar sym;
 4166|  14.9k|  int i;
 4167|  14.9k|  int c;
 4168|       |
 4169|  14.9k|  length = read16() - 2;
 4170|  72.2k|  while (length > 0) {
  ------------------
  |  Branch (4170:10): [True: 57.8k, False: 14.4k]
  ------------------
 4171|  57.8k|    index = str->getChar();
 4172|  57.8k|    --length;
 4173|  57.8k|    if ((index & 0x0f) >= 4) {
  ------------------
  |  Branch (4173:9): [True: 527, False: 57.2k]
  ------------------
 4174|    527|      error(errSyntaxError, getPos(), "Bad DCT Huffman table");
 4175|    527|      return gFalse;
  ------------------
  |  |   18|    527|#define gFalse 0
  ------------------
 4176|    527|    }
 4177|  57.2k|    if (index & 0x10) {
  ------------------
  |  Branch (4177:9): [True: 25.7k, False: 31.5k]
  ------------------
 4178|  25.7k|      index &= 0x0f;
 4179|  25.7k|      if (index >= numACHuffTables)
  ------------------
  |  Branch (4179:11): [True: 23.6k, False: 2.06k]
  ------------------
 4180|  23.6k|	numACHuffTables = index+1;
 4181|  25.7k|      tbl = &acHuffTables[index];
 4182|  31.5k|    } else {
 4183|  31.5k|      index &= 0x0f;
 4184|  31.5k|      if (index >= numDCHuffTables)
  ------------------
  |  Branch (4184:11): [True: 26.6k, False: 4.92k]
  ------------------
 4185|  26.6k|	numDCHuffTables = index+1;
 4186|  31.5k|      tbl = &dcHuffTables[index];
 4187|  31.5k|    }
 4188|  57.2k|    sym = 0;
 4189|  57.2k|    code = 0;
 4190|   973k|    for (i = 1; i <= 16; ++i) {
  ------------------
  |  Branch (4190:17): [True: 916k, False: 57.2k]
  ------------------
 4191|   916k|      c = str->getChar();
 4192|   916k|      tbl->firstSym[i] = sym;
 4193|   916k|      tbl->firstCode[i] = code;
 4194|   916k|      tbl->numCodes[i] = (Gushort)c;
 4195|   916k|      sym = (Guchar)(sym + c);
 4196|   916k|      code = (Gushort)((code + c) << 1);
 4197|   916k|    }
 4198|  57.2k|    length -= 16;
 4199|  4.25M|    for (i = 0; i < sym; ++i)
  ------------------
  |  Branch (4199:17): [True: 4.19M, False: 57.2k]
  ------------------
 4200|  4.19M|      tbl->sym[i] = (Guchar)str->getChar();
 4201|  57.2k|    length -= sym;
 4202|  57.2k|  }
 4203|  14.4k|  return gTrue;
  ------------------
  |  |   17|  14.4k|#define gTrue 1
  ------------------
 4204|  14.9k|}
_ZN9DCTStream19readRestartIntervalEv:
 4206|  4.52k|GBool DCTStream::readRestartInterval() {
 4207|  4.52k|  int length;
 4208|       |
 4209|  4.52k|  length = read16();
 4210|  4.52k|  if (length != 4) {
  ------------------
  |  Branch (4210:7): [True: 732, False: 3.79k]
  ------------------
 4211|    732|    error(errSyntaxError, getPos(), "Bad DCT restart interval");
 4212|    732|    return gFalse;
  ------------------
  |  |   18|    732|#define gFalse 0
  ------------------
 4213|    732|  }
 4214|  3.79k|  restartInterval = read16();
 4215|  3.79k|  return gTrue;
  ------------------
  |  |   17|  3.79k|#define gTrue 1
  ------------------
 4216|  4.52k|}
_ZN9DCTStream14readJFIFMarkerEv:
 4218|  15.5k|GBool DCTStream::readJFIFMarker() {
 4219|  15.5k|  int length, i;
 4220|  15.5k|  char buf[5];
 4221|  15.5k|  int c;
 4222|       |
 4223|  15.5k|  length = read16();
 4224|  15.5k|  length -= 2;
 4225|  15.5k|  if (length >= 5) {
  ------------------
  |  Branch (4225:7): [True: 14.9k, False: 583]
  ------------------
 4226|  88.5k|    for (i = 0; i < 5; ++i) {
  ------------------
  |  Branch (4226:17): [True: 73.8k, False: 14.7k]
  ------------------
 4227|  73.8k|      if ((c = str->getChar()) == EOF) {
  ------------------
  |  Branch (4227:11): [True: 246, False: 73.5k]
  ------------------
 4228|    246|	error(errSyntaxError, getPos(), "Bad DCT APP0 marker");
 4229|    246|	return gFalse;
  ------------------
  |  |   18|    246|#define gFalse 0
  ------------------
 4230|    246|      }
 4231|  73.5k|      buf[i] = (char)c;
 4232|  73.5k|    }
 4233|  14.7k|    length -= 5;
 4234|  14.7k|    if (!memcmp(buf, "JFIF\0", 5)) {
  ------------------
  |  Branch (4234:9): [True: 8.91k, False: 5.79k]
  ------------------
 4235|  8.91k|      gotJFIFMarker = gTrue;
  ------------------
  |  |   17|  8.91k|#define gTrue 1
  ------------------
 4236|  8.91k|    }
 4237|  14.7k|  }
 4238|  1.94M|  while (length > 0) {
  ------------------
  |  Branch (4238:10): [True: 1.92M, False: 15.1k]
  ------------------
 4239|  1.92M|    if (str->getChar() == EOF) {
  ------------------
  |  Branch (4239:9): [True: 157, False: 1.92M]
  ------------------
 4240|    157|      error(errSyntaxError, getPos(), "Bad DCT APP0 marker");
 4241|    157|      return gFalse;
  ------------------
  |  |   18|    157|#define gFalse 0
  ------------------
 4242|    157|    }
 4243|  1.92M|    --length;
 4244|  1.92M|  }
 4245|  15.1k|  return gTrue;
  ------------------
  |  |   17|  15.1k|#define gTrue 1
  ------------------
 4246|  15.2k|}
_ZN9DCTStream15readAdobeMarkerEv:
 4248|  18.8k|GBool DCTStream::readAdobeMarker() {
 4249|  18.8k|  int length, i;
 4250|  18.8k|  char buf[12];
 4251|  18.8k|  int c;
 4252|       |
 4253|  18.8k|  length = read16();
 4254|  18.8k|  if (length < 14) {
  ------------------
  |  Branch (4254:7): [True: 602, False: 18.2k]
  ------------------
 4255|    602|    goto err;
 4256|    602|  }
 4257|   234k|  for (i = 0; i < 12; ++i) {
  ------------------
  |  Branch (4257:15): [True: 216k, False: 17.9k]
  ------------------
 4258|   216k|    if ((c = str->getChar()) == EOF) {
  ------------------
  |  Branch (4258:9): [True: 341, False: 216k]
  ------------------
 4259|    341|      goto err;
 4260|    341|    }
 4261|   216k|    buf[i] = (char)c;
 4262|   216k|  }
 4263|  17.9k|  if (!strncmp(buf, "Adobe", 5)) {
  ------------------
  |  Branch (4263:7): [True: 5.32k, False: 12.6k]
  ------------------
 4264|  5.32k|    colorXform = buf[11];
 4265|  5.32k|    gotAdobeMarker = gTrue;
  ------------------
  |  |   17|  5.32k|#define gTrue 1
  ------------------
 4266|  5.32k|  }
 4267|   331k|  for (i = 14; i < length; ++i) {
  ------------------
  |  Branch (4267:16): [True: 313k, False: 17.7k]
  ------------------
 4268|   313k|    if (str->getChar() == EOF) {
  ------------------
  |  Branch (4268:9): [True: 240, False: 313k]
  ------------------
 4269|    240|      goto err;
 4270|    240|    }
 4271|   313k|  }
 4272|  17.7k|  return gTrue;
  ------------------
  |  |   17|  17.7k|#define gTrue 1
  ------------------
 4273|       |
 4274|  1.18k| err:
 4275|  1.18k|  error(errSyntaxError, getPos(), "Bad DCT Adobe APP14 marker");
 4276|  1.18k|  return gFalse;
  ------------------
  |  |   18|  1.18k|#define gFalse 0
  ------------------
 4277|  17.9k|}
_ZN9DCTStream10readMarkerEv:
 4290|   173k|int DCTStream::readMarker() {
 4291|   173k|  int c;
 4292|       |
 4293|   193k|  do {
 4294|  26.1M|    do {
 4295|  26.1M|      c = str->getChar();
 4296|  26.1M|    } while (c != 0xff && c != EOF);
  ------------------
  |  Branch (4296:14): [True: 25.9M, False: 188k]
  |  Branch (4296:27): [True: 25.9M, False: 5.49k]
  ------------------
 4297|   233k|    do {
 4298|   233k|      c = str->getChar();
 4299|   233k|    } while (c == 0xff);
  ------------------
  |  Branch (4299:14): [True: 39.7k, False: 193k]
  ------------------
 4300|   193k|  } while (c == 0x00);
  ------------------
  |  Branch (4300:12): [True: 19.9k, False: 173k]
  ------------------
 4301|   173k|  return c;
 4302|   173k|}
_ZN9DCTStream6read16Ev:
 4304|   222k|int DCTStream::read16() {
 4305|   222k|  int c1, c2;
 4306|       |
 4307|   222k|  if ((c1 = str->getChar()) == EOF)
  ------------------
  |  Branch (4307:7): [True: 7.54k, False: 215k]
  ------------------
 4308|  7.54k|    return EOF;
 4309|   215k|  if ((c2 = str->getChar()) == EOF)
  ------------------
  |  Branch (4309:7): [True: 2.46k, False: 212k]
  ------------------
 4310|  2.46k|    return EOF;
 4311|   212k|  return (c1 << 8) + c2;
 4312|   215k|}
_ZN11FlateStreamC2EP6Streamiiii:
 4974|   139k|    FilterStream(strA) {
 4975|   139k|  if (predictor != 1) {
  ------------------
  |  Branch (4975:7): [True: 7.10k, False: 132k]
  ------------------
 4976|  7.10k|    pred = new StreamPredictor(this, predictor, columns, colors, bits);
 4977|  7.10k|    if (!pred->isOk()) {
  ------------------
  |  Branch (4977:9): [True: 1.43k, False: 5.67k]
  ------------------
 4978|  1.43k|      delete pred;
 4979|  1.43k|      pred = NULL;
 4980|  1.43k|    }
 4981|   132k|  } else {
 4982|   132k|    pred = NULL;
 4983|   132k|  }
 4984|   139k|  litCodeTab.codes = NULL;
 4985|   139k|  distCodeTab.codes = NULL;
 4986|   139k|  memset(buf, 0, flateWindow);
  ------------------
  |  |  779|   139k|#define flateWindow          32768    // buffer size
  ------------------
 4987|   139k|  checkForDecompressionBombs = gTrue;
  ------------------
  |  |   17|   139k|#define gTrue 1
  ------------------
 4988|   139k|}
_ZN11FlateStreamD2Ev:
 4990|   126k|FlateStream::~FlateStream() {
 4991|   126k|  if (litCodeTab.codes != fixedLitCodeTab.codes) {
  ------------------
  |  Branch (4991:7): [True: 120k, False: 6.11k]
  ------------------
 4992|   120k|    gfree(litCodeTab.codes);
 4993|   120k|  }
 4994|   126k|  if (distCodeTab.codes != fixedDistCodeTab.codes) {
  ------------------
  |  Branch (4994:7): [True: 120k, False: 6.11k]
  ------------------
 4995|   120k|    gfree(distCodeTab.codes);
 4996|   120k|  }
 4997|   126k|  if (pred) {
  ------------------
  |  Branch (4997:7): [True: 5.24k, False: 121k]
  ------------------
 4998|  5.24k|    delete pred;
 4999|  5.24k|  }
 5000|   126k|  delete str;
 5001|   126k|}
_ZN11FlateStream4copyEv:
 5003|  98.3k|Stream *FlateStream::copy() {
 5004|  98.3k|  if (pred) {
  ------------------
  |  Branch (5004:7): [True: 4.27k, False: 94.0k]
  ------------------
 5005|  4.27k|    return new FlateStream(str->copy(), pred->getPredictor(),
 5006|  4.27k|			   pred->getWidth(), pred->getNComps(),
 5007|  4.27k|			   pred->getNBits());
 5008|  94.0k|  } else {
 5009|  94.0k|    return new FlateStream(str->copy(), 1, 0, 0, 0);
 5010|  94.0k|  }
 5011|  98.3k|}
_ZN11FlateStream5resetEv:
 5018|  40.7k|void FlateStream::reset() {
 5019|  40.7k|  int cmf, flg;
 5020|       |
 5021|  40.7k|  index = 0;
 5022|  40.7k|  remain = 0;
 5023|  40.7k|  codeBuf = 0;
 5024|  40.7k|  codeSize = 0;
 5025|  40.7k|  compressedBlock = gFalse;
  ------------------
  |  |   18|  40.7k|#define gFalse 0
  ------------------
 5026|  40.7k|  endOfBlock = gTrue;
  ------------------
  |  |   17|  40.7k|#define gTrue 1
  ------------------
 5027|  40.7k|  eof = gTrue;
  ------------------
  |  |   17|  40.7k|#define gTrue 1
  ------------------
 5028|       |
 5029|  40.7k|  str->reset();
 5030|  40.7k|  if (pred) {
  ------------------
  |  Branch (5030:7): [True: 1.20k, False: 39.5k]
  ------------------
 5031|  1.20k|    pred->reset();
 5032|  1.20k|  }
 5033|       |
 5034|       |  // read header
 5035|       |  //~ need to look at window size?
 5036|  40.7k|  endOfBlock = eof = gTrue;
  ------------------
  |  |   17|  40.7k|#define gTrue 1
  ------------------
 5037|  40.7k|  cmf = str->getChar();
 5038|  40.7k|  flg = str->getChar();
 5039|  40.7k|  totalIn = 2;
 5040|  40.7k|  totalOut = 0;
 5041|  40.7k|  if (cmf == EOF || flg == EOF)
  ------------------
  |  Branch (5041:7): [True: 288, False: 40.4k]
  |  Branch (5041:21): [True: 5, False: 40.4k]
  ------------------
 5042|    293|    return;
 5043|  40.4k|  if ((cmf & 0x0f) != 0x08) {
  ------------------
  |  Branch (5043:7): [True: 744, False: 39.7k]
  ------------------
 5044|    744|    error(errSyntaxError, getPos(),
 5045|    744|	  "Unknown compression method in flate stream");
 5046|    744|    return;
 5047|    744|  }
 5048|  39.7k|  if ((((cmf << 8) + flg) % 31) != 0) {
  ------------------
  |  Branch (5048:7): [True: 722, False: 38.9k]
  ------------------
 5049|    722|    error(errSyntaxError, getPos(), "Bad FCHECK in flate stream");
 5050|    722|    return;
 5051|    722|  }
 5052|  38.9k|  if (flg & 0x20) {
  ------------------
  |  Branch (5052:7): [True: 3.99k, False: 34.9k]
  ------------------
 5053|  3.99k|    error(errSyntaxError, getPos(), "FDICT bit set in flate stream");
 5054|  3.99k|    return;
 5055|  3.99k|  }
 5056|       |
 5057|  34.9k|  eof = gFalse;
  ------------------
  |  |   18|  34.9k|#define gFalse 0
  ------------------
 5058|  34.9k|}
_ZN11FlateStream7getCharEv:
 5060|  73.1M|int FlateStream::getChar() {
 5061|  73.1M|  int c;
 5062|       |
 5063|  73.1M|  if (pred) {
  ------------------
  |  Branch (5063:7): [True: 120k, False: 73.0M]
  ------------------
 5064|   120k|    return pred->getChar();
 5065|   120k|  }
 5066|  75.3M|  while (remain == 0) {
  ------------------
  |  Branch (5066:10): [True: 2.39M, False: 72.9M]
  ------------------
 5067|  2.39M|    if (endOfBlock && eof)
  ------------------
  |  Branch (5067:9): [True: 50.0k, False: 2.34M]
  |  Branch (5067:23): [True: 23.0k, False: 26.9k]
  ------------------
 5068|  23.0k|      return EOF;
 5069|  2.36M|    readSome();
 5070|  2.36M|  }
 5071|  72.9M|  c = buf[index];
 5072|  72.9M|  index = (index + 1) & flateMask;
  ------------------
  |  |  780|  72.9M|#define flateMask            (flateWindow-1)
  |  |  ------------------
  |  |  |  |  779|  72.9M|#define flateWindow          32768    // buffer size
  |  |  ------------------
  ------------------
 5073|  72.9M|  --remain;
 5074|  72.9M|  return c;
 5075|  73.0M|}
_ZN11FlateStream8lookCharEv:
 5077|  4.33M|int FlateStream::lookChar() {
 5078|  4.33M|  int c;
 5079|       |
 5080|  4.33M|  if (pred) {
  ------------------
  |  Branch (5080:7): [True: 39.1k, False: 4.29M]
  ------------------
 5081|  39.1k|    return pred->lookChar();
 5082|  39.1k|  }
 5083|  5.95M|  while (remain == 0) {
  ------------------
  |  Branch (5083:10): [True: 1.66M, False: 4.29M]
  ------------------
 5084|  1.66M|    if (endOfBlock && eof)
  ------------------
  |  Branch (5084:9): [True: 10.4k, False: 1.65M]
  |  Branch (5084:23): [True: 4.74k, False: 5.73k]
  ------------------
 5085|  4.74k|      return EOF;
 5086|  1.65M|    readSome();
 5087|  1.65M|  }
 5088|  4.29M|  c = buf[index];
 5089|  4.29M|  return c;
 5090|  4.29M|}
_ZN11FlateStream10getRawCharEv:
 5092|  9.13M|int FlateStream::getRawChar() {
 5093|  9.13M|  int c;
 5094|       |
 5095|  9.45M|  while (remain == 0) {
  ------------------
  |  Branch (5095:10): [True: 314k, False: 9.13M]
  ------------------
 5096|   314k|    if (endOfBlock && eof)
  ------------------
  |  Branch (5096:9): [True: 2.17k, False: 312k]
  |  Branch (5096:23): [True: 1.26k, False: 913]
  ------------------
 5097|  1.26k|      return EOF;
 5098|   313k|    readSome();
 5099|   313k|  }
 5100|  9.13M|  c = buf[index];
 5101|  9.13M|  index = (index + 1) & flateMask;
  ------------------
  |  |  780|  9.13M|#define flateMask            (flateWindow-1)
  |  |  ------------------
  |  |  |  |  779|  9.13M|#define flateWindow          32768    // buffer size
  |  |  ------------------
  ------------------
 5102|  9.13M|  --remain;
 5103|  9.13M|  return c;
 5104|  9.13M|}
_ZN11FlateStream8getBlockEPci:
 5106|  23.6k|int FlateStream::getBlock(char *blk, int size) {
 5107|  23.6k|  int n, k;
 5108|       |
 5109|  23.6k|  if (pred) {
  ------------------
  |  Branch (5109:7): [True: 1.89k, False: 21.7k]
  ------------------
 5110|  1.89k|    return pred->getBlock(blk, size);
 5111|  1.89k|  }
 5112|       |
 5113|  21.7k|  n = 0;
 5114|  2.78M|  while (n < size) {
  ------------------
  |  Branch (5114:10): [True: 2.76M, False: 14.6k]
  ------------------
 5115|  2.76M|    if (remain == 0) {
  ------------------
  |  Branch (5115:9): [True: 2.75M, False: 14.3k]
  ------------------
 5116|  2.75M|      if (endOfBlock && eof) {
  ------------------
  |  Branch (5116:11): [True: 13.6k, False: 2.74M]
  |  Branch (5116:25): [True: 7.02k, False: 6.64k]
  ------------------
 5117|  7.02k|	break;
 5118|  7.02k|      }
 5119|  2.74M|      readSome();
 5120|  2.74M|    }
 5121|  2.76M|    k = remain;
 5122|  2.76M|    if (size - n < k) {
  ------------------
  |  Branch (5122:9): [True: 14.0k, False: 2.74M]
  ------------------
 5123|  14.0k|      k = size - n;
 5124|  14.0k|    }
 5125|  2.76M|    if (flateWindow - index < k) {
  ------------------
  |  |  779|  2.76M|#define flateWindow          32768    // buffer size
  ------------------
  |  Branch (5125:9): [True: 0, False: 2.76M]
  ------------------
 5126|      0|      k = flateWindow - index;
  ------------------
  |  |  779|      0|#define flateWindow          32768    // buffer size
  ------------------
 5127|      0|    }
 5128|  2.76M|    memcpy(blk + n, buf + index, k);
 5129|  2.76M|    n += k;
 5130|  2.76M|    index = (index + k) & flateMask;
  ------------------
  |  |  780|  2.76M|#define flateMask            (flateWindow-1)
  |  |  ------------------
  |  |  |  |  779|  2.76M|#define flateWindow          32768    // buffer size
  |  |  ------------------
  ------------------
 5131|  2.76M|    remain -= k;
 5132|  2.76M|  }
 5133|  21.7k|  return n;
 5134|  23.6k|}
_ZN11FlateStream8readSomeEv:
 5154|  7.08M|void FlateStream::readSome() {
 5155|  7.08M|  int code1, code2;
 5156|  7.08M|  int len, dist;
 5157|  7.08M|  int src, dest, n1, n2, n3, i, j, k;
 5158|  7.08M|  int c;
 5159|       |
 5160|  7.08M|  if (endOfBlock) {
  ------------------
  |  Branch (5160:7): [True: 40.2k, False: 7.04M]
  ------------------
 5161|  40.2k|    if (!startBlock())
  ------------------
  |  Branch (5161:9): [True: 6.75k, False: 33.4k]
  ------------------
 5162|  6.75k|      return;
 5163|  40.2k|  }
 5164|       |
 5165|  7.07M|  if (compressedBlock) {
  ------------------
  |  Branch (5165:7): [True: 7.07M, False: 3.27k]
  ------------------
 5166|  7.07M|    if ((code1 = getHuffmanCodeWord(&litCodeTab)) == EOF)
  ------------------
  |  Branch (5166:9): [True: 5.68k, False: 7.07M]
  ------------------
 5167|  5.68k|      goto err;
 5168|  7.07M|    if (code1 < 256) {
  ------------------
  |  Branch (5168:9): [True: 5.02M, False: 2.05M]
  ------------------
 5169|  5.02M|      buf[index] = (Guchar)code1;
 5170|  5.02M|      remain = 1;
 5171|  5.02M|    } else if (code1 == 256) {
  ------------------
  |  Branch (5171:16): [True: 13.2k, False: 2.03M]
  ------------------
 5172|  13.2k|      endOfBlock = gTrue;
  ------------------
  |  |   17|  13.2k|#define gTrue 1
  ------------------
 5173|  13.2k|      remain = 0;
 5174|  2.03M|    } else {
 5175|  2.03M|      code1 -= 257;
 5176|  2.03M|      code2 = lengthDecode[code1].bits;
 5177|  2.03M|      if (code2 > 0 && (code2 = getCodeWord(code2)) == EOF)
  ------------------
  |  Branch (5177:11): [True: 669k, False: 1.36M]
  |  Branch (5177:24): [True: 244, False: 669k]
  ------------------
 5178|    244|	goto err;
 5179|  2.03M|      len = lengthDecode[code1].first + code2;
 5180|  2.03M|      if ((code1 = getHuffmanCodeWord(&distCodeTab)) == EOF)
  ------------------
  |  Branch (5180:11): [True: 2.10k, False: 2.03M]
  ------------------
 5181|  2.10k|	goto err;
 5182|  2.03M|      code2 = distDecode[code1].bits;
 5183|  2.03M|      if (code2 > 0 && (code2 = getCodeWord(code2)) == EOF)
  ------------------
  |  Branch (5183:11): [True: 1.79M, False: 239k]
  |  Branch (5183:24): [True: 610, False: 1.79M]
  ------------------
 5184|    610|	goto err;
 5185|  2.03M|      dist = distDecode[code1].first + code2;
 5186|  2.03M|      dest = index;
 5187|  2.03M|      src = (index - dist) & flateMask;
  ------------------
  |  |  780|  2.03M|#define flateMask            (flateWindow-1)
  |  |  ------------------
  |  |  |  |  779|  2.03M|#define flateWindow          32768    // buffer size
  |  |  ------------------
  ------------------
 5188|       |      // the following is an optimized version of:
 5189|       |      // for (k = 0; k < len; ++k) {
 5190|       |      //   buf[dest] = buf[src];
 5191|       |      //   dest = (dest + 1) & flateMask;
 5192|       |      //   src = (src + 1) & flateMask;
 5193|       |      // }
 5194|  2.03M|      if (dest + len <= flateWindow) {
  ------------------
  |  |  779|  2.03M|#define flateWindow          32768    // buffer size
  ------------------
  |  Branch (5194:11): [True: 2.03M, False: 3.25k]
  ------------------
 5195|  2.03M|	if (src + len <= flateWindow) {
  ------------------
  |  |  779|  2.03M|#define flateWindow          32768    // buffer size
  ------------------
  |  Branch (5195:6): [True: 2.02M, False: 4.10k]
  ------------------
 5196|   139M|	  for (k = 0; k < len; ++k) {
  ------------------
  |  Branch (5196:16): [True: 137M, False: 2.02M]
  ------------------
 5197|   137M|	    buf[dest + k] = buf[src + k];
 5198|   137M|	  }
 5199|  2.02M|	} else {
 5200|  4.10k|	  n1 = flateWindow - src;
  ------------------
  |  |  779|  4.10k|#define flateWindow          32768    // buffer size
  ------------------
 5201|  4.10k|	  n2 = len - n1;
 5202|   215k|	  for (k = 0; k < n1; ++k) {
  ------------------
  |  Branch (5202:16): [True: 211k, False: 4.10k]
  ------------------
 5203|   211k|	    buf[dest + k] = buf[src + k];
 5204|   211k|	  }
 5205|  4.10k|	  dest = dest + n1;
 5206|  4.10k|	  src = 0;
 5207|   366k|	  for (k = 0; k < n2; ++k) {
  ------------------
  |  Branch (5207:16): [True: 362k, False: 4.10k]
  ------------------
 5208|   362k|	    buf[dest + k] = buf[src + k];
 5209|   362k|	  }
 5210|  4.10k|	}
 5211|  2.03M|      } else {
 5212|  3.25k|	if (src + len <= flateWindow) {
  ------------------
  |  |  779|  3.25k|#define flateWindow          32768    // buffer size
  ------------------
  |  Branch (5212:6): [True: 1.32k, False: 1.93k]
  ------------------
 5213|  1.32k|	  n1 = flateWindow - dest;
  ------------------
  |  |  779|  1.32k|#define flateWindow          32768    // buffer size
  ------------------
 5214|  1.32k|	  n2 = len - n1;
 5215|   126k|	  for (k = 0; k < n1; ++k) {
  ------------------
  |  Branch (5215:16): [True: 124k, False: 1.32k]
  ------------------
 5216|   124k|	    buf[dest + k] = buf[src + k];
 5217|   124k|	  }
 5218|  1.32k|	  dest = 0;
 5219|  1.32k|	  src = src + n1;
 5220|   133k|	  for (k = 0; k < n2; ++k) {
  ------------------
  |  Branch (5220:16): [True: 132k, False: 1.32k]
  ------------------
 5221|   132k|	    buf[dest + k] = buf[src + k];
 5222|   132k|	  }
 5223|  1.93k|	} else if (src < dest) {
  ------------------
  |  Branch (5223:13): [True: 1.50k, False: 430]
  ------------------
 5224|  1.50k|	  n1 = flateWindow - dest;
  ------------------
  |  |  779|  1.50k|#define flateWindow          32768    // buffer size
  ------------------
 5225|  1.50k|	  n2 = dest - src;
 5226|  1.50k|	  n3 = len - n1 - n2;
 5227|   139k|	  for (k = 0; k < n1; ++k) {
  ------------------
  |  Branch (5227:16): [True: 137k, False: 1.50k]
  ------------------
 5228|   137k|	    buf[dest + k] = buf[src + k];
 5229|   137k|	  }
 5230|  1.50k|	  dest = 0;
 5231|  1.50k|	  src = src + n1;
 5232|  11.1k|	  for (k = 0; k < n2; ++k) {
  ------------------
  |  Branch (5232:16): [True: 9.67k, False: 1.50k]
  ------------------
 5233|  9.67k|	    buf[dest + k] = buf[src + k];
 5234|  9.67k|	  }
 5235|  1.50k|	  dest = n2;
 5236|  1.50k|	  src = 0;
 5237|   193k|	  for (k = 0; k < n3; ++k) {
  ------------------
  |  Branch (5237:16): [True: 191k, False: 1.50k]
  ------------------
 5238|   191k|	    buf[dest + k] = buf[src + k];
 5239|   191k|	  }
 5240|  1.50k|	} else {
 5241|    430|	  n1 = flateWindow - src;
  ------------------
  |  |  779|    430|#define flateWindow          32768    // buffer size
  ------------------
 5242|    430|	  n2 = src - dest;
 5243|    430|	  n3 = len - n1 - n2;
 5244|  69.3k|	  for (k = 0; k < n1; ++k) {
  ------------------
  |  Branch (5244:16): [True: 68.9k, False: 430]
  ------------------
 5245|  68.9k|	    buf[dest + k] = buf[src + k];
 5246|  68.9k|	  }
 5247|    430|	  dest = dest + n1;
 5248|    430|	  src = 0;
 5249|  2.58k|	  for (k = 0; k < n2; ++k) {
  ------------------
  |  Branch (5249:16): [True: 2.15k, False: 430]
  ------------------
 5250|  2.15k|	    buf[dest + k] = buf[src + k];
 5251|  2.15k|	  }
 5252|    430|	  dest = 0;
 5253|    430|	  src = n2;
 5254|  40.2k|	  for (k = 0; k < n3; ++k) {
  ------------------
  |  Branch (5254:16): [True: 39.8k, False: 430]
  ------------------
 5255|  39.8k|	    buf[dest + k] = buf[src + k];
 5256|  39.8k|	  }
 5257|    430|	}
 5258|  3.25k|      }
 5259|  2.03M|      remain = len;
 5260|  2.03M|    }
 5261|       |
 5262|  7.07M|  } else {
 5263|  3.27k|    len = (blockLen < flateWindow) ? blockLen : flateWindow;
  ------------------
  |  |  779|  3.27k|#define flateWindow          32768    // buffer size
  ------------------
                  len = (blockLen < flateWindow) ? blockLen : flateWindow;
  ------------------
  |  |  779|  3.41k|#define flateWindow          32768    // buffer size
  ------------------
  |  Branch (5263:11): [True: 3.12k, False: 144]
  ------------------
 5264|   826k|    for (i = 0, j = index; i < len; ++i, j = (j + 1) & flateMask) {
  ------------------
  |  |  780|   823k|#define flateMask            (flateWindow-1)
  |  |  ------------------
  |  |  |  |  779|   823k|#define flateWindow          32768    // buffer size
  |  |  ------------------
  ------------------
  |  Branch (5264:28): [True: 823k, False: 3.12k]
  ------------------
 5265|   823k|      if ((c = str->getChar()) == EOF) {
  ------------------
  |  Branch (5265:11): [True: 144, False: 823k]
  ------------------
 5266|    144|	endOfBlock = eof = gTrue;
  ------------------
  |  |   17|    144|#define gTrue 1
  ------------------
 5267|    144|	break;
 5268|    144|      }
 5269|   823k|      buf[j] = (Guchar)c;
 5270|   823k|    }
 5271|  3.27k|    remain = i;
 5272|  3.27k|    blockLen -= len;
 5273|  3.27k|    if (blockLen == 0)
  ------------------
  |  Branch (5273:9): [True: 3.12k, False: 144]
  ------------------
 5274|  3.12k|      endOfBlock = gTrue;
  ------------------
  |  |   17|  3.12k|#define gTrue 1
  ------------------
 5275|  3.27k|    totalIn += remain;
 5276|  3.27k|  }
 5277|  7.07M|  totalOut += remain;
 5278|       |
 5279|       |  // check for a 'decompression bomb'
 5280|  7.07M|  if (checkForDecompressionBombs &&
  ------------------
  |  Branch (5280:7): [True: 7.07M, False: 0]
  ------------------
 5281|  7.07M|      totalOut > decompressionBombSizeThreshold &&
  ------------------
  |  |   55|  14.1M|#define decompressionBombSizeThreshold 50000000
  ------------------
  |  Branch (5281:7): [True: 0, False: 7.07M]
  ------------------
 5282|      0|      totalIn < totalOut / decompressionBombRatioThreshold) {
  ------------------
  |  |   56|      0|#define decompressionBombRatioThreshold 200
  ------------------
  |  Branch (5282:7): [True: 0, False: 0]
  ------------------
 5283|      0|    error(errSyntaxError, getPos(), "Decompression bomb in flate stream");
 5284|      0|    endOfBlock = eof = gTrue;
  ------------------
  |  |   17|      0|#define gTrue 1
  ------------------
 5285|      0|    remain = 0;
 5286|      0|  }
 5287|       |
 5288|  7.07M|  return;
 5289|       |
 5290|  8.64k|err:
 5291|  8.64k|  error(errSyntaxError, getPos(), "Unexpected end of file in flate stream");
 5292|  8.64k|  endOfBlock = eof = gTrue;
  ------------------
  |  |   17|  8.64k|#define gTrue 1
  ------------------
 5293|  8.64k|  remain = 0;
 5294|  8.64k|}
_ZN11FlateStream10startBlockEv:
 5296|  40.2k|GBool FlateStream::startBlock() {
 5297|  40.2k|  int blockHdr;
 5298|  40.2k|  int c;
 5299|  40.2k|  int check;
 5300|       |
 5301|       |  // free the code tables from the previous block
 5302|  40.2k|  if (litCodeTab.codes != fixedLitCodeTab.codes) {
  ------------------
  |  Branch (5302:7): [True: 34.3k, False: 5.90k]
  ------------------
 5303|  34.3k|    gfree(litCodeTab.codes);
 5304|  34.3k|  }
 5305|  40.2k|  litCodeTab.codes = NULL;
 5306|  40.2k|  if (distCodeTab.codes != fixedDistCodeTab.codes) {
  ------------------
  |  Branch (5306:7): [True: 34.3k, False: 5.90k]
  ------------------
 5307|  34.3k|    gfree(distCodeTab.codes);
 5308|  34.3k|  }
 5309|  40.2k|  distCodeTab.codes = NULL;
 5310|       |
 5311|       |  // read block header
 5312|  40.2k|  blockHdr = getCodeWord(3);
 5313|  40.2k|  if (blockHdr & 1)
  ------------------
  |  Branch (5313:7): [True: 4.21k, False: 36.0k]
  ------------------
 5314|  4.21k|    eof = gTrue;
  ------------------
  |  |   17|  4.21k|#define gTrue 1
  ------------------
 5315|  40.2k|  blockHdr >>= 1;
 5316|       |
 5317|       |  // uncompressed block
 5318|  40.2k|  if (blockHdr == 0) {
  ------------------
  |  Branch (5318:7): [True: 4.76k, False: 35.4k]
  ------------------
 5319|  4.76k|    compressedBlock = gFalse;
  ------------------
  |  |   18|  4.76k|#define gFalse 0
  ------------------
 5320|  4.76k|    if ((c = str->getChar()) == EOF)
  ------------------
  |  Branch (5320:9): [True: 135, False: 4.63k]
  ------------------
 5321|    135|      goto err;
 5322|  4.63k|    blockLen = c & 0xff;
 5323|  4.63k|    if ((c = str->getChar()) == EOF)
  ------------------
  |  Branch (5323:9): [True: 188, False: 4.44k]
  ------------------
 5324|    188|      goto err;
 5325|  4.44k|    blockLen |= (c & 0xff) << 8;
 5326|  4.44k|    if ((c = str->getChar()) == EOF)
  ------------------
  |  Branch (5326:9): [True: 141, False: 4.30k]
  ------------------
 5327|    141|      goto err;
 5328|  4.30k|    check = c & 0xff;
 5329|  4.30k|    if ((c = str->getChar()) == EOF)
  ------------------
  |  Branch (5329:9): [True: 199, False: 4.10k]
  ------------------
 5330|    199|      goto err;
 5331|  4.10k|    check |= (c & 0xff) << 8;
 5332|  4.10k|    if (check != (~blockLen & 0xffff))
  ------------------
  |  Branch (5332:9): [True: 833, False: 3.27k]
  ------------------
 5333|    833|      goto err;
 5334|  3.27k|    codeBuf = 0;
 5335|  3.27k|    codeSize = 0;
 5336|  3.27k|    totalIn += 4;
 5337|       |
 5338|       |  // compressed block with fixed codes
 5339|  35.4k|  } else if (blockHdr == 1) {
  ------------------
  |  Branch (5339:14): [True: 12.0k, False: 23.4k]
  ------------------
 5340|  12.0k|    compressedBlock = gTrue;
  ------------------
  |  |   17|  12.0k|#define gTrue 1
  ------------------
 5341|  12.0k|    loadFixedCodes();
 5342|       |
 5343|       |  // compressed block with dynamic codes
 5344|  23.4k|  } else if (blockHdr == 2) {
  ------------------
  |  Branch (5344:14): [True: 22.7k, False: 727]
  ------------------
 5345|  22.7k|    compressedBlock = gTrue;
  ------------------
  |  |   17|  22.7k|#define gTrue 1
  ------------------
 5346|  22.7k|    if (!readDynamicCodes()) {
  ------------------
  |  Branch (5346:9): [True: 4.53k, False: 18.1k]
  ------------------
 5347|  4.53k|      goto err;
 5348|  4.53k|    }
 5349|       |
 5350|       |  // unknown block type
 5351|  22.7k|  } else {
 5352|    727|    goto err;
 5353|    727|  }
 5354|       |
 5355|  33.4k|  endOfBlock = gFalse;
  ------------------
  |  |   18|  33.4k|#define gFalse 0
  ------------------
 5356|  33.4k|  return gTrue;
  ------------------
  |  |   17|  33.4k|#define gTrue 1
  ------------------
 5357|       |
 5358|  6.75k|err:
 5359|  6.75k|  error(errSyntaxError, getPos(), "Bad block header in flate stream");
 5360|  6.75k|  endOfBlock = eof = gTrue;
  ------------------
  |  |   17|  6.75k|#define gTrue 1
  ------------------
 5361|  6.75k|  return gFalse;
  ------------------
  |  |   18|  6.75k|#define gFalse 0
  ------------------
 5362|  40.2k|}
_ZN11FlateStream14loadFixedCodesEv:
 5364|  12.0k|void FlateStream::loadFixedCodes() {
 5365|  12.0k|  litCodeTab.codes = fixedLitCodeTab.codes;
 5366|  12.0k|  litCodeTab.maxLen = fixedLitCodeTab.maxLen;
 5367|  12.0k|  distCodeTab.codes = fixedDistCodeTab.codes;
 5368|  12.0k|  distCodeTab.maxLen = fixedDistCodeTab.maxLen;
 5369|  12.0k|}
_ZN11FlateStream16readDynamicCodesEv:
 5371|  22.7k|GBool FlateStream::readDynamicCodes() {
 5372|  22.7k|  int numCodeLenCodes;
 5373|  22.7k|  int numLitCodes;
 5374|  22.7k|  int numDistCodes;
 5375|  22.7k|  int codeLenCodeLengths[flateMaxCodeLenCodes];
 5376|  22.7k|  FlateHuffmanTab codeLenCodeTab;
 5377|  22.7k|  int len, repeat, code;
 5378|  22.7k|  int i;
 5379|       |
 5380|  22.7k|  codeLenCodeTab.codes = NULL;
 5381|       |
 5382|       |  // read lengths
 5383|  22.7k|  if ((numLitCodes = getCodeWord(5)) == EOF) {
  ------------------
  |  Branch (5383:7): [True: 14, False: 22.7k]
  ------------------
 5384|     14|    goto err;
 5385|     14|  }
 5386|  22.7k|  numLitCodes += 257;
 5387|  22.7k|  if ((numDistCodes = getCodeWord(5)) == EOF) {
  ------------------
  |  Branch (5387:7): [True: 255, False: 22.4k]
  ------------------
 5388|    255|    goto err;
 5389|    255|  }
 5390|  22.4k|  numDistCodes += 1;
 5391|  22.4k|  if ((numCodeLenCodes = getCodeWord(4)) == EOF) {
  ------------------
  |  Branch (5391:7): [True: 186, False: 22.2k]
  ------------------
 5392|    186|    goto err;
 5393|    186|  }
 5394|  22.2k|  numCodeLenCodes += 4;
 5395|  22.2k|  if (numLitCodes > flateMaxLitCodes ||
  ------------------
  |  |  783|  44.5k|#define flateMaxLitCodes       288    // max # literal codes
  ------------------
  |  Branch (5395:7): [True: 0, False: 22.2k]
  ------------------
 5396|  22.2k|      numDistCodes > flateMaxDistCodes ||
  ------------------
  |  |  784|  44.5k|#define flateMaxDistCodes       30    // max # distance codes
  ------------------
  |  Branch (5396:7): [True: 215, False: 22.0k]
  ------------------
 5397|  22.0k|      numCodeLenCodes > flateMaxCodeLenCodes) {
  ------------------
  |  |  782|  22.0k|#define flateMaxCodeLenCodes    19    // max # code length codes
  ------------------
  |  Branch (5397:7): [True: 0, False: 22.0k]
  ------------------
 5398|    215|    goto err;
 5399|    215|  }
 5400|       |
 5401|       |  // build the code length code table
 5402|   441k|  for (i = 0; i < flateMaxCodeLenCodes; ++i) {
  ------------------
  |  |  782|   441k|#define flateMaxCodeLenCodes    19    // max # code length codes
  ------------------
  |  Branch (5402:15): [True: 419k, False: 22.0k]
  ------------------
 5403|   419k|    codeLenCodeLengths[i] = 0;
 5404|   419k|  }
 5405|   329k|  for (i = 0; i < numCodeLenCodes; ++i) {
  ------------------
  |  Branch (5405:15): [True: 307k, False: 21.8k]
  ------------------
 5406|   307k|    if ((codeLenCodeLengths[codeLenCodeMap[i]] = getCodeWord(3)) == -1) {
  ------------------
  |  Branch (5406:9): [True: 190, False: 307k]
  ------------------
 5407|    190|      goto err;
 5408|    190|    }
 5409|   307k|  }
 5410|  21.8k|  compHuffmanCodes(codeLenCodeLengths, flateMaxCodeLenCodes, &codeLenCodeTab);
  ------------------
  |  |  782|  21.8k|#define flateMaxCodeLenCodes    19    // max # code length codes
  ------------------
 5411|       |
 5412|       |  // build the literal and distance code tables
 5413|  21.8k|  len = 0;
 5414|  21.8k|  repeat = 0;
 5415|  21.8k|  i = 0;
 5416|  2.70M|  while (i < numLitCodes + numDistCodes) {
  ------------------
  |  Branch (5416:10): [True: 2.68M, False: 18.1k]
  ------------------
 5417|  2.68M|    if ((code = getHuffmanCodeWord(&codeLenCodeTab)) == EOF) {
  ------------------
  |  Branch (5417:9): [True: 1.06k, False: 2.68M]
  ------------------
 5418|  1.06k|      goto err;
 5419|  1.06k|    }
 5420|  2.68M|    if (code == 16) {
  ------------------
  |  Branch (5420:9): [True: 68.1k, False: 2.61M]
  ------------------
 5421|  68.1k|      if ((repeat = getCodeWord(2)) == EOF) {
  ------------------
  |  Branch (5421:11): [True: 211, False: 67.9k]
  ------------------
 5422|    211|	goto err;
 5423|    211|      }
 5424|  67.9k|      repeat += 3;
 5425|  67.9k|      if (i + repeat > numLitCodes + numDistCodes) {
  ------------------
  |  Branch (5425:11): [True: 770, False: 67.2k]
  ------------------
 5426|    770|	goto err;
 5427|    770|      }
 5428|   357k|      for (; repeat > 0; --repeat) {
  ------------------
  |  Branch (5428:14): [True: 290k, False: 67.2k]
  ------------------
 5429|   290k|	codeLengths[i++] = len;
 5430|   290k|      }
 5431|  2.61M|    } else if (code == 17) {
  ------------------
  |  Branch (5431:16): [True: 88.6k, False: 2.52M]
  ------------------
 5432|  88.6k|      if ((repeat = getCodeWord(3)) == EOF) {
  ------------------
  |  Branch (5432:11): [True: 266, False: 88.4k]
  ------------------
 5433|    266|	goto err;
 5434|    266|      }
 5435|  88.4k|      repeat += 3;
 5436|  88.4k|      if (i + repeat > numLitCodes + numDistCodes) {
  ------------------
  |  Branch (5436:11): [True: 367, False: 88.0k]
  ------------------
 5437|    367|	goto err;
 5438|    367|      }
 5439|  88.0k|      len = 0;
 5440|   558k|      for (; repeat > 0; --repeat) {
  ------------------
  |  Branch (5440:14): [True: 470k, False: 88.0k]
  ------------------
 5441|   470k|	codeLengths[i++] = 0;
 5442|   470k|      }
 5443|  2.52M|    } else if (code == 18) {
  ------------------
  |  Branch (5443:16): [True: 44.1k, False: 2.48M]
  ------------------
 5444|  44.1k|      if ((repeat = getCodeWord(7)) == EOF) {
  ------------------
  |  Branch (5444:11): [True: 289, False: 43.8k]
  ------------------
 5445|    289|	goto err;
 5446|    289|      }
 5447|  43.8k|      repeat += 11;
 5448|  43.8k|      if (i + repeat > numLitCodes + numDistCodes) {
  ------------------
  |  Branch (5448:11): [True: 708, False: 43.1k]
  ------------------
 5449|    708|	goto err;
 5450|    708|      }
 5451|  43.1k|      len = 0;
 5452|  2.82M|      for (; repeat > 0; --repeat) {
  ------------------
  |  Branch (5452:14): [True: 2.78M, False: 43.1k]
  ------------------
 5453|  2.78M|	codeLengths[i++] = 0;
 5454|  2.78M|      }
 5455|  2.48M|    } else {
 5456|  2.48M|      codeLengths[i++] = len = code;
 5457|  2.48M|    }
 5458|  2.68M|  }
 5459|  18.1k|  compHuffmanCodes(codeLengths, numLitCodes, &litCodeTab);
 5460|  18.1k|  compHuffmanCodes(codeLengths + numLitCodes, numDistCodes, &distCodeTab);
 5461|       |
 5462|  18.1k|  gfree(codeLenCodeTab.codes);
 5463|  18.1k|  return gTrue;
  ------------------
  |  |   17|  18.1k|#define gTrue 1
  ------------------
 5464|       |
 5465|  4.53k|err:
 5466|  4.53k|  error(errSyntaxError, getPos(), "Bad dynamic code table in flate stream");
 5467|  4.53k|  gfree(codeLenCodeTab.codes);
 5468|  4.53k|  return gFalse;
  ------------------
  |  |   18|  4.53k|#define gFalse 0
  ------------------
 5469|  21.8k|}
_ZN11FlateStream16compHuffmanCodesEPiiP15FlateHuffmanTab:
 5473|  58.2k|void FlateStream::compHuffmanCodes(int *lengths, int n, FlateHuffmanTab *tab) {
 5474|  58.2k|  int tabSize, len, code, code2, skip, val, i, t;
 5475|       |
 5476|       |  // find max code length
 5477|  58.2k|  tab->maxLen = 0;
 5478|  5.95M|  for (val = 0; val < n; ++val) {
  ------------------
  |  Branch (5478:17): [True: 5.89M, False: 58.2k]
  ------------------
 5479|  5.89M|    if (lengths[val] > tab->maxLen) {
  ------------------
  |  Branch (5479:9): [True: 126k, False: 5.76M]
  ------------------
 5480|   126k|      tab->maxLen = lengths[val];
 5481|   126k|    }
 5482|  5.89M|  }
 5483|       |
 5484|       |  // allocate the table
 5485|  58.2k|  tabSize = 1 << tab->maxLen;
 5486|  58.2k|  tab->codes = (FlateCode *)gmallocn(tabSize, sizeof(FlateCode));
 5487|       |
 5488|       |  // clear the table
 5489|  80.0M|  for (i = 0; i < tabSize; ++i) {
  ------------------
  |  Branch (5489:15): [True: 80.0M, False: 58.2k]
  ------------------
 5490|  80.0M|    tab->codes[i].len = 0;
 5491|  80.0M|    tab->codes[i].val = 0;
 5492|  80.0M|  }
 5493|       |
 5494|       |  // build the table
 5495|  58.2k|  for (len = 1, code = 0, skip = 2;
 5496|   513k|       len <= tab->maxLen;
  ------------------
  |  Branch (5496:8): [True: 455k, False: 58.2k]
  ------------------
 5497|   455k|       ++len, code <<= 1, skip <<= 1) {
 5498|  57.2M|    for (val = 0; val < n; ++val) {
  ------------------
  |  Branch (5498:19): [True: 56.7M, False: 455k]
  ------------------
 5499|  56.7M|      if (lengths[val] == len) {
  ------------------
  |  Branch (5499:11): [True: 2.57M, False: 54.2M]
  ------------------
 5500|       |
 5501|       |	// bit-reverse the code
 5502|  2.57M|	code2 = 0;
 5503|  2.57M|	t = code;
 5504|  20.1M|	for (i = 0; i < len; ++i) {
  ------------------
  |  Branch (5504:14): [True: 17.5M, False: 2.57M]
  ------------------
 5505|  17.5M|	  code2 = (code2 << 1) | (t & 1);
 5506|  17.5M|	  t >>= 1;
 5507|  17.5M|	}
 5508|       |
 5509|       |	// fill in the table entries
 5510|   665M|	for (i = code2; i < tabSize; i += skip) {
  ------------------
  |  Branch (5510:18): [True: 662M, False: 2.57M]
  ------------------
 5511|   662M|	  tab->codes[i].len = (Gushort)len;
 5512|   662M|	  tab->codes[i].val = (Gushort)val;
 5513|   662M|	}
 5514|       |
 5515|  2.57M|	++code;
 5516|  2.57M|      }
 5517|  56.7M|    }
 5518|   455k|  }
 5519|  58.2k|}
_ZN11FlateStream18getHuffmanCodeWordEP15FlateHuffmanTab:
 5521|  11.7M|int FlateStream::getHuffmanCodeWord(FlateHuffmanTab *tab) {
 5522|  11.7M|  FlateCode *code;
 5523|  11.7M|  int c;
 5524|       |
 5525|  19.3M|  while (codeSize < tab->maxLen) {
  ------------------
  |  Branch (5525:10): [True: 7.57M, False: 11.7M]
  ------------------
 5526|  7.57M|    if ((c = str->getChar()) == EOF) {
  ------------------
  |  Branch (5526:9): [True: 10.7k, False: 7.56M]
  ------------------
 5527|  10.7k|      break;
 5528|  10.7k|    }
 5529|  7.56M|    codeBuf |= (c & 0xff) << codeSize;
 5530|  7.56M|    codeSize += 8;
 5531|  7.56M|    ++totalIn;
 5532|  7.56M|  }
 5533|  11.7M|  code = &tab->codes[codeBuf & ((1 << tab->maxLen) - 1)];
 5534|  11.7M|  if (codeSize == 0 || codeSize < code->len || code->len == 0) {
  ------------------
  |  Branch (5534:7): [True: 1.23k, False: 11.7M]
  |  Branch (5534:24): [True: 5.04k, False: 11.7M]
  |  Branch (5534:48): [True: 2.57k, False: 11.7M]
  ------------------
 5535|  8.85k|    return EOF;
 5536|  8.85k|  }
 5537|  11.7M|  codeBuf >>= code->len;
 5538|  11.7M|  codeSize -= code->len;
 5539|  11.7M|  return (int)code->val;
 5540|  11.7M|}
_ZN11FlateStream11getCodeWordEi:
 5542|  3.08M|int FlateStream::getCodeWord(int bits) {
 5543|  3.08M|  int c;
 5544|       |
 5545|  3.75M|  while (codeSize < bits) {
  ------------------
  |  Branch (5545:10): [True: 678k, False: 3.07M]
  ------------------
 5546|   678k|    if ((c = str->getChar()) == EOF)
  ------------------
  |  Branch (5546:9): [True: 2.40k, False: 675k]
  ------------------
 5547|  2.40k|      return EOF;
 5548|   675k|    codeBuf |= (c & 0xff) << codeSize;
 5549|   675k|    codeSize += 8;
 5550|   675k|    ++totalIn;
 5551|   675k|  }
 5552|  3.07M|  c = codeBuf & ((1 << bits) - 1);
 5553|  3.07M|  codeBuf >>= bits;
 5554|  3.07M|  codeSize -= bits;
 5555|  3.07M|  return c;
 5556|  3.08M|}
_ZN9EOFStreamC2EP6Stream:
 5563|  16.3k|    FilterStream(strA) {
 5564|  16.3k|}
_ZN9EOFStreamD2Ev:
 5566|  15.3k|EOFStream::~EOFStream() {
 5567|  15.3k|  delete str;
 5568|  15.3k|}
_ZN9EOFStream4copyEv:
 5570|  6.27k|Stream *EOFStream::copy() {
 5571|  6.27k|  return new EOFStream(str->copy());
 5572|  6.27k|}
_ZN9BufStreamC2EP6Streami:
 5578|   261k|BufStream::BufStream(Stream *strA, int bufSizeA): FilterStream(strA) {
 5579|   261k|  bufSize = bufSizeA;
 5580|   261k|  buf = (int *)gmallocn(bufSize, sizeof(int));
 5581|   261k|}
_ZN9BufStreamD2Ev:
 5583|   260k|BufStream::~BufStream() {
 5584|   260k|  gfree(buf);
 5585|   260k|  delete str;
 5586|   260k|}
_ZN9BufStream5resetEv:
 5592|  86.1k|void BufStream::reset() {
 5593|  86.1k|  int i;
 5594|       |
 5595|  86.1k|  str->reset();
 5596|   344k|  for (i = 0; i < bufSize; ++i) {
  ------------------
  |  Branch (5596:15): [True: 258k, False: 86.1k]
  ------------------
 5597|   258k|    buf[i] = str->getChar();
 5598|   258k|  }
 5599|  86.1k|}
_ZN9BufStream7getCharEv:
 5601|   269M|int BufStream::getChar() {
 5602|   269M|  int c, i;
 5603|       |
 5604|   269M|  c = buf[0];
 5605|   809M|  for (i = 1; i < bufSize; ++i) {
  ------------------
  |  Branch (5605:15): [True: 539M, False: 269M]
  ------------------
 5606|   539M|    buf[i-1] = buf[i];
 5607|   539M|  }
 5608|   269M|  buf[bufSize - 1] = str->getChar();
 5609|   269M|  return c;
 5610|   269M|}
_ZN9BufStream8lookCharEv:
 5612|  86.0k|int BufStream::lookChar() {
 5613|  86.0k|  return buf[0];
 5614|  86.0k|}
_ZN9BufStream8lookCharEi:
 5616|   394k|int BufStream::lookChar(int idx) {
 5617|   394k|  return buf[idx];
 5618|   394k|}
_ZN14CCITTFaxStream9addPixelsEii:
 1760|  15.1M|inline void CCITTFaxStream::addPixels(int a1, int blackPixels) {
 1761|  15.1M|  if (a1 > codingLine[a0i]) {
  ------------------
  |  Branch (1761:7): [True: 15.0M, False: 37.2k]
  ------------------
 1762|  15.0M|    if (a1 > columns) {
  ------------------
  |  Branch (1762:9): [True: 178k, False: 14.8M]
  ------------------
 1763|   178k|      error(errSyntaxError, getPos(),
 1764|   178k|	    "CCITTFax row is wrong length ({0:d})", a1);
 1765|   178k|      err = gTrue;
  ------------------
  |  |   17|   178k|#define gTrue 1
  ------------------
 1766|   178k|      ++nErrors;
 1767|   178k|      a1 = columns;
 1768|   178k|    }
 1769|  15.0M|    if ((a0i & 1) ^ blackPixels) {
  ------------------
  |  Branch (1769:9): [True: 14.5M, False: 565k]
  ------------------
 1770|  14.5M|      ++a0i;
 1771|  14.5M|    }
 1772|  15.0M|    codingLine[a0i] = a1;
 1773|  15.0M|  }
 1774|  15.1M|}
_ZN14CCITTFaxStream12addPixelsNegEii:
 1776|   204k|inline void CCITTFaxStream::addPixelsNeg(int a1, int blackPixels) {
 1777|   204k|  if (a1 > codingLine[a0i]) {
  ------------------
  |  Branch (1777:7): [True: 172k, False: 32.4k]
  ------------------
 1778|   172k|    if (a1 > columns) {
  ------------------
  |  Branch (1778:9): [True: 0, False: 172k]
  ------------------
 1779|      0|      error(errSyntaxError, getPos(),
 1780|      0|	    "CCITTFax row is wrong length ({0:d})", a1);
 1781|      0|      err = gTrue;
  ------------------
  |  |   17|      0|#define gTrue 1
  ------------------
 1782|      0|      ++nErrors;
 1783|      0|      a1 = columns;
 1784|      0|    }
 1785|   172k|    if ((a0i & 1) ^ blackPixels) {
  ------------------
  |  Branch (1785:9): [True: 108k, False: 63.6k]
  ------------------
 1786|   108k|      ++a0i;
 1787|   108k|    }
 1788|   172k|    codingLine[a0i] = a1;
 1789|   172k|  } else if (a1 < codingLine[a0i]) {
  ------------------
  |  Branch (1789:14): [True: 12.8k, False: 19.5k]
  ------------------
 1790|  12.8k|    if (a1 < 0) {
  ------------------
  |  Branch (1790:9): [True: 4.02k, False: 8.81k]
  ------------------
 1791|  4.02k|      error(errSyntaxError, getPos(), "Invalid CCITTFax code");
 1792|  4.02k|      err = gTrue;
  ------------------
  |  |   17|  4.02k|#define gTrue 1
  ------------------
 1793|  4.02k|      ++nErrors;
 1794|  4.02k|      a1 = 0;
 1795|  4.02k|    }
 1796|  15.6k|    while (a0i > 0 && a1 <= codingLine[a0i - 1]) {
  ------------------
  |  Branch (1796:12): [True: 9.37k, False: 6.24k]
  |  Branch (1796:23): [True: 2.78k, False: 6.59k]
  ------------------
 1797|  2.78k|      --a0i;
 1798|  2.78k|    }
 1799|  12.8k|    codingLine[a0i] = a1;
 1800|  12.8k|  }
 1801|   204k|}
Stream.cc:_ZL11dctClipInitv:
 2621|  72.8k|static inline void dctClipInit() {
 2622|  72.8k|  static int initDone = 0;
 2623|  72.8k|  int i;
 2624|  72.8k|  if (!initDone) {
  ------------------
  |  Branch (2624:7): [True: 1, False: 72.8k]
  ------------------
 2625|    385|    for (i = -384; i < 0; ++i) {
  ------------------
  |  Branch (2625:20): [True: 384, False: 1]
  ------------------
 2626|    384|      dctClipData[dctClipOffset + i] = 0;
  ------------------
  |  | 2617|    384|#define dctClipOffset  384
  ------------------
 2627|    384|    }
 2628|    257|    for (i = 0; i < 256; ++i) {
  ------------------
  |  Branch (2628:17): [True: 256, False: 1]
  ------------------
 2629|    256|      dctClipData[dctClipOffset + i] = (Guchar)i;
  ------------------
  |  | 2617|    256|#define dctClipOffset  384
  ------------------
 2630|    256|    }
 2631|    384|    for (i = 256; i < 639; ++i) {
  ------------------
  |  Branch (2631:19): [True: 383, False: 1]
  ------------------
 2632|    383|      dctClipData[dctClipOffset + i] = 255;
  ------------------
  |  | 2617|    383|#define dctClipOffset  384
  ------------------
 2633|    383|    }
 2634|      1|    initDone = 1;
 2635|      1|  }
 2636|  72.8k|}
Stream.cc:_ZL7dctClipi:
 2638|   427M|static inline Guchar dctClip(int x) {
 2639|   427M|  return dctClipData[(dctClipOffset + x) & dctClipMask];
  ------------------
  |  | 2617|   427M|#define dctClipOffset  384
  ------------------
                return dctClipData[(dctClipOffset + x) & dctClipMask];
  ------------------
  |  | 2618|   427M|#define dctClipMask   1023
  ------------------
 2640|   427M|}

_ZN10BaseStream13getBaseStreamEv:
  178|  98.3k|  virtual BaseStream *getBaseStream() { return this; }
_ZN10BaseStream7getDictEv:
  180|   601k|  virtual Dict *getDict() { return dict.getDict(); }
_ZN10BaseStream11getFileNameEv:
  181|  4.70k|  virtual GString *getFileName() { return NULL; }
_ZN12FilterStream6getPosEv:
  206|  8.39M|  virtual GFileOffset getPos() { return str->getPos(); }
_ZN12FilterStream7getDictEv:
  210|   482k|  virtual Dict *getDict() { return str->getDict(); }
_ZN15StreamPredictor4isOkEv:
  277|  9.83k|  GBool isOk() { return ok; }
_ZN15StreamPredictor12getPredictorEv:
  285|  6.69k|  int getPredictor() { return predictor; }
_ZN15StreamPredictor8getWidthEv:
  286|  6.69k|  int getWidth() { return width; }
_ZN15StreamPredictor9getNCompsEv:
  287|  6.69k|  int getNComps() { return nComps; }
_ZN15StreamPredictor8getNBitsEv:
  288|  6.69k|  int getNBits() { return nBits; }
_ZN9MemStream7getCharEv:
  366|   733M|    { return (bufPtr < bufEnd) ? (*bufPtr++ & 0xff) : EOF; }
  ------------------
  |  Branch (366:14): [True: 731M, False: 2.75M]
  ------------------
_ZN9MemStream8lookCharEv:
  368|   151M|    { return (bufPtr < bufEnd) ? (*bufPtr & 0xff) : EOF; }
  ------------------
  |  Branch (368:14): [True: 151M, False: 8.09k]
  ------------------
_ZN9MemStream6getPosEv:
  370|  53.0M|  virtual GFileOffset getPos() { return (GFileOffset)(bufPtr - buf); }
_ZN9MemStream8getStartEv:
  372|  9.36k|  virtual GFileOffset getStart() { return start; }
_ZN11EmbedStream5resetEv:
  405|  40.7k|  virtual void reset() {}
_ZN11EmbedStream6getPosEv:
  409|  58.6k|  virtual GFileOffset getPos() { return str->getPos(); }
_ZN14ASCIIHexStream7getCharEv:
  434|  39.0k|    { int c = lookChar(); buf = EOF; return c; }
_ZN13ASCII85Stream7getCharEv:
  459|  4.01M|    { int ch = lookChar(); ++index; return ch; }
_ZN15RunLengthStream7getCharEv:
  538|  10.2M|    { return (bufPtr >= bufEnd && !fillBuf()) ? EOF : (*bufPtr++ & 0xff); }
  ------------------
  |  Branch (538:15): [True: 900k, False: 9.39M]
  |  Branch (538:35): [True: 608k, False: 292k]
  ------------------
_ZN15RunLengthStream8lookCharEv:
  540|   228k|    { return (bufPtr >= bufEnd && !fillBuf()) ? EOF : (*bufPtr & 0xff); }
  ------------------
  |  Branch (540:15): [True: 4.66k, False: 223k]
  |  Branch (540:35): [True: 523, False: 4.14k]
  ------------------
_ZN14CCITTFaxStream7eatBitsEi:
  609|   100M|  void eatBits(int n) { if ((inputBits -= n) < 0) inputBits = 0; }
  ------------------
  |  Branch (609:29): [True: 2.01k, False: 100M]
  ------------------
_ZN9EOFStream5resetEv:
  873|  1.85k|  virtual void reset() {}
_ZN9EOFStream7getCharEv:
  874|    850|  virtual int getChar() { return EOF; }
_ZN9EOFStream8getBlockEPci:
  876|    320|  virtual int getBlock(char *blk, int size) { return 0; }

_ZN10TextStringC2Ev:
   21|  7.75k|TextString::TextString() {
   22|       |  u = NULL;
   23|  7.75k|  len = size = 0;
   24|  7.75k|}
_ZN10TextStringC2EP7GString:
   26|  7.58k|TextString::TextString(GString *s) {
   27|       |  u = NULL;
   28|  7.58k|  len = size = 0;
   29|  7.58k|  append(s);
   30|  7.58k|}
_ZN10TextStringC2EPS_:
   32|    835|TextString::TextString(TextString *s) {
   33|    835|  len = size = s->len;
   34|    835|  if (len) {
  ------------------
  |  Branch (34:7): [True: 835, False: 0]
  ------------------
   35|    835|    u = (Unicode *)gmallocn(size, sizeof(Unicode));
   36|    835|    memcpy(u, s->u, len * sizeof(Unicode));
   37|    835|  } else {
   38|       |    u = NULL;
   39|      0|  }
   40|    835|}
_ZN10TextStringD2Ev:
   42|  16.1k|TextString::~TextString() {
   43|  16.1k|  gfree(u);
   44|  16.1k|}
_ZN10TextString6appendEP7GString:
   53|  7.58k|TextString *TextString::append(GString *s) {
   54|  7.58k|  return insert(len, s);
   55|  7.58k|}
_ZN10TextString6insertEij:
   57|  29.8k|TextString *TextString::insert(int idx, Unicode c) {
   58|  29.8k|  if (idx >= 0 && idx <= len) {
  ------------------
  |  Branch (58:7): [True: 29.8k, False: 0]
  |  Branch (58:19): [True: 29.8k, False: 0]
  ------------------
   59|  29.8k|    expand(1);
   60|  29.8k|    if (idx < len) {
  ------------------
  |  Branch (60:9): [True: 29.8k, False: 0]
  ------------------
   61|  29.8k|      memmove(u + idx + 1, u + idx, (len - idx) * sizeof(Unicode));
   62|  29.8k|    }
   63|  29.8k|    u[idx] = c;
   64|  29.8k|    ++len;
   65|  29.8k|  }
   66|  29.8k|  return this;
   67|  29.8k|}
_ZN10TextString6insertEiPji:
   69|   217k|TextString *TextString::insert(int idx, Unicode *u2, int n) {
   70|   217k|  if (idx >= 0 && idx <= len) {
  ------------------
  |  Branch (70:7): [True: 217k, False: 0]
  |  Branch (70:19): [True: 217k, False: 0]
  ------------------
   71|   217k|    expand(n);
   72|   217k|    if (idx < len) {
  ------------------
  |  Branch (72:9): [True: 143k, False: 73.2k]
  ------------------
   73|   143k|      memmove(u + idx + n, u + idx, (len - idx) * sizeof(Unicode));
   74|   143k|    }
   75|   217k|    memcpy(u + idx, u2, n * sizeof(Unicode));
   76|   217k|    len += n;
   77|   217k|  }
   78|   217k|  return this;
   79|   217k|}
_ZN10TextString6insertEiP7GString:
   81|  38.1k|TextString *TextString::insert(int idx, GString *s) {
   82|  38.1k|  Unicode uBuf[100];
   83|  38.1k|  int n, i;
   84|       |
   85|  38.1k|  if (idx >= 0 && idx <= len) {
  ------------------
  |  Branch (85:7): [True: 38.1k, False: 0]
  |  Branch (85:19): [True: 38.1k, False: 0]
  ------------------
   86|       |    // look for a UTF-16BE BOM
   87|  38.1k|    if ((s->getChar(0) & 0xff) == 0xfe &&
  ------------------
  |  Branch (87:9): [True: 24.5k, False: 13.5k]
  ------------------
   88|  24.5k|	(s->getChar(1) & 0xff) == 0xff) {
  ------------------
  |  Branch (88:2): [True: 24.0k, False: 450]
  ------------------
   89|  24.0k|      i = 2;
   90|  24.0k|      n = 0;
   91|  3.94M|      while (getUTF16BE(s, &i, uBuf + n)) {
  ------------------
  |  Branch (91:14): [True: 3.92M, False: 24.0k]
  ------------------
   92|  3.92M|	++n;
   93|  3.92M|	if (n == sizeof(uBuf) / sizeof(Unicode)) {
  ------------------
  |  Branch (93:6): [True: 33.5k, False: 3.89M]
  ------------------
   94|  33.5k|	  insert(idx, uBuf, n);
   95|  33.5k|	  idx += n;
   96|  33.5k|	  n = 0;
   97|  33.5k|	}
   98|  3.92M|      }
   99|  24.0k|      if (n > 0) {
  ------------------
  |  Branch (99:11): [True: 23.7k, False: 304]
  ------------------
  100|  23.7k|	insert(idx, uBuf, n);
  101|  23.7k|      }
  102|       |
  103|       |    // look for a UTF-16LE BOM
  104|       |    // (technically, this isn't allowed by the PDF spec, but some
  105|       |    // PDF files use it)
  106|  24.0k|    } else if ((s->getChar(0) & 0xff) == 0xff &&
  ------------------
  |  Branch (106:16): [True: 2.45k, False: 11.5k]
  ------------------
  107|  2.45k|	       (s->getChar(1) & 0xff) == 0xfe) {
  ------------------
  |  Branch (107:9): [True: 2.08k, False: 365]
  ------------------
  108|  2.08k|      i = 2;
  109|  2.08k|      n = 0;
  110|  10.6M|      while (getUTF16LE(s, &i, uBuf + n)) {
  ------------------
  |  Branch (110:14): [True: 10.6M, False: 2.08k]
  ------------------
  111|  10.6M|	++n;
  112|  10.6M|	if (n == sizeof(uBuf) / sizeof(Unicode)) {
  ------------------
  |  Branch (112:6): [True: 105k, False: 10.5M]
  ------------------
  113|   105k|	  insert(idx, uBuf, n);
  114|   105k|	  idx += n;
  115|   105k|	  n = 0;
  116|   105k|	}
  117|  10.6M|      }
  118|  2.08k|      if (n > 0) {
  ------------------
  |  Branch (118:11): [True: 1.87k, False: 211]
  ------------------
  119|  1.87k|	insert(idx, uBuf, n);
  120|  1.87k|      }
  121|       |
  122|       |    // look for a UTF-8 BOM
  123|  11.9k|    } else if ((s->getChar(0) & 0xff) == 0xef &&
  ------------------
  |  Branch (123:16): [True: 1.79k, False: 10.1k]
  ------------------
  124|  1.79k|	       (s->getChar(1) & 0xff) == 0xbb &&
  ------------------
  |  Branch (124:9): [True: 1.45k, False: 335]
  ------------------
  125|  1.45k|	       (s->getChar(2) & 0xff) == 0xbf) {
  ------------------
  |  Branch (125:9): [True: 1.20k, False: 253]
  ------------------
  126|  1.20k|      i = 3;
  127|  1.20k|      n = 0;
  128|  5.14M|      while (getUTF8(s, &i, uBuf + n)) {
  ------------------
  |  Branch (128:14): [True: 5.14M, False: 1.20k]
  ------------------
  129|  5.14M|	++n;
  130|  5.14M|	if (n == sizeof(uBuf) / sizeof(Unicode)) {
  ------------------
  |  Branch (130:6): [True: 50.8k, False: 5.09M]
  ------------------
  131|  50.8k|	  insert(idx, uBuf, n);
  132|  50.8k|	  idx += n;
  133|  50.8k|	  n = 0;
  134|  50.8k|	}
  135|  5.14M|      }
  136|  1.20k|      if (n > 0) {
  ------------------
  |  Branch (136:11): [True: 1.15k, False: 48]
  ------------------
  137|  1.15k|	insert(idx, uBuf, n);
  138|  1.15k|      }
  139|       |
  140|       |    // otherwise, use PDFDocEncoding
  141|  10.7k|    } else {
  142|  10.7k|      n = s->getLength();
  143|  10.7k|      expand(n);
  144|  10.7k|      if (idx < len) {
  ------------------
  |  Branch (144:11): [True: 8.71k, False: 2.01k]
  ------------------
  145|  8.71k|	memmove(u + idx + n, u + idx, (len - idx) * sizeof(Unicode));
  146|  8.71k|      }
  147|  26.7M|      for (i = 0; i < n; ++i) {
  ------------------
  |  Branch (147:19): [True: 26.7M, False: 10.7k]
  ------------------
  148|  26.7M|	u[idx + i] = pdfDocEncoding[s->getChar(i) & 0xff];
  149|  26.7M|      }
  150|  10.7k|      len += n;
  151|  10.7k|    }
  152|  38.1k|  }
  153|  38.1k|  return this;
  154|  38.1k|}
_ZN10TextString6expandEi:
  156|   257k|void TextString::expand(int delta) {
  157|   257k|  int newLen;
  158|       |
  159|   257k|  newLen = len + delta;
  160|   257k|  if (delta > INT_MAX - len) {
  ------------------
  |  Branch (160:7): [True: 0, False: 257k]
  ------------------
  161|       |    // trigger an out-of-memory error
  162|      0|    size = -1;
  163|   257k|  } else if (newLen <= size) {
  ------------------
  |  Branch (163:14): [True: 233k, False: 23.9k]
  ------------------
  164|   233k|    return;
  165|   233k|  } else if (size > 0 && size <= INT_MAX / 2 && size*2 >= newLen) {
  ------------------
  |  Branch (165:14): [True: 16.1k, False: 7.77k]
  |  Branch (165:26): [True: 16.1k, False: 0]
  |  Branch (165:49): [True: 14.8k, False: 1.28k]
  ------------------
  166|  14.8k|    size *= 2;
  167|  14.8k|  } else {
  168|  9.06k|    size = newLen;
  169|  9.06k|  }
  170|  23.9k|  u = (Unicode *)greallocn(u, size, sizeof(Unicode));
  171|  23.9k|}
_ZN10TextString6toUTF8Ev:
  201|    152|GString *TextString::toUTF8() {
  202|    152|  GString *s = new GString();
  203|  65.1k|  for (int i = 0; i < len; ++i) {
  ------------------
  |  Branch (203:19): [True: 65.0k, False: 152]
  ------------------
  204|  65.0k|    char buf[8];
  205|  65.0k|    int n = mapUTF8(u[i], buf, sizeof(buf));
  206|  65.0k|    s->append(buf, n);
  207|  65.0k|  }
  208|    152|  return s;
  209|    152|}

_ZN10TextString9getLengthEv:
   49|  30.5k|  int getLength() { return len; }

_Z7mapUTF8jPci:
   12|  65.0k|int mapUTF8(Unicode u, char *buf, int bufSize) {
   13|  65.0k|  if        (u <= 0x0000007f) {
  ------------------
  |  Branch (13:14): [True: 61.5k, False: 3.45k]
  ------------------
   14|  61.5k|    if (bufSize < 1) {
  ------------------
  |  Branch (14:9): [True: 0, False: 61.5k]
  ------------------
   15|      0|      return 0;
   16|      0|    }
   17|  61.5k|    buf[0] = (char)u;
   18|  61.5k|    return 1;
   19|  61.5k|  } else if (u <= 0x000007ff) {
  ------------------
  |  Branch (19:14): [True: 1.10k, False: 2.35k]
  ------------------
   20|  1.10k|    if (bufSize < 2) {
  ------------------
  |  Branch (20:9): [True: 0, False: 1.10k]
  ------------------
   21|      0|      return 0;
   22|      0|    }
   23|  1.10k|    buf[0] = (char)(0xc0 + (u >> 6));
   24|  1.10k|    buf[1] = (char)(0x80 + (u & 0x3f));
   25|  1.10k|    return 2;
   26|  2.35k|  } else if (u <= 0x0000ffff) {
  ------------------
  |  Branch (26:14): [True: 2.15k, False: 193]
  ------------------
   27|  2.15k|    if (bufSize < 3) {
  ------------------
  |  Branch (27:9): [True: 0, False: 2.15k]
  ------------------
   28|      0|      return 0;
   29|      0|    }
   30|  2.15k|    buf[0] = (char)(0xe0 + (u >> 12));
   31|  2.15k|    buf[1] = (char)(0x80 + ((u >> 6) & 0x3f));
   32|  2.15k|    buf[2] = (char)(0x80 + (u & 0x3f));
   33|  2.15k|    return 3;
   34|  2.15k|  } else if (u <= 0x0010ffff) {
  ------------------
  |  Branch (34:14): [True: 81, False: 112]
  ------------------
   35|     81|    if (bufSize < 4) {
  ------------------
  |  Branch (35:9): [True: 0, False: 81]
  ------------------
   36|      0|      return 0;
   37|      0|    }
   38|     81|    buf[0] = (char)(0xf0 + (u >> 18));
   39|     81|    buf[1] = (char)(0x80 + ((u >> 12) & 0x3f));
   40|     81|    buf[2] = (char)(0x80 + ((u >> 6) & 0x3f));
   41|     81|    buf[3] = (char)(0x80 + (u & 0x3f));
   42|     81|    return 4;
   43|    112|  } else {
   44|    112|    return 0;
   45|    112|  }
   46|  65.0k|}
_Z7getUTF8P7GStringPiPj:
   61|  5.14M|GBool getUTF8(GString *s, int *i, Unicode *u) {
   62|  5.14M|  Guchar c0, c1, c2, c3, c4, c5;
   63|       |
   64|  5.14M|  if (*i >= s->getLength()) {
  ------------------
  |  Branch (64:7): [True: 1.20k, False: 5.14M]
  ------------------
   65|  1.20k|    return gFalse;
  ------------------
  |  |   18|  1.20k|#define gFalse 0
  ------------------
   66|  1.20k|  }
   67|  5.14M|  c0 = (Guchar)s->getChar((*i)++);
   68|  5.14M|  if (c0 < 0x80) {
  ------------------
  |  Branch (68:7): [True: 4.01M, False: 1.13M]
  ------------------
   69|  4.01M|    *u = (Unicode)c0;
   70|  4.01M|  } else if (c0 < 0xe0) {
  ------------------
  |  Branch (70:14): [True: 721k, False: 414k]
  ------------------
   71|   721k|    if (*i < s->getLength() &&
  ------------------
  |  Branch (71:9): [True: 721k, False: 202]
  ------------------
   72|   721k|	((c1 = (Guchar)s->getChar(*i)) & 0xc0) == 0x80) {
  ------------------
  |  Branch (72:2): [True: 248k, False: 473k]
  ------------------
   73|   248k|      *i += 1;
   74|   248k|      *u = (Unicode)(((c0 & 0x1f) << 6) |
   75|   248k|		     (c1 & 0x3f));
   76|   473k|    } else {
   77|   473k|      *u =  (Unicode)c0;
   78|   473k|    }
   79|   721k|  } else if (c0 < 0xf0) {
  ------------------
  |  Branch (79:14): [True: 143k, False: 271k]
  ------------------
   80|   143k|    if (*i < s->getLength() - 1 &&
  ------------------
  |  Branch (80:9): [True: 142k, False: 901]
  ------------------
   81|   142k|	((c1 = (Guchar)s->getChar(*i)) & 0xc0) == 0x80 &&
  ------------------
  |  Branch (81:2): [True: 19.2k, False: 123k]
  ------------------
   82|  19.2k|	((c2 = (Guchar)s->getChar(*i + 1)) & 0xc0) == 0x80) {
  ------------------
  |  Branch (82:2): [True: 6.28k, False: 12.9k]
  ------------------
   83|  6.28k|      *i += 2;
   84|  6.28k|      *u = (Unicode)(((c0 & 0x0f) << 12) |
   85|  6.28k|		     ((c1 & 0x3f) << 6) |
   86|  6.28k|		     (c2 & 0x3f));
   87|   137k|    } else {
   88|   137k|      *u = (Unicode)c0;
   89|   137k|    }
   90|   271k|  } else if (c0 < 0xf8) {
  ------------------
  |  Branch (90:14): [True: 34.9k, False: 236k]
  ------------------
   91|  34.9k|    if (*i < s->getLength() - 2 &&
  ------------------
  |  Branch (91:9): [True: 34.8k, False: 78]
  ------------------
   92|  34.8k|	((c1 = (Guchar)s->getChar(*i)) & 0xc0) == 0x80 &&
  ------------------
  |  Branch (92:2): [True: 13.0k, False: 21.8k]
  ------------------
   93|  13.0k|	((c2 = (Guchar)s->getChar(*i + 1)) & 0xc0) == 0x80 &&
  ------------------
  |  Branch (93:2): [True: 5.42k, False: 7.60k]
  ------------------
   94|  5.42k|	((c3 = (Guchar)s->getChar(*i + 2)) & 0xc0) == 0x80) {
  ------------------
  |  Branch (94:2): [True: 2.70k, False: 2.71k]
  ------------------
   95|  2.70k|      *i += 3;
   96|  2.70k|      *u = (Unicode)(((c0 & 0x07) << 18) |
   97|  2.70k|		     ((c1 & 0x3f) << 12) |
   98|  2.70k|		     ((c2 & 0x3f) << 6) |
   99|  2.70k|		     (c3 & 0x3f));
  100|  32.2k|    } else {
  101|  32.2k|      *u = (Unicode)c0;
  102|  32.2k|    }
  103|   236k|  } else if (c0 < 0xfc) {
  ------------------
  |  Branch (103:14): [True: 9.53k, False: 226k]
  ------------------
  104|  9.53k|    if (*i < s->getLength() - 3 &&
  ------------------
  |  Branch (104:9): [True: 9.10k, False: 432]
  ------------------
  105|  9.10k|	((c1 = (Guchar)s->getChar(*i)) & 0xc0) == 0x80 &&
  ------------------
  |  Branch (105:2): [True: 1.87k, False: 7.23k]
  ------------------
  106|  1.87k|	((c2 = (Guchar)s->getChar(*i + 1)) & 0xc0) == 0x80 &&
  ------------------
  |  Branch (106:2): [True: 1.14k, False: 722]
  ------------------
  107|  1.14k|	((c3 = (Guchar)s->getChar(*i + 2)) & 0xc0) == 0x80 &&
  ------------------
  |  Branch (107:2): [True: 831, False: 318]
  ------------------
  108|    831|	((c4 = (Guchar)s->getChar(*i + 3)) & 0xc0) == 0x80) {
  ------------------
  |  Branch (108:2): [True: 735, False: 96]
  ------------------
  109|    735|      *i += 4;
  110|    735|      *u = (Unicode)(((c0 & 0x03) << 24) |
  111|    735|		     ((c1 & 0x3f) << 18) |
  112|    735|		     ((c2 & 0x3f) << 12) |
  113|    735|		     ((c3 & 0x3f) << 6) |
  114|    735|		     (c4 & 0x3f));
  115|  8.80k|    } else {
  116|  8.80k|      *u = (Unicode)c0;
  117|  8.80k|    }
  118|   226k|  } else if (c0 < 0xfe) {
  ------------------
  |  Branch (118:14): [True: 36.8k, False: 189k]
  ------------------
  119|  36.8k|    if (*i < s->getLength() - 4 &&
  ------------------
  |  Branch (119:9): [True: 36.0k, False: 798]
  ------------------
  120|  36.0k|	((c1 = (Guchar)s->getChar(*i)) & 0xc0) == 0x80 &&
  ------------------
  |  Branch (120:2): [True: 3.90k, False: 32.1k]
  ------------------
  121|  3.90k|	((c2 = (Guchar)s->getChar(*i + 1)) & 0xc0) == 0x80 &&
  ------------------
  |  Branch (121:2): [True: 3.18k, False: 720]
  ------------------
  122|  3.18k|	((c3 = (Guchar)s->getChar(*i + 2)) & 0xc0) == 0x80 &&
  ------------------
  |  Branch (122:2): [True: 2.96k, False: 223]
  ------------------
  123|  2.96k|	((c4 = (Guchar)s->getChar(*i + 3)) & 0xc0) == 0x80 &&
  ------------------
  |  Branch (123:2): [True: 2.68k, False: 278]
  ------------------
  124|  2.68k|	((c5 = (Guchar)s->getChar(*i + 4)) & 0xc0) == 0x80) {
  ------------------
  |  Branch (124:2): [True: 2.07k, False: 614]
  ------------------
  125|  2.07k|      *i += 5;
  126|  2.07k|      *u = (Unicode)(((c0 & 0x01) << 30) |
  127|  2.07k|		     ((c1 & 0x3f) << 24) |
  128|  2.07k|		     ((c2 & 0x3f) << 18) |
  129|  2.07k|		     ((c3 & 0x3f) << 12) |
  130|  2.07k|		     ((c4 & 0x3f) << 6) |
  131|  2.07k|		     (c5 & 0x3f));
  132|  34.7k|    } else {
  133|  34.7k|      *u = (Unicode)c0;
  134|  34.7k|    }
  135|   189k|  } else {
  136|   189k|    *u = (Unicode)c0;
  137|   189k|  }
  138|  5.14M|  return gTrue;
  ------------------
  |  |   17|  5.14M|#define gTrue 1
  ------------------
  139|  5.14M|}
_Z10getUTF16BEP7GStringPiPj:
  141|  3.94M|GBool getUTF16BE(GString *s, int *i, Unicode *u) {
  142|  3.94M|  int w0, w1;
  143|       |
  144|  3.94M|  if (*i >= s->getLength() - 1) {
  ------------------
  |  Branch (144:7): [True: 24.0k, False: 3.92M]
  ------------------
  145|  24.0k|    return gFalse;
  ------------------
  |  |   18|  24.0k|#define gFalse 0
  ------------------
  146|  24.0k|  }
  147|  3.92M|  w0 = ((s->getChar(*i) & 0xff) << 8) | (s->getChar(*i + 1) & 0xff);
  148|  3.92M|  *i += 2;
  149|  3.92M|  if (w0 < 0xd800 || w0 >= 0xe000) {
  ------------------
  |  Branch (149:7): [True: 3.69M, False: 228k]
  |  Branch (149:22): [True: 91.6k, False: 136k]
  ------------------
  150|  3.78M|    *u = (Unicode)w0;
  151|  3.78M|  } else {
  152|   136k|    if (*i < s->getLength() - 1) {
  ------------------
  |  Branch (152:9): [True: 136k, False: 387]
  ------------------
  153|   136k|      w1 = ((s->getChar(*i) & 0xff) << 8) | (s->getChar(*i + 1) & 0xff);
  154|   136k|      *i += 2;
  155|   136k|      *u = 0x10000 + ((w0 - 0xd800) << 10) + (w1 - 0xdc00);
  156|   136k|    } else {
  157|    387|      *u = (Unicode)w0;
  158|    387|    }
  159|   136k|  }
  160|  3.92M|  return gTrue;
  ------------------
  |  |   17|  3.92M|#define gTrue 1
  ------------------
  161|  3.94M|}
_Z10getUTF16LEP7GStringPiPj:
  163|  10.6M|GBool getUTF16LE(GString *s, int *i, Unicode *u) {
  164|  10.6M|  int w0, w1;
  165|       |
  166|  10.6M|  if (*i >= s->getLength() - 1) {
  ------------------
  |  Branch (166:7): [True: 2.08k, False: 10.6M]
  ------------------
  167|  2.08k|    return gFalse;
  ------------------
  |  |   18|  2.08k|#define gFalse 0
  ------------------
  168|  2.08k|  }
  169|  10.6M|  w0 = (s->getChar(*i) & 0xff) | ((s->getChar(*i + 1) & 0xff) << 8);
  170|  10.6M|  *i += 2;
  171|  10.6M|  if (w0 < 0xd800 || w0 >= 0xe000) {
  ------------------
  |  Branch (171:7): [True: 10.4M, False: 234k]
  |  Branch (171:22): [True: 217k, False: 16.8k]
  ------------------
  172|  10.6M|    *u = (Unicode)w0;
  173|  10.6M|  } else {
  174|  16.8k|    if (*i < s->getLength() - 1) {
  ------------------
  |  Branch (174:9): [True: 16.3k, False: 418]
  ------------------
  175|  16.3k|      w1 = (s->getChar(*i) & 0xff) | ((s->getChar(*i + 1) & 0xff) << 8);
  176|  16.3k|      *i += 2;
  177|  16.3k|      *u = 0x10000 + ((w0 - 0xd800) << 10) + (w1 - 0xdc00);
  178|  16.3k|    } else {
  179|    418|      *u = (Unicode)w0;
  180|    418|    }
  181|  16.8k|  }
  182|  10.6M|  return gTrue;
  ------------------
  |  |   17|  10.6M|#define gTrue 1
  ------------------
  183|  10.6M|}

_ZN10UnicodeMapC2EPKciP15UnicodeMapRangei:
  122|  18.8k|		       UnicodeMapRange *rangesA, int lenA) {
  123|  18.8k|  encodingName = new GString(encodingNameA);
  124|  18.8k|  unicodeOut = unicodeOutA;
  125|  18.8k|  kind = unicodeMapResident;
  126|  18.8k|  ranges = rangesA;
  127|  18.8k|  len = lenA;
  128|       |  eMaps = NULL;
  129|  18.8k|  eMapsLen = 0;
  130|  18.8k|  refCnt = 1;
  131|  18.8k|}
_ZN10UnicodeMapC2EPKciPFijPciE:
  134|  9.40k|		       UnicodeMapFunc funcA) {
  135|  9.40k|  encodingName = new GString(encodingNameA);
  136|  9.40k|  unicodeOut = unicodeOutA;
  137|  9.40k|  kind = unicodeMapFunc;
  138|  9.40k|  func = funcA;
  139|       |  eMaps = NULL;
  140|  9.40k|  eMapsLen = 0;
  141|  9.40k|  refCnt = 1;
  142|  9.40k|}
_ZN10UnicodeMapD2Ev:
  144|  28.2k|UnicodeMap::~UnicodeMap() {
  145|  28.2k|  delete encodingName;
  146|  28.2k|  if (kind == unicodeMapUser && ranges) {
  ------------------
  |  Branch (146:7): [True: 0, False: 28.2k]
  |  Branch (146:33): [True: 0, False: 0]
  ------------------
  147|      0|    gfree(ranges);
  148|      0|  }
  149|  28.2k|  if (eMaps) {
  ------------------
  |  Branch (149:7): [True: 0, False: 28.2k]
  ------------------
  150|      0|    gfree(eMaps);
  151|      0|  }
  152|  28.2k|}
_ZN15UnicodeMapCacheC2Ev:
  228|  4.70k|UnicodeMapCache::UnicodeMapCache() {
  229|  4.70k|  int i;
  230|       |
  231|  23.5k|  for (i = 0; i < unicodeMapCacheSize; ++i) {
  ------------------
  |  |  102|  23.5k|#define unicodeMapCacheSize 4
  ------------------
  |  Branch (231:15): [True: 18.8k, False: 4.70k]
  ------------------
  232|       |    cache[i] = NULL;
  233|  18.8k|  }
  234|  4.70k|}
_ZN15UnicodeMapCacheD2Ev:
  236|  4.70k|UnicodeMapCache::~UnicodeMapCache() {
  237|  4.70k|  int i;
  238|       |
  239|  23.5k|  for (i = 0; i < unicodeMapCacheSize; ++i) {
  ------------------
  |  |  102|  23.5k|#define unicodeMapCacheSize 4
  ------------------
  |  Branch (239:15): [True: 18.8k, False: 4.70k]
  ------------------
  240|  18.8k|    if (cache[i]) {
  ------------------
  |  Branch (240:9): [True: 0, False: 18.8k]
  ------------------
  241|      0|      cache[i]->decRefCnt();
  242|      0|    }
  243|  18.8k|  }
  244|  4.70k|}

_ZN10UnicodeMap15getEncodingNameEv:
   65|  28.2k|  GString *getEncodingName() { return encodingName; }

_ZN16UnicodeRemappingC2Ev:
   69|  4.70k|UnicodeRemapping::UnicodeRemapping() {
   70|  1.20M|  for (int i = 0; i < 256; ++i) {
  ------------------
  |  Branch (70:19): [True: 1.20M, False: 4.70k]
  ------------------
   71|  1.20M|    page0[i] = (Unicode)i;
   72|  1.20M|  }
   73|       |  sMap = NULL;
   74|  4.70k|  sMapLen = sMapSize = 0;
   75|  4.70k|}
_ZN16UnicodeRemappingD2Ev:
   77|  4.70k|UnicodeRemapping::~UnicodeRemapping() {
   78|  4.70k|  gfree(sMap);
   79|  4.70k|}

_ZN18XFAFieldLayoutInfoC2E20XFAFieldLayoutHAlign20XFAFieldLayoutVAligndd:
   47|  1.39k|				       double marginRightA) {
   48|  1.39k|  hAlign = hAlignA;
   49|  1.39k|  vAlign = vAlignA;
   50|  1.39k|  marginLeft = marginLeftA;
   51|  1.39k|  marginRight = marginRightA;
   52|  1.39k|}
_ZN8XFAFieldC2EP7GStringS1_S1_P18XFAFieldLayoutInfoP19XFAFieldPictureInfoP19XFAFieldBarcodeInfo:
   95|  3.30k|  : name(nameA)
   96|  3.30k|  , fullName(fullNameA)
   97|  3.30k|  , value(valueA)
   98|  3.30k|  , layoutInfo(layoutInfoA)
   99|  3.30k|  , pictureInfo(pictureInfoA)
  100|  3.30k|  , barcodeInfo(barcodeInfoA)
  101|  3.30k|{
  102|  3.30k|}
_ZN8XFAFieldD2Ev:
  104|  3.30k|XFAField::~XFAField() {
  105|  3.30k|  delete name;
  106|  3.30k|  delete fullName;
  107|  3.30k|  delete value;
  108|  3.30k|  delete layoutInfo;
  109|  3.30k|  delete pictureInfo;
  110|  3.30k|  delete barcodeInfo;
  111|  3.30k|}
_ZN10XFAScanner4loadEP6Object:
  115|  1.22k|XFAScanner *XFAScanner::load(Object *xfaObj) {
  116|  1.22k|  GString *xfaData = readXFAStreams(xfaObj);
  117|  1.22k|  if (!xfaData) {
  ------------------
  |  Branch (117:7): [True: 69, False: 1.15k]
  ------------------
  118|     69|    return NULL;
  119|     69|  }
  120|  1.15k|  ZxDoc *xml = ZxDoc::loadMem(xfaData->getCString(), xfaData->getLength());
  121|  1.15k|  delete xfaData;
  122|  1.15k|  if (!xml) {
  ------------------
  |  Branch (122:7): [True: 349, False: 802]
  ------------------
  123|    349|    error(errSyntaxError, -1, "Invalid XML in XFA form");
  124|    349|    return NULL;
  125|    349|  }
  126|       |
  127|    802|  XFAScanner *scanner = new XFAScanner();
  128|       |
  129|    802|  if (xml->getRoot()) {
  ------------------
  |  Branch (129:7): [True: 801, False: 1]
  ------------------
  130|    801|    GHash *formValues = scanner->scanFormValues(xml->getRoot());
  131|    801|    ZxElement *dataElem = NULL;
  132|    801|    ZxElement *datasets =
  133|    801|        xml->getRoot()->findFirstChildElement("xfa:datasets");
  134|    801|    if (datasets) {
  ------------------
  |  Branch (134:9): [True: 68, False: 733]
  ------------------
  135|     68|      dataElem = datasets->findFirstChildElement("xfa:data");
  136|     68|    }
  137|    801|    ZxElement *tmpl = xml->getRoot()->findFirstChildElement("template");
  138|    801|    if (tmpl) {
  ------------------
  |  Branch (138:9): [True: 325, False: 476]
  ------------------
  139|    325|      scanner->scanNode(tmpl, NULL, NULL, NULL, NULL, NULL,
  140|    325|			dataElem, formValues);
  141|    325|    }
  142|    801|    deleteGHash(formValues, GString);
  ------------------
  |  |   60|    801|  do {                                             \
  |  |   61|    801|    GHash *_hash = (hash);                         \
  |  |   62|    801|    {                                              \
  |  |   63|    801|      GHashIter *_iter;                            \
  |  |   64|    801|      GString *_key;                               \
  |  |   65|    801|      void *_p;                                    \
  |  |   66|    801|      _hash->startIter(&_iter);                    \
  |  |   67|  1.12k|      while (_hash->getNext(&_iter, &_key, &_p)) { \
  |  |  ------------------
  |  |  |  Branch (67:14): [True: 324, False: 801]
  |  |  ------------------
  |  |   68|    324|        delete (T*)_p;                             \
  |  |   69|    324|      }                                            \
  |  |   70|    801|      delete _hash;                                \
  |  |   71|    801|    }                                              \
  |  |   72|    801|  } while(0)
  |  |  ------------------
  |  |  |  Branch (72:11): [Folded, False: 801]
  |  |  ------------------
  ------------------
  143|    801|  }
  144|       |
  145|    802|  delete xml;
  146|       |
  147|    802|  return scanner;
  148|  1.15k|}
_ZN10XFAScannerC2Ev:
  150|    801|XFAScanner::XFAScanner() {
  151|    801|  fields = new GHash();
  152|    801|}
_ZN10XFAScannerD2Ev:
  154|    801|XFAScanner::~XFAScanner() {
  155|    801|  deleteGHash(fields, XFAField);
  ------------------
  |  |   60|    801|  do {                                             \
  |  |   61|    801|    GHash *_hash = (hash);                         \
  |  |   62|    801|    {                                              \
  |  |   63|    801|      GHashIter *_iter;                            \
  |  |   64|    801|      GString *_key;                               \
  |  |   65|    801|      void *_p;                                    \
  |  |   66|    801|      _hash->startIter(&_iter);                    \
  |  |   67|  4.10k|      while (_hash->getNext(&_iter, &_key, &_p)) { \
  |  |  ------------------
  |  |  |  Branch (67:14): [True: 3.30k, False: 801]
  |  |  ------------------
  |  |   68|  3.30k|        delete (T*)_p;                             \
  |  |   69|  3.30k|      }                                            \
  |  |   70|    801|      delete _hash;                                \
  |  |   71|    801|    }                                              \
  |  |   72|    801|  } while(0)
  |  |  ------------------
  |  |  |  Branch (72:11): [Folded, False: 801]
  |  |  ------------------
  ------------------
  156|    801|}
_ZN10XFAScanner9findFieldEP7GString:
  158|    152|XFAField *XFAScanner::findField(GString *acroFormFieldName) {
  159|    152|  return (XFAField *)fields->lookup(acroFormFieldName);
  160|    152|}
_ZN10XFAScanner14readXFAStreamsEP6Object:
  162|  1.22k|GString *XFAScanner::readXFAStreams(Object *xfaObj) {
  163|  1.22k|  GString *data = new GString();
  164|  1.22k|  char buf[4096];
  165|  1.22k|  int n;
  166|  1.22k|  if (xfaObj->isStream()) {
  ------------------
  |  Branch (166:7): [True: 10, False: 1.21k]
  ------------------
  167|     10|    xfaObj->streamReset();
  168|  2.64k|    while ((n = xfaObj->getStream()->getBlock(buf, sizeof(buf))) > 0) {
  ------------------
  |  Branch (168:12): [True: 2.63k, False: 10]
  ------------------
  169|  2.63k|      data->append(buf, n);
  170|  2.63k|    }
  171|  1.21k|  } else if (xfaObj->isArray()) {
  ------------------
  |  Branch (171:14): [True: 1.20k, False: 2]
  ------------------
  172|  6.79k|    for (int i = 1; i < xfaObj->arrayGetLength(); i += 2) {
  ------------------
  |  Branch (172:21): [True: 5.65k, False: 1.14k]
  ------------------
  173|  5.65k|      Object obj;
  174|  5.65k|      if (!xfaObj->arrayGet(i, &obj)->isStream()) {
  ------------------
  |  Branch (174:11): [True: 67, False: 5.59k]
  ------------------
  175|     67|	error(errSyntaxError, -1, "XFA array element is wrong type");
  176|     67|	obj.free();
  177|     67|	delete data;
  178|     67|	return NULL;
  179|     67|      }
  180|  5.59k|      obj.streamReset();
  181|  25.5k|      while ((n = obj.getStream()->getBlock(buf, sizeof(buf))) > 0) {
  ------------------
  |  Branch (181:14): [True: 19.9k, False: 5.59k]
  ------------------
  182|  19.9k|	data->append(buf, n);
  183|  19.9k|      }
  184|  5.59k|      obj.free();
  185|  5.59k|    }
  186|  1.20k|  } else {
  187|      2|    error(errSyntaxError, -1, "XFA object is wrong type");
  188|      2|    return NULL;
  189|      2|  }
  190|  1.15k|  return data;
  191|  1.22k|}
_ZN10XFAScanner14scanFormValuesEP9ZxElement:
  193|    801|GHash *XFAScanner::scanFormValues(ZxElement *xmlRoot) {
  194|    801|  GHash *formValues = new GHash(gTrue);
  ------------------
  |  |   17|    801|#define gTrue 1
  ------------------
  195|    801|  ZxElement *formElem = xmlRoot->findFirstChildElement("form");
  196|    801|  if (formElem) {
  ------------------
  |  Branch (196:7): [True: 74, False: 727]
  ------------------
  197|       |    scanFormNode(formElem, NULL, formValues);
  198|     74|  }
  199|    801|  return formValues;
  200|    801|}
_ZN10XFAScanner12scanFormNodeEP9ZxElementP7GStringP5GHash:
  203|  2.73k|			      GHash *formValues) {
  204|  2.73k|  GHash *fullNameIdx = new GHash();
  205|  2.73k|  for (ZxNode *node = elem->getFirstChild();
  206|  48.9k|       node;
  ------------------
  |  Branch (206:8): [True: 46.1k, False: 2.73k]
  ------------------
  207|  46.1k|       node = node->getNextChild()) {
  208|  46.1k|    if (node->isElement("value")) {
  ------------------
  |  Branch (208:9): [True: 2.56k, False: 43.6k]
  ------------------
  209|  2.56k|      if (fullName) {
  ------------------
  |  Branch (209:11): [True: 1.78k, False: 783]
  ------------------
  210|  1.78k|	ZxNode *child1Node = ((ZxElement *)node)->getFirstChild();
  211|  1.78k|	if (child1Node && child1Node->isElement()) {
  ------------------
  |  Branch (211:6): [True: 1.46k, False: 314]
  |  Branch (211:20): [True: 1.35k, False: 117]
  ------------------
  212|  1.35k|	  ZxNode *child2Node = ((ZxElement *)child1Node)->getFirstChild();
  213|  1.35k|	  if (child2Node && child2Node->isCharData()) {
  ------------------
  |  Branch (213:8): [True: 851, False: 499]
  |  Branch (213:22): [True: 324, False: 527]
  ------------------
  214|    324|	    formValues->add(fullName->copy(),
  215|    324|			    ((ZxCharData *)child2Node)->getData()->copy());
  216|    324|	  }
  217|  1.35k|	}
  218|  1.78k|      }
  219|  43.6k|    } else if (node->isElement()) {
  ------------------
  |  Branch (219:16): [True: 22.2k, False: 21.3k]
  ------------------
  220|  22.2k|      ZxAttr *nameAttr = ((ZxElement *)node)->findAttr("name");
  221|  22.2k|      if (nameAttr && (node->isElement("subform") ||
  ------------------
  |  Branch (221:11): [True: 2.40k, False: 19.8k]
  |  Branch (221:24): [True: 760, False: 1.64k]
  ------------------
  222|  2.23k|		       node->isElement("field"))) {
  ------------------
  |  Branch (222:10): [True: 1.47k, False: 176]
  ------------------
  223|  2.23k|	GString *nodeName = nameAttr->getValue();
  224|  2.23k|	GString *childFullName;
  225|  2.23k|	if (fullName) {
  ------------------
  |  Branch (225:6): [True: 1.27k, False: 960]
  ------------------
  226|  1.27k|	  childFullName = GString::format("{0:t}.{1:t}", fullName, nodeName);
  227|  1.27k|	} else {
  228|    960|	  childFullName = nodeName->copy();
  229|    960|	}
  230|  2.23k|	int idx = fullNameIdx->lookupInt(nodeName);
  231|  2.23k|	childFullName->appendf("[{0:d}]", idx);
  232|  2.23k|	fullNameIdx->replace(nodeName, idx + 1);
  233|  2.23k|	scanFormNode((ZxElement *)node, childFullName, formValues);
  234|  2.23k|	delete childFullName;
  235|  20.0k|      } else if (node->isElement("subform")) {
  ------------------
  |  Branch (235:18): [True: 434, False: 19.6k]
  ------------------
  236|    434|	scanFormNode((ZxElement *)node, fullName, formValues);
  237|    434|      }
  238|  22.2k|    }
  239|  46.1k|  }
  240|  2.73k|  delete fullNameIdx;
  241|  2.73k|}
_ZN10XFAScanner8scanNodeEP9ZxElementP7GStringS3_P5GHashS5_S3_S1_S5_:
  247|   138k|			  GHash *formValues) {
  248|   138k|  GString *nodeName = getNodeName(elem);
  249|   138k|  GHash *childNameIdx;
  250|   138k|  if (!nameIdx || nodeName) {
  ------------------
  |  Branch (250:7): [True: 325, False: 137k]
  |  Branch (250:19): [True: 18.5k, False: 119k]
  ------------------
  251|  18.8k|    childNameIdx = new GHash();
  252|   119k|  } else {
  253|   119k|    childNameIdx = nameIdx;
  254|   119k|  }
  255|   138k|  GString *nodeFullName = getNodeFullName(elem);
  256|   138k|  GHash *childFullNameIdx;
  257|   138k|  if (!fullNameIdx || (nodeFullName && !elem->isElement("area"))) {
  ------------------
  |  Branch (257:7): [True: 325, False: 137k]
  |  Branch (257:24): [True: 18.5k, False: 119k]
  |  Branch (257:40): [True: 18.5k, False: 0]
  ------------------
  258|  18.8k|    childFullNameIdx = new GHash();
  259|   119k|  } else {
  260|   119k|    childFullNameIdx = fullNameIdx;
  261|   119k|  }
  262|       |
  263|   138k|  GString *childName;
  264|   138k|  if (nodeName) {
  ------------------
  |  Branch (264:7): [True: 18.5k, False: 119k]
  ------------------
  265|  18.5k|    if (parentName) {
  ------------------
  |  Branch (265:9): [True: 17.0k, False: 1.44k]
  ------------------
  266|  17.0k|      childName = GString::format("{0:t}.{1:t}", parentName, nodeName);
  267|  17.0k|    } else {
  268|  1.44k|      childName = nodeName->copy();
  269|  1.44k|    }
  270|  18.5k|    int idx = nameIdx->lookupInt(nodeName);
  271|  18.5k|    nameIdx->replace(nodeName, idx + 1);
  272|  18.5k|    if (nodeIsBindGlobal(elem)) {
  ------------------
  |  Branch (272:9): [True: 0, False: 18.5k]
  ------------------
  273|      0|      childName->appendf("[0]");
  274|  18.5k|    } else {
  275|  18.5k|      childName->appendf("[{0:d}]", idx);
  276|  18.5k|    }
  277|   119k|  } else {
  278|   119k|    childName = parentName;
  279|   119k|  }
  280|   138k|  GString *childFullName;
  281|   138k|  if (nodeFullName) {
  ------------------
  |  Branch (281:7): [True: 18.5k, False: 119k]
  ------------------
  282|  18.5k|    if (parentFullName) {
  ------------------
  |  Branch (282:9): [True: 17.0k, False: 1.44k]
  ------------------
  283|  17.0k|      childFullName = GString::format("{0:t}.{1:t}",
  284|  17.0k|				      parentFullName, nodeFullName);
  285|  17.0k|    } else {
  286|  1.44k|      childFullName = nodeFullName->copy();
  287|  1.44k|    }
  288|  18.5k|    int idx = fullNameIdx->lookupInt(nodeFullName);
  289|  18.5k|    fullNameIdx->replace(nodeFullName, idx + 1);
  290|  18.5k|    childFullName->appendf("[{0:d}]", idx);
  291|   119k|  } else {
  292|   119k|    childFullName = parentFullName;
  293|   119k|  }
  294|       |
  295|   138k|  if (elem->isElement("field")) {
  ------------------
  |  Branch (295:7): [True: 3.62k, False: 134k]
  ------------------
  296|  3.62k|    if (childName && childFullName) {
  ------------------
  |  Branch (296:9): [True: 3.30k, False: 313]
  |  Branch (296:22): [True: 3.30k, False: 0]
  ------------------
  297|  3.30k|      scanField(elem, childName, childFullName, exclGroupName,
  298|  3.30k|		dataElem, formValues);
  299|  3.30k|    }
  300|   134k|  } else {
  301|   134k|    GString *childExclGroupName;
  302|   134k|    if (elem->isElement("exclGroup")) {
  ------------------
  |  Branch (302:9): [True: 748, False: 133k]
  ------------------
  303|    748|      childExclGroupName = childName;
  304|   133k|    } else {
  305|   133k|      childExclGroupName = NULL;
  306|   133k|    }
  307|   134k|    for (ZxNode *child = elem->getFirstChild();
  308|   380k|	 child;
  ------------------
  |  Branch (308:3): [True: 245k, False: 134k]
  ------------------
  309|   245k|	 child = child->getNextChild()) {
  310|   245k|      if (child->isElement()) {
  ------------------
  |  Branch (310:11): [True: 137k, False: 107k]
  ------------------
  311|   137k|	scanNode((ZxElement *)child, childName, childFullName,
  312|   137k|		 childNameIdx, childFullNameIdx, childExclGroupName,
  313|   137k|		 dataElem, formValues);
  314|   137k|      }
  315|   245k|    }
  316|   134k|  }
  317|       |
  318|   138k|  if (childName != parentName) {
  ------------------
  |  Branch (318:7): [True: 18.5k, False: 119k]
  ------------------
  319|  18.5k|    delete childName;
  320|  18.5k|  }
  321|   138k|  if (childFullName != parentFullName) {
  ------------------
  |  Branch (321:7): [True: 18.5k, False: 119k]
  ------------------
  322|  18.5k|    delete childFullName;
  323|  18.5k|  }
  324|   138k|  if (childNameIdx != nameIdx) {
  ------------------
  |  Branch (324:7): [True: 18.8k, False: 119k]
  ------------------
  325|  18.8k|    delete childNameIdx;
  326|  18.8k|  }
  327|   138k|  if (childFullNameIdx != fullNameIdx) {
  ------------------
  |  Branch (327:7): [True: 18.8k, False: 119k]
  ------------------
  328|  18.8k|    delete childFullNameIdx;
  329|  18.8k|  }
  330|   138k|}
_ZN10XFAScanner9scanFieldEP9ZxElementP7GStringS3_S3_S1_P5GHash:
  334|  3.30k|			   GHash *formValues) {
  335|  3.30k|  GString *value = getFieldValue(elem, name, fullName, exclGroupName,
  336|  3.30k|				 dataElem, formValues);
  337|  3.30k|  XFAFieldLayoutInfo *layoutInfo = getFieldLayoutInfo(elem);
  338|  3.30k|  XFAFieldPictureInfo *pictureInfo = getFieldPictureInfo(elem);
  339|  3.30k|  XFAFieldBarcodeInfo *barcodeInfo = getFieldBarcodeInfo(elem);
  340|  3.30k|  XFAField *field = new XFAField(name->copy(), fullName->copy(), value,
  341|  3.30k|				 layoutInfo, pictureInfo, barcodeInfo);
  342|  3.30k|  fields->add(field->fullName, field);
  343|  3.30k|}
_ZN10XFAScanner13getFieldValueEP9ZxElementP7GStringS3_S3_S1_P5GHash:
  347|  3.30k|				   ZxElement *dataElem, GHash *formValues) {
  348|  3.30k|  GString *val = NULL;
  349|       |
  350|       |  //--- check the <xfa:datasets> packet
  351|  3.30k|  val = getDatasetsValue(name->getCString(), dataElem);
  352|  3.30k|  if (!val && exclGroupName) {
  ------------------
  |  Branch (352:7): [True: 3.15k, False: 153]
  |  Branch (352:15): [True: 481, False: 2.67k]
  ------------------
  353|    481|    val = (GString *)getDatasetsValue(exclGroupName->getCString(), dataElem);
  354|    481|  }
  355|       |
  356|       |  //--- check the <form> element
  357|  3.30k|  if (!val) {
  ------------------
  |  Branch (357:7): [True: 3.15k, False: 153]
  ------------------
  358|  3.15k|    val = (GString *)formValues->lookup(fullName);
  359|  3.15k|  }
  360|       |
  361|       |  //--- check the <value> element within the field
  362|  3.30k|  if (!val) {
  ------------------
  |  Branch (362:7): [True: 3.15k, False: 153]
  ------------------
  363|  3.15k|    ZxElement *valueElem = elem->findFirstChildElement("value");
  364|  3.15k|    if (valueElem) {
  ------------------
  |  Branch (364:9): [True: 1.35k, False: 1.80k]
  ------------------
  365|  1.35k|      ZxNode *child1Node = valueElem->getFirstChild();
  366|  1.35k|      if (child1Node && child1Node->isElement()) {
  ------------------
  |  Branch (366:11): [True: 1.22k, False: 126]
  |  Branch (366:25): [True: 1.17k, False: 50]
  ------------------
  367|  1.17k|	ZxNode *child2Node = ((ZxElement *)child1Node)->getFirstChild();
  368|  1.17k|	if (child2Node && child2Node->isCharData()) {
  ------------------
  |  Branch (368:6): [True: 696, False: 479]
  |  Branch (368:20): [True: 521, False: 175]
  ------------------
  369|    521|	  val = ((ZxCharData *)child2Node)->getData();
  370|    521|	}
  371|  1.17k|      }
  372|  1.35k|    }
  373|  3.15k|  }
  374|       |
  375|       |  //--- get the checkbutton item value
  376|  3.30k|  GString *checkbuttonItem = NULL;
  377|  3.30k|  ZxElement *uiElem = elem->findFirstChildElement("ui");
  378|  3.30k|  if (uiElem) {
  ------------------
  |  Branch (378:7): [True: 1.57k, False: 1.73k]
  ------------------
  379|  1.57k|    ZxNode *uiChild = uiElem->getFirstChild();
  380|  1.57k|    if (uiChild && uiChild->isElement("checkButton")) {
  ------------------
  |  Branch (380:9): [True: 1.42k, False: 155]
  |  Branch (380:20): [True: 1.26k, False: 161]
  ------------------
  381|  1.26k|      ZxElement *itemsElem = elem->findFirstChildElement("items");
  382|  1.26k|      if (itemsElem) {
  ------------------
  |  Branch (382:11): [True: 944, False: 317]
  ------------------
  383|    944|	ZxNode *node1 = itemsElem->getFirstChild();
  384|    944|	if (node1 && node1->isElement()) {
  ------------------
  |  Branch (384:6): [True: 834, False: 110]
  |  Branch (384:15): [True: 779, False: 55]
  ------------------
  385|    779|	  ZxNode *node2 = ((ZxElement *)node1)->getFirstChild();
  386|    779|	  if (node2 && node2->isCharData()) {
  ------------------
  |  Branch (386:8): [True: 465, False: 314]
  |  Branch (386:17): [True: 368, False: 97]
  ------------------
  387|    368|	    checkbuttonItem = ((ZxCharData *)node2)->getData();
  388|    368|	  }
  389|    779|	}
  390|    944|      }
  391|  1.26k|    }
  392|  1.57k|  }
  393|       |  // convert XFA checkbutton value to AcroForm-style On/Off value
  394|  3.30k|  if (checkbuttonItem && val) {
  ------------------
  |  Branch (394:7): [True: 368, False: 2.94k]
  |  Branch (394:26): [True: 344, False: 24]
  ------------------
  395|    344|    if (val->cmp(checkbuttonItem)) {
  ------------------
  |  Branch (395:9): [True: 238, False: 106]
  ------------------
  396|    238|      val = new GString("Off");
  397|    238|    } else {
  398|    106|      val = new GString("On");
  399|    106|    }
  400|  2.96k|  } else if (val) {
  ------------------
  |  Branch (400:14): [True: 330, False: 2.63k]
  ------------------
  401|    330|    val = val->copy();
  402|    330|  }
  403|       |
  404|  3.30k|  return val;
  405|  3.30k|}
_ZN10XFAScanner16getDatasetsValueEPcP9ZxElement:
  407|  23.2k|GString *XFAScanner::getDatasetsValue(char *partName, ZxElement *elem) {
  408|  23.2k|  if (!elem) {
  ------------------
  |  Branch (408:7): [True: 2.96k, False: 20.2k]
  ------------------
  409|  2.96k|    return NULL;
  410|  2.96k|  }
  411|       |
  412|       |  // partName = xxxx[nn].yyyy----
  413|  20.2k|  char *p = strchr(partName, '[');
  414|  20.2k|  if (!p) {
  ------------------
  |  Branch (414:7): [True: 316, False: 19.9k]
  ------------------
  415|    316|    return NULL;
  416|    316|  }
  417|  19.9k|  int partLen = (int)(p - partName);
  418|  19.9k|  int idx = atoi(p + 1);
  419|  19.9k|  p = strchr(p + 1, '.');
  420|  19.9k|  if (p) {
  ------------------
  |  Branch (420:7): [True: 18.5k, False: 1.33k]
  ------------------
  421|  18.5k|    ++p;
  422|  18.5k|  }
  423|       |
  424|  19.9k|  int curIdx = 0;
  425|  19.9k|  for (ZxNode *node = elem->getFirstChild();
  426|   140k|       node;
  ------------------
  |  Branch (426:8): [True: 122k, False: 18.5k]
  ------------------
  427|   122k|       node = node->getNextChild()) {
  428|   122k|    if (!node->isElement()) {
  ------------------
  |  Branch (428:9): [True: 18.9k, False: 103k]
  ------------------
  429|  18.9k|      continue;
  430|  18.9k|    }
  431|   103k|    GString *nodeName = ((ZxElement *)node)->getType();
  432|   103k|    if (nodeName->getLength() != partLen ||
  ------------------
  |  Branch (432:9): [True: 100k, False: 2.37k]
  ------------------
  433|   101k|	strncmp(nodeName->getCString(), partName, partLen)) {
  ------------------
  |  Branch (433:2): [True: 405, False: 1.96k]
  ------------------
  434|   101k|      continue;
  435|   101k|    }
  436|  1.96k|    if (curIdx != idx) {
  ------------------
  |  Branch (436:9): [True: 568, False: 1.39k]
  ------------------
  437|    568|      ++curIdx;
  438|    568|      continue;
  439|    568|    }
  440|  1.39k|    if (p) {
  ------------------
  |  Branch (440:9): [True: 977, False: 420]
  ------------------
  441|    977|      GString *val = getDatasetsValue(p, (ZxElement *)node);
  442|    977|      if (val) {
  ------------------
  |  Branch (442:11): [True: 153, False: 824]
  ------------------
  443|    153|	return val;
  444|    153|      }
  445|    824|      break;
  446|    977|    } else {
  447|    420|      ZxNode *child = ((ZxElement *)node)->getFirstChild();
  448|    420|      if (!child || !child->isCharData()) {
  ------------------
  |  Branch (448:11): [True: 129, False: 291]
  |  Branch (448:21): [True: 138, False: 153]
  ------------------
  449|    267|	return NULL;
  450|    267|      }
  451|    153|      return ((ZxCharData *)child)->getData();
  452|    420|    }
  453|  1.39k|  }
  454|       |
  455|       |  // search for an 'ancestor match'
  456|  19.3k|  if (p) {
  ------------------
  |  Branch (456:7): [True: 18.4k, False: 913]
  ------------------
  457|  18.4k|    return getDatasetsValue(p, elem);
  458|  18.4k|  }
  459|       |
  460|    913|  return NULL;
  461|  19.3k|}
_ZN10XFAScanner18getFieldLayoutInfoEP9ZxElement:
  463|  3.30k|XFAFieldLayoutInfo *XFAScanner::getFieldLayoutInfo(ZxElement *elem) {
  464|  3.30k|  ZxElement *paraElem = elem->findFirstChildElement("para");
  465|  3.30k|  if (!paraElem) {
  ------------------
  |  Branch (465:7): [True: 1.90k, False: 1.39k]
  ------------------
  466|  1.90k|    return NULL;
  467|  1.90k|  }
  468|  1.39k|  XFAFieldLayoutHAlign hAlign = xfaFieldLayoutHAlignLeft;
  469|  1.39k|  ZxAttr *hAlignAttr = paraElem->findAttr("hAlign");
  470|  1.39k|  if (hAlignAttr) {
  ------------------
  |  Branch (470:7): [True: 12, False: 1.38k]
  ------------------
  471|     12|    if (!hAlignAttr->getValue()->cmp("left")) {
  ------------------
  |  Branch (471:9): [True: 0, False: 12]
  ------------------
  472|      0|      hAlign = xfaFieldLayoutHAlignLeft;
  473|     12|    } else if (!hAlignAttr->getValue()->cmp("center")) {
  ------------------
  |  Branch (473:16): [True: 0, False: 12]
  ------------------
  474|      0|      hAlign = xfaFieldLayoutHAlignCenter;
  475|     12|    } else if (!hAlignAttr->getValue()->cmp("right")) {
  ------------------
  |  Branch (475:16): [True: 0, False: 12]
  ------------------
  476|      0|      hAlign = xfaFieldLayoutHAlignRight;
  477|      0|    }
  478|     12|  }
  479|  1.39k|  XFAFieldLayoutVAlign vAlign = xfaFieldLayoutVAlignTop;
  480|  1.39k|  ZxAttr *vAlignAttr = paraElem->findAttr("vAlign");
  481|  1.39k|  if (vAlignAttr) {
  ------------------
  |  Branch (481:7): [True: 697, False: 702]
  ------------------
  482|    697|    if (!vAlignAttr->getValue()->cmp("top")) {
  ------------------
  |  Branch (482:9): [True: 0, False: 697]
  ------------------
  483|      0|      vAlign = xfaFieldLayoutVAlignTop;
  484|    697|    } else if (!vAlignAttr->getValue()->cmp("middle")) {
  ------------------
  |  Branch (484:16): [True: 89, False: 608]
  ------------------
  485|     89|      vAlign = xfaFieldLayoutVAlignMiddle;
  486|    608|    } else if (!vAlignAttr->getValue()->cmp("bottom")) {
  ------------------
  |  Branch (486:16): [True: 0, False: 608]
  ------------------
  487|      0|      vAlign = xfaFieldLayoutVAlignBottom;
  488|      0|    }
  489|    697|  }
  490|  1.39k|  double marginLeft = 0;
  491|  1.39k|  double marginRight = 0;
  492|  1.39k|  ZxAttr *marginAttr;
  493|  1.39k|  if ((marginAttr = paraElem->findAttr("marginLeft"))) {
  ------------------
  |  Branch (493:7): [True: 0, False: 1.39k]
  ------------------
  494|      0|    marginLeft = getMeasurement(marginAttr->getValue());
  495|      0|  }
  496|  1.39k|  if ((marginAttr = paraElem->findAttr("marginRight"))) {
  ------------------
  |  Branch (496:7): [True: 0, False: 1.39k]
  ------------------
  497|      0|    marginRight = getMeasurement(marginAttr->getValue());
  498|      0|  }
  499|  1.39k|  return new XFAFieldLayoutInfo(hAlign, vAlign, marginLeft, marginRight);
  500|  3.30k|}
_ZN10XFAScanner19getFieldPictureInfoEP9ZxElement:
  502|  3.30k|XFAFieldPictureInfo *XFAScanner::getFieldPictureInfo(ZxElement *elem) {
  503|  3.30k|  ZxElement *uiElem = elem->findFirstChildElement("ui");
  504|  3.30k|  if (!uiElem) {
  ------------------
  |  Branch (504:7): [True: 1.73k, False: 1.57k]
  ------------------
  505|  1.73k|    return NULL;
  506|  1.73k|  }
  507|  1.57k|  XFAFieldPictureSubtype subtype;
  508|  1.57k|  if (uiElem->findFirstChildElement("dateTimeEdit")) {
  ------------------
  |  Branch (508:7): [True: 0, False: 1.57k]
  ------------------
  509|      0|    subtype = xfaFieldPictureDateTime;
  510|  1.57k|  } else if (uiElem->findFirstChildElement("numericEdit")) {
  ------------------
  |  Branch (510:14): [True: 0, False: 1.57k]
  ------------------
  511|      0|    subtype = xfaFieldPictureNumeric;
  512|  1.57k|  } else if (uiElem->findFirstChildElement("textEdit")) {
  ------------------
  |  Branch (512:14): [True: 0, False: 1.57k]
  ------------------
  513|      0|    subtype = xfaFieldPictureText;
  514|  1.57k|  } else {
  515|  1.57k|    return NULL;
  516|  1.57k|  }
  517|       |
  518|      0|  ZxElement *formatElem, *pictureElem;
  519|      0|  ZxNode *pictureChildNode;
  520|      0|  if (!(formatElem = elem->findFirstChildElement("format")) ||
  ------------------
  |  Branch (520:7): [True: 0, False: 0]
  ------------------
  521|      0|      !(pictureElem = formatElem->findFirstChildElement("picture")) ||
  ------------------
  |  Branch (521:7): [True: 0, False: 0]
  ------------------
  522|      0|      !(pictureChildNode = pictureElem->getFirstChild()) ||
  ------------------
  |  Branch (522:7): [True: 0, False: 0]
  ------------------
  523|      0|      !pictureChildNode->isCharData()) {
  ------------------
  |  Branch (523:7): [True: 0, False: 0]
  ------------------
  524|      0|    return NULL;
  525|      0|  }
  526|      0|  GString *format = ((ZxCharData *)pictureChildNode)->getData()->copy();
  527|       |
  528|      0|  return new XFAFieldPictureInfo(subtype, format);
  529|      0|}
_ZN10XFAScanner19getFieldBarcodeInfoEP9ZxElement:
  531|  3.30k|XFAFieldBarcodeInfo *XFAScanner::getFieldBarcodeInfo(ZxElement *elem) {
  532|  3.30k|  ZxElement *uiElem, *barcodeElem;
  533|  3.30k|  if (!(uiElem = elem->findFirstChildElement("ui")) ||
  ------------------
  |  Branch (533:7): [True: 1.73k, False: 1.57k]
  ------------------
  534|  3.30k|      !(barcodeElem = uiElem->findFirstChildElement("barcode"))) {
  ------------------
  |  Branch (534:7): [True: 1.57k, False: 0]
  ------------------
  535|  3.30k|    return NULL;
  536|  3.30k|  }
  537|       |
  538|      0|  ZxAttr *attr;
  539|      0|  if (!(attr = barcodeElem->findAttr("type"))) {
  ------------------
  |  Branch (539:7): [True: 0, False: 0]
  ------------------
  540|      0|    return NULL;
  541|      0|  }
  542|      0|  GString *barcodeType = attr->getValue()->copy();
  543|       |
  544|      0|  double wideNarrowRatio = 3;
  545|      0|  if ((attr = barcodeElem->findAttr("wideNarrowRatio"))) {
  ------------------
  |  Branch (545:7): [True: 0, False: 0]
  ------------------
  546|      0|    char *s = attr->getValue()->getCString();
  547|      0|    char *colon = strchr(s, ':');
  548|      0|    if (colon) {
  ------------------
  |  Branch (548:9): [True: 0, False: 0]
  ------------------
  549|      0|      GString *numStr = new GString(s, (int)(colon - s));
  550|      0|      double num = atof(numStr->getCString());
  551|      0|      delete numStr;
  552|      0|      double den = atof(colon + 1);
  553|      0|      if (den == 0) {
  ------------------
  |  Branch (553:11): [True: 0, False: 0]
  ------------------
  554|      0|	wideNarrowRatio = num;
  555|      0|      } else {
  556|      0|	wideNarrowRatio = num / den;
  557|      0|      }
  558|      0|    } else {
  559|      0|      wideNarrowRatio = atof(s);
  560|      0|    }
  561|      0|  }
  562|       |
  563|      0|  double moduleWidth = (0.25 / 25.4) * 72.0; // 0.25mm
  564|      0|  if ((attr = barcodeElem->findAttr("moduleWidth"))) {
  ------------------
  |  Branch (564:7): [True: 0, False: 0]
  ------------------
  565|      0|    moduleWidth = getMeasurement(attr->getValue());
  566|      0|  }
  567|       |
  568|      0|  double moduleHeight = (5.0 / 25.4) * 72.0; // 5mm
  569|      0|  if ((attr = barcodeElem->findAttr("moduleHeight"))) {
  ------------------
  |  Branch (569:7): [True: 0, False: 0]
  ------------------
  570|      0|    moduleHeight = getMeasurement(attr->getValue());
  571|      0|  }
  572|       |
  573|      0|  int dataLength = 0;
  574|      0|  if ((attr = barcodeElem->findAttr("dataLength"))) {
  ------------------
  |  Branch (574:7): [True: 0, False: 0]
  ------------------
  575|      0|    dataLength = atoi(attr->getValue()->getCString());
  576|      0|  }
  577|       |
  578|      0|  int errorCorrectionLevel = 0;
  579|      0|  if ((attr = barcodeElem->findAttr("errorCorrectionLevel"))) {
  ------------------
  |  Branch (579:7): [True: 0, False: 0]
  ------------------
  580|      0|    errorCorrectionLevel = atoi(attr->getValue()->getCString());
  581|      0|  }
  582|       |
  583|      0|  GString *textLocation;
  584|      0|  if ((attr = barcodeElem->findAttr("textLocation"))) {
  ------------------
  |  Branch (584:7): [True: 0, False: 0]
  ------------------
  585|      0|    textLocation = attr->getValue()->copy();
  586|      0|  } else {
  587|      0|    textLocation = new GString("below");
  588|      0|  }
  589|       |
  590|      0|  return new XFAFieldBarcodeInfo(barcodeType, wideNarrowRatio,
  591|      0|				 moduleWidth, moduleHeight, dataLength,
  592|      0|				 errorCorrectionLevel, textLocation);
  593|      0|}
_ZN10XFAScanner11getNodeNameEP9ZxElement:
  642|   138k|GString *XFAScanner::getNodeName(ZxElement *elem) {
  643|   138k|  if (elem->isElement("template") ||
  ------------------
  |  Branch (643:7): [True: 866, False: 137k]
  ------------------
  644|   137k|      elem->isElement("area") ||
  ------------------
  |  Branch (644:7): [True: 89, False: 137k]
  ------------------
  645|   137k|      elem->isElement("draw")) {
  ------------------
  |  Branch (645:7): [True: 261, False: 136k]
  ------------------
  646|  1.21k|    return NULL;
  647|  1.21k|  }
  648|   136k|  if (!elem->isElement("field") && nodeIsBindNone(elem)) {
  ------------------
  |  Branch (648:7): [True: 133k, False: 3.62k]
  |  Branch (648:36): [True: 0, False: 133k]
  ------------------
  649|      0|    return NULL;
  650|      0|  }
  651|   136k|  ZxAttr *nameAttr = elem->findAttr("name");
  652|   136k|  if (!nameAttr) {
  ------------------
  |  Branch (652:7): [True: 118k, False: 18.5k]
  ------------------
  653|   118k|    return NULL;
  654|   118k|  }
  655|  18.5k|  return nameAttr->getValue();
  656|   136k|}
_ZN10XFAScanner15getNodeFullNameEP9ZxElement:
  658|   138k|GString *XFAScanner::getNodeFullName(ZxElement *elem) {
  659|   138k|  if (elem->isElement("template") ||
  ------------------
  |  Branch (659:7): [True: 866, False: 137k]
  ------------------
  660|   137k|      elem->isElement("draw")) {
  ------------------
  |  Branch (660:7): [True: 261, False: 136k]
  ------------------
  661|  1.12k|    return NULL;
  662|  1.12k|  }
  663|   136k|  ZxAttr *nameAttr = elem->findAttr("name");
  664|   136k|  if (!nameAttr) {
  ------------------
  |  Branch (664:7): [True: 118k, False: 18.5k]
  ------------------
  665|   118k|    return NULL;
  666|   118k|  }
  667|  18.5k|  return nameAttr->getValue();
  668|   136k|}
_ZN10XFAScanner16nodeIsBindGlobalEP9ZxElement:
  670|  18.5k|GBool XFAScanner::nodeIsBindGlobal(ZxElement *elem) {
  671|  18.5k|  ZxElement *bindElem = elem->findFirstChildElement("bind");
  672|  18.5k|  if (!bindElem) {
  ------------------
  |  Branch (672:7): [True: 18.4k, False: 34]
  ------------------
  673|  18.4k|    return gFalse;
  ------------------
  |  |   18|  18.4k|#define gFalse 0
  ------------------
  674|  18.4k|  }
  675|     34|  ZxAttr *attr = bindElem->findAttr("match");
  676|     34|  return attr && !attr->getValue()->cmp("global");
  ------------------
  |  Branch (676:10): [True: 0, False: 34]
  |  Branch (676:18): [True: 0, False: 0]
  ------------------
  677|  18.5k|}
_ZN10XFAScanner14nodeIsBindNoneEP9ZxElement:
  679|   133k|GBool XFAScanner::nodeIsBindNone(ZxElement *elem) {
  680|   133k|  ZxElement *bindElem = elem->findFirstChildElement("bind");
  681|   133k|  if (!bindElem) {
  ------------------
  |  Branch (681:7): [True: 133k, False: 96]
  ------------------
  682|   133k|    return gFalse;
  ------------------
  |  |   18|   133k|#define gFalse 0
  ------------------
  683|   133k|  }
  684|     96|  ZxAttr *attr = bindElem->findAttr("match");
  685|     96|  return attr && !attr->getValue()->cmp("none");
  ------------------
  |  Branch (685:10): [True: 0, False: 96]
  |  Branch (685:18): [True: 0, False: 0]
  ------------------
  686|   133k|}

_ZN10XRefPosSetC2Ev:
   66|    198|XRefPosSet::XRefPosSet() {
   67|    198|  size = 16;
   68|    198|  len = 0;
   69|    198|  tab = (GFileOffset *)gmallocn(size, sizeof(GFileOffset));
   70|    198|}
_ZN10XRefPosSetD2Ev:
   72|    198|XRefPosSet::~XRefPosSet() {
   73|    198|  gfree(tab);
   74|    198|}
_ZN10XRefPosSet3addEl:
   76|    273|void XRefPosSet::add(GFileOffset pos) {
   77|    273|  int i;
   78|       |
   79|    273|  i = find(pos);
   80|    273|  if (i < len && tab[i] == pos) {
  ------------------
  |  Branch (80:7): [True: 8, False: 265]
  |  Branch (80:18): [True: 0, False: 8]
  ------------------
   81|      0|    return;
   82|      0|  }
   83|    273|  if (len == size) {
  ------------------
  |  Branch (83:7): [True: 0, False: 273]
  ------------------
   84|      0|    if (size > INT_MAX / 2) {
  ------------------
  |  Branch (84:9): [True: 0, False: 0]
  ------------------
   85|      0|      gMemError("Integer overflow in XRefPosSet::add()");
   86|      0|    }
   87|      0|    size *= 2;
   88|      0|    tab = (GFileOffset *)greallocn(tab, size, sizeof(GFileOffset));
   89|      0|  }
   90|    273|  if (i < len) {
  ------------------
  |  Branch (90:7): [True: 8, False: 265]
  ------------------
   91|      8|    memmove(&tab[i + 1], &tab[i], (len - i) * sizeof(GFileOffset));
   92|      8|  }
   93|    273|  tab[i] = pos;
   94|    273|  ++len;
   95|    273|}
_ZN10XRefPosSet5checkEl:
   97|    273|GBool XRefPosSet::check(GFileOffset pos) {
   98|    273|  int i;
   99|       |
  100|    273|  i = find(pos);
  101|    273|  return i < len && tab[i] == pos;
  ------------------
  |  Branch (101:10): [True: 8, False: 265]
  |  Branch (101:21): [True: 0, False: 8]
  ------------------
  102|    273|}
_ZN10XRefPosSet4findEl:
  104|    546|int XRefPosSet::find(GFileOffset pos) {
  105|    546|  int a, b, m;
  106|       |
  107|    546|  a = - 1;
  108|    546|  b = len;
  109|       |  // invariant: tab[a] < pos < tab[b]
  110|    704|  while (b - a > 1) {
  ------------------
  |  Branch (110:10): [True: 158, False: 546]
  ------------------
  111|    158|    m = (a + b) / 2;
  112|    158|    if (tab[m] < pos) {
  ------------------
  |  Branch (112:9): [True: 138, False: 20]
  ------------------
  113|    138|      a = m;
  114|    138|    } else if (tab[m] > pos) {
  ------------------
  |  Branch (114:16): [True: 20, False: 0]
  ------------------
  115|     20|      b = m;
  116|     20|    } else {
  117|      0|      return m;
  118|      0|    }
  119|    158|  }
  120|    546|  return b;
  121|    546|}
_ZN12ObjectStreamC2EP4XRefii:
  154|  78.6k|ObjectStream::ObjectStream(XRef *xref, int objStrNumA, int recursion) {
  155|  78.6k|  Stream *str;
  156|  78.6k|  Lexer *lexer;
  157|  78.6k|  Parser *parser;
  158|  78.6k|  int *offsets;
  159|  78.6k|  Object objStr, obj1, obj2;
  160|  78.6k|  int first, i;
  161|       |
  162|  78.6k|  objStrNum = objStrNumA;
  163|  78.6k|  nObjects = 0;
  164|  78.6k|  objs = NULL;
  165|  78.6k|  objNums = NULL;
  166|  78.6k|  ok = gFalse;
  ------------------
  |  |   18|  78.6k|#define gFalse 0
  ------------------
  167|       |
  168|  78.6k|  if (!xref->fetch(objStrNum, 0, &objStr, recursion)->isStream()) {
  ------------------
  |  Branch (168:7): [True: 849, False: 77.7k]
  ------------------
  169|    849|    goto err1;
  170|    849|  }
  171|       |
  172|  77.7k|  if (!objStr.streamGetDict()->lookup("N", &obj1, recursion)->isInt()) {
  ------------------
  |  Branch (172:7): [True: 348, False: 77.4k]
  ------------------
  173|    348|    obj1.free();
  174|    348|    goto err1;
  175|    348|  }
  176|  77.4k|  nObjects = obj1.getInt();
  177|  77.4k|  obj1.free();
  178|  77.4k|  if (nObjects <= 0) {
  ------------------
  |  Branch (178:7): [True: 350, False: 77.0k]
  ------------------
  179|    350|    goto err1;
  180|    350|  }
  181|       |
  182|  77.0k|  if (!objStr.streamGetDict()->lookup("First", &obj1, recursion)->isInt()) {
  ------------------
  |  Branch (182:7): [True: 67.6k, False: 9.44k]
  ------------------
  183|  67.6k|    obj1.free();
  184|  67.6k|    goto err1;
  185|  67.6k|  }
  186|  9.44k|  first = obj1.getInt();
  187|  9.44k|  obj1.free();
  188|  9.44k|  if (first < 0) {
  ------------------
  |  Branch (188:7): [True: 82, False: 9.36k]
  ------------------
  189|     82|    goto err1;
  190|     82|  }
  191|       |
  192|       |  // this is an arbitrary limit to avoid integer overflow problems
  193|       |  // in the 'new Object[nObjects]' call (Acrobat apparently limits
  194|       |  // object streams to 100-200 objects)
  195|  9.36k|  if (nObjects > 1000000) {
  ------------------
  |  Branch (195:7): [True: 78, False: 9.28k]
  ------------------
  196|     78|    error(errSyntaxError, -1, "Too many objects in an object stream");
  197|     78|    goto err1;
  198|     78|  }
  199|  9.28k|  objs = new Object[nObjects];
  200|  9.28k|  objNums = (int *)gmallocn(nObjects, sizeof(int));
  201|  9.28k|  offsets = (int *)gmallocn(nObjects, sizeof(int));
  202|       |
  203|       |  // parse the header: object numbers and offsets
  204|  9.28k|  objStr.streamReset();
  205|  9.28k|  obj1.initNull();
  206|  9.28k|  str = new EmbedStream(objStr.getStream(), &obj1, gTrue, first);
  ------------------
  |  |   17|  9.28k|#define gTrue 1
  ------------------
  207|  9.28k|  lexer = new Lexer(xref, str);
  208|  9.28k|  parser = new Parser(xref, lexer, gFalse);
  ------------------
  |  |   18|  9.28k|#define gFalse 0
  ------------------
  209|   219k|  for (i = 0; i < nObjects; ++i) {
  ------------------
  |  Branch (209:15): [True: 215k, False: 3.88k]
  ------------------
  210|   215k|    parser->getObj(&obj1, gTrue);
  ------------------
  |  |   17|   215k|#define gTrue 1
  ------------------
  211|   215k|    parser->getObj(&obj2, gTrue);
  ------------------
  |  |   17|   215k|#define gTrue 1
  ------------------
  212|   215k|    if (!obj1.isInt() || !obj2.isInt()) {
  ------------------
  |  Branch (212:9): [True: 1.11k, False: 214k]
  |  Branch (212:26): [True: 1.36k, False: 213k]
  ------------------
  213|  2.47k|      obj1.free();
  214|  2.47k|      obj2.free();
  215|  2.47k|      delete parser;
  216|  2.47k|      gfree(offsets);
  217|  2.47k|      goto err2;
  218|  2.47k|    }
  219|   213k|    objNums[i] = obj1.getInt();
  220|   213k|    offsets[i] = obj2.getInt();
  221|   213k|    obj1.free();
  222|   213k|    obj2.free();
  223|   213k|    if (objNums[i] < 0 || offsets[i] < 0 ||
  ------------------
  |  Branch (223:9): [True: 360, False: 212k]
  |  Branch (223:27): [True: 465, False: 212k]
  ------------------
  224|   212k|	(i > 0 && offsets[i] < offsets[i-1])) {
  ------------------
  |  Branch (224:3): [True: 204k, False: 7.52k]
  |  Branch (224:12): [True: 2.10k, False: 202k]
  ------------------
  225|  2.92k|      delete parser;
  226|  2.92k|      gfree(offsets);
  227|  2.92k|      goto err2;
  228|  2.92k|    }
  229|   213k|  }
  230|  3.88k|  lexer->skipToEOF();
  231|  3.88k|  delete parser;
  232|       |
  233|       |  // skip to the first object - this generally shouldn't be needed,
  234|       |  // because offsets[0] is normally 0, but just in case...
  235|  3.88k|  if (offsets[0] > 0) {
  ------------------
  |  Branch (235:7): [True: 259, False: 3.63k]
  ------------------
  236|    259|    objStr.getStream()->discardChars(offsets[0]);
  237|    259|  }
  238|       |
  239|       |  // parse the objects
  240|  35.3k|  for (i = 0; i < nObjects; ++i) {
  ------------------
  |  Branch (240:15): [True: 31.4k, False: 3.88k]
  ------------------
  241|  31.4k|    obj1.initNull();
  242|  31.4k|    if (i == nObjects - 1) {
  ------------------
  |  Branch (242:9): [True: 3.88k, False: 27.5k]
  ------------------
  243|  3.88k|      str = new EmbedStream(objStr.getStream(), &obj1, gFalse, 0);
  ------------------
  |  |   18|  3.88k|#define gFalse 0
  ------------------
  244|  27.5k|    } else {
  245|  27.5k|      str = new EmbedStream(objStr.getStream(), &obj1, gTrue,
  ------------------
  |  |   17|  27.5k|#define gTrue 1
  ------------------
  246|  27.5k|			    offsets[i+1] - offsets[i]);
  247|  27.5k|    }
  248|  31.4k|    lexer = new Lexer(xref, str);
  249|  31.4k|    parser = new Parser(xref, lexer, gFalse);
  ------------------
  |  |   18|  31.4k|#define gFalse 0
  ------------------
  250|  31.4k|    parser->getObj(&objs[i]);
  251|  31.4k|    lexer->skipToEOF();
  252|  31.4k|    delete parser;
  253|  31.4k|  }
  254|       |
  255|  3.88k|  gfree(offsets);
  256|  3.88k|  ok = gTrue;
  ------------------
  |  |   17|  3.88k|#define gTrue 1
  ------------------
  257|       |
  258|  9.28k| err2:
  259|  9.28k|  objStr.streamClose();
  260|  78.6k| err1:
  261|  78.6k|  objStr.free();
  262|  78.6k|}
_ZN12ObjectStreamD2Ev:
  264|  78.6k|ObjectStream::~ObjectStream() {
  265|  78.6k|  int i;
  266|       |
  267|  78.6k|  if (objs) {
  ------------------
  |  Branch (267:7): [True: 9.28k, False: 69.3k]
  ------------------
  268|   312k|    for (i = 0; i < nObjects; ++i) {
  ------------------
  |  Branch (268:17): [True: 303k, False: 9.28k]
  ------------------
  269|   303k|      objs[i].free();
  270|   303k|    }
  271|  9.28k|    delete[] objs;
  272|  9.28k|  }
  273|  78.6k|  gfree(objNums);
  274|  78.6k|}
_ZN12ObjectStream9getObjectEiiP6Object:
  276|  30.2k|Object *ObjectStream::getObject(int objIdx, int objNum, Object *obj) {
  277|  30.2k|  if (objIdx < 0 || objIdx >= nObjects || objNum != objNums[objIdx]) {
  ------------------
  |  Branch (277:7): [True: 0, False: 30.2k]
  |  Branch (277:21): [True: 545, False: 29.6k]
  |  Branch (277:43): [True: 89, False: 29.5k]
  ------------------
  278|    634|    obj->initNull();
  279|  29.5k|  } else {
  280|  29.5k|    objs[objIdx].copy(obj);
  281|  29.5k|  }
  282|  30.2k|  return obj;
  283|  30.2k|}
_ZN4XRefC2EP10BaseStreami:
  289|  9.36k|XRef::XRef(BaseStream *strA, GBool repair) {
  290|  9.36k|  GFileOffset pos;
  291|  9.36k|  Object obj;
  292|  9.36k|  XRefPosSet *posSet;
  293|  9.36k|  int i;
  294|       |
  295|  9.36k|  ok = gTrue;
  ------------------
  |  |   17|  9.36k|#define gTrue 1
  ------------------
  296|  9.36k|  errCode = errNone;
  ------------------
  |  |   12|  9.36k|#define errNone             0	// no error
  ------------------
  297|  9.36k|  repaired = gFalse;
  ------------------
  |  |   18|  9.36k|#define gFalse 0
  ------------------
  298|  9.36k|  size = 0;
  299|  9.36k|  last = -1;
  300|  9.36k|  entries = NULL;
  301|  9.36k|  lastStartxrefPos = 0;
  302|  9.36k|  xrefTablePos = NULL;
  303|  9.36k|  xrefTablePosLen = 0;
  304|  9.36k|  streamEnds = NULL;
  305|  9.36k|  streamEndsLen = 0;
  306|  1.20M|  for (i = 0; i < objStrCacheSize; ++i) {
  ------------------
  |  |   51|  1.20M|#define objStrCacheSize 128
  ------------------
  |  Branch (306:15): [True: 1.19M, False: 9.36k]
  ------------------
  307|  1.19M|    objStrs[i] = NULL;
  308|  1.19M|    objStrLastUse[i] = 0;
  309|  1.19M|  }
  310|  9.36k|  objStrCacheLength = 0;
  311|  9.36k|  objStrTime = 0;
  312|       |
  313|  9.36k|  encrypted = gFalse;
  ------------------
  |  |   18|  9.36k|#define gFalse 0
  ------------------
  314|  9.36k|  permFlags = defPermFlags;
  ------------------
  |  |   41|  9.36k|#define defPermFlags 0xfffc
  ------------------
  315|  9.36k|  ownerPasswordOk = gFalse;
  ------------------
  |  |   18|  9.36k|#define gFalse 0
  ------------------
  316|       |
  317|   159k|  for (i = 0; i < xrefCacheSize; ++i) {
  ------------------
  |  |   49|   159k|#define xrefCacheSize 16
  ------------------
  |  Branch (317:15): [True: 149k, False: 9.36k]
  ------------------
  318|   149k|    cache[i].num = -1;
  319|   149k|  }
  320|       |
  321|  9.36k|#if MULTITHREADED
  322|  9.36k|  gInitMutex(&objStrsMutex);
  ------------------
  |  |   51|  9.36k|#define gInitMutex(m) pthread_mutex_init(m, NULL)
  ------------------
  323|  9.36k|  gInitMutex(&cacheMutex);
  ------------------
  |  |   51|  9.36k|#define gInitMutex(m) pthread_mutex_init(m, NULL)
  ------------------
  324|  9.36k|#endif
  325|       |
  326|  9.36k|  str = strA;
  327|  9.36k|  start = str->getStart();
  328|       |
  329|       |  // if the 'repair' flag is set, try to reconstruct the xref table
  330|  9.36k|  if (repair) {
  ------------------
  |  Branch (330:7): [True: 4.66k, False: 4.70k]
  ------------------
  331|  4.66k|    if (!(ok = constructXRef())) {
  ------------------
  |  Branch (331:9): [True: 2.10k, False: 2.56k]
  ------------------
  332|  2.10k|      errCode = errDamaged;
  ------------------
  |  |   18|  2.10k|#define errDamaged          3	// PDF file was damaged and couldn't be
  ------------------
  333|  2.10k|      return;
  334|  2.10k|    }
  335|  2.56k|    repaired = gTrue;
  ------------------
  |  |   17|  2.56k|#define gTrue 1
  ------------------
  336|       |
  337|       |  // if the 'repair' flag is not set, read the xref table
  338|  4.70k|  } else {
  339|       |
  340|       |    // read the trailer
  341|  4.70k|    pos = getStartXref();
  342|  4.70k|    if (pos == 0) {
  ------------------
  |  Branch (342:9): [True: 4.50k, False: 198]
  ------------------
  343|  4.50k|      errCode = errDamaged;
  ------------------
  |  |   18|  4.50k|#define errDamaged          3	// PDF file was damaged and couldn't be
  ------------------
  344|  4.50k|      ok = gFalse;
  ------------------
  |  |   18|  4.50k|#define gFalse 0
  ------------------
  345|  4.50k|      return;
  346|  4.50k|    }
  347|       |
  348|       |    // read the xref table
  349|    198|    posSet = new XRefPosSet();
  350|    272|    while (readXRef(&pos, posSet, gFalse)) ;
  ------------------
  |  |   18|    272|#define gFalse 0
  ------------------
  |  Branch (350:12): [True: 74, False: 198]
  ------------------
  351|    198|    xrefTablePosLen = posSet->getLength();
  352|    198|    xrefTablePos = (GFileOffset *)gmallocn(xrefTablePosLen,
  353|    198|					   sizeof(GFileOffset));
  354|    471|    for (i = 0; i < xrefTablePosLen; ++i)  {
  ------------------
  |  Branch (354:17): [True: 273, False: 198]
  ------------------
  355|    273|      xrefTablePos[i] = posSet->get(i);
  356|    273|    }
  357|    198|    delete posSet;
  358|    198|    if (!ok) {
  ------------------
  |  Branch (358:9): [True: 111, False: 87]
  ------------------
  359|    111|      errCode = errDamaged;
  ------------------
  |  |   18|    111|#define errDamaged          3	// PDF file was damaged and couldn't be
  ------------------
  360|    111|      return;
  361|    111|    }
  362|    198|  }
  363|       |
  364|       |  // get the root dictionary (catalog) object
  365|  2.65k|  trailerDict.dictLookupNF("Root", &obj);
  366|  2.65k|  if (obj.isRef()) {
  ------------------
  |  Branch (366:7): [True: 2.55k, False: 97]
  ------------------
  367|  2.55k|    rootNum = obj.getRefNum();
  368|  2.55k|    rootGen = obj.getRefGen();
  369|  2.55k|    obj.free();
  370|  2.55k|  } else {
  371|     97|    obj.free();
  372|     97|    if (!(ok = constructXRef())) {
  ------------------
  |  Branch (372:9): [True: 15, False: 82]
  ------------------
  373|     15|      errCode = errDamaged;
  ------------------
  |  |   18|     15|#define errDamaged          3	// PDF file was damaged and couldn't be
  ------------------
  374|     15|      return;
  375|     15|    }
  376|     97|  }
  377|       |
  378|       |  // now set the trailer dictionary's xref pointer so we can fetch
  379|       |  // indirect objects from it
  380|  2.63k|  trailerDict.getDict()->setXRef(this);
  381|  2.63k|}
_ZN4XRefD2Ev:
  383|  9.34k|XRef::~XRef() {
  384|  9.34k|  int i;
  385|       |
  386|   158k|  for (i = 0; i < xrefCacheSize; ++i) {
  ------------------
  |  |   49|   158k|#define xrefCacheSize 16
  ------------------
  |  Branch (386:15): [True: 149k, False: 9.34k]
  ------------------
  387|   149k|    if (cache[i].num >= 0) {
  ------------------
  |  Branch (387:9): [True: 31.5k, False: 117k]
  ------------------
  388|  31.5k|      cache[i].obj.free();
  389|  31.5k|    }
  390|   149k|  }
  391|  9.34k|  gfree(entries);
  392|  9.34k|  trailerDict.free();
  393|  9.34k|  if (xrefTablePos) {
  ------------------
  |  Branch (393:7): [True: 198, False: 9.14k]
  ------------------
  394|    198|    gfree(xrefTablePos);
  395|    198|  }
  396|  9.34k|  if (streamEnds) {
  ------------------
  |  Branch (396:7): [True: 2.30k, False: 7.03k]
  ------------------
  397|  2.30k|    gfree(streamEnds);
  398|  2.30k|  }
  399|  1.20M|  for (i = 0; i < objStrCacheSize; ++i) {
  ------------------
  |  |   51|  1.20M|#define objStrCacheSize 128
  ------------------
  |  Branch (399:15): [True: 1.19M, False: 9.34k]
  ------------------
  400|  1.19M|    if (objStrs[i]) {
  ------------------
  |  Branch (400:9): [True: 3.39k, False: 1.19M]
  ------------------
  401|  3.39k|      delete objStrs[i];
  402|  3.39k|    }
  403|  1.19M|  }
  404|  9.34k|#if MULTITHREADED
  405|  9.34k|  gDestroyMutex(&objStrsMutex);
  ------------------
  |  |   52|  9.34k|#define gDestroyMutex(m) pthread_mutex_destroy(m)
  ------------------
  406|  9.34k|  gDestroyMutex(&cacheMutex);
  ------------------
  |  |   52|  9.34k|#define gDestroyMutex(m) pthread_mutex_destroy(m)
  ------------------
  407|  9.34k|#endif
  408|  9.34k|}
_ZN4XRef12getStartXrefEv:
  411|  4.70k|GFileOffset XRef::getStartXref() {
  412|  4.70k|  char buf[xrefSearchSize+1];
  413|  4.70k|  char *p;
  414|  4.70k|  int n, i;
  415|       |
  416|       |  // read last xrefSearchSize bytes
  417|  4.70k|  str->setPos(xrefSearchSize, -1);
  ------------------
  |  |   30|  4.70k|#define xrefSearchSize 1024	// read this many bytes at end of file
  ------------------
  418|  4.70k|  n = str->getBlock(buf, xrefSearchSize);
  ------------------
  |  |   30|  4.70k|#define xrefSearchSize 1024	// read this many bytes at end of file
  ------------------
  419|  4.70k|  buf[n] = '\0';
  420|       |
  421|       |  // find startxref
  422|  4.56M|  for (i = n - 9; i >= 0; --i) {
  ------------------
  |  Branch (422:19): [True: 4.56M, False: 4.38k]
  ------------------
  423|  4.56M|    if (!strncmp(&buf[i], "startxref", 9)) {
  ------------------
  |  Branch (423:9): [True: 315, False: 4.56M]
  ------------------
  424|    315|      break;
  425|    315|    }
  426|  4.56M|  }
  427|  4.70k|  if (i < 0) {
  ------------------
  |  Branch (427:7): [True: 4.38k, False: 315]
  ------------------
  428|  4.38k|    return 0;
  429|  4.38k|  }
  430|    916|  for (p = &buf[i+9]; isspace(*p & 0xff); ++p) ;
  ------------------
  |  Branch (430:23): [True: 601, False: 315]
  ------------------
  431|    315|  lastXRefPos = strToFileOffset(p);
  432|    315|  lastStartxrefPos = str->getPos() - n + i;
  433|       |
  434|    315|  return lastXRefPos;
  435|  4.70k|}
_ZN4XRef8readXRefEPlP10XRefPosSeti:
  441|    273|GBool XRef::readXRef(GFileOffset *pos, XRefPosSet *posSet, GBool hybrid) {
  442|    273|  Parser *parser;
  443|    273|  Object obj;
  444|    273|  GBool more;
  445|    273|  char buf[100];
  446|    273|  int n, i;
  447|       |
  448|       |  // check for a loop in the xref tables
  449|    273|  if (posSet->check(*pos)) {
  ------------------
  |  Branch (449:7): [True: 0, False: 273]
  ------------------
  450|      0|    error(errSyntaxWarning, -1, "Infinite loop in xref table");
  451|      0|    return gFalse;
  ------------------
  |  |   18|      0|#define gFalse 0
  ------------------
  452|      0|  }
  453|    273|  posSet->add(*pos);
  454|       |
  455|       |  // the xref data should either be "xref ..." (for an xref table) or
  456|       |  // "nn gg obj << ... >> stream ..." (for an xref stream); possibly
  457|       |  // preceded by whitespace
  458|    273|  str->setPos(start + *pos);
  459|    273|  n = str->getBlock(buf, 100);
  460|    425|  for (i = 0; i < n && Lexer::isSpace(buf[i]); ++i) ;
  ------------------
  |  Branch (460:15): [True: 404, False: 21]
  |  Branch (460:24): [True: 152, False: 252]
  ------------------
  461|       |
  462|       |  // parse an old-style xref table
  463|    273|  if (!hybrid &&
  ------------------
  |  Branch (463:7): [True: 272, False: 1]
  ------------------
  464|    272|      i + 4 < n &&
  ------------------
  |  Branch (464:7): [True: 251, False: 21]
  ------------------
  465|    251|      buf[i] == 'x' && buf[i+1] == 'r' && buf[i+2] == 'e' && buf[i+3] == 'f' &&
  ------------------
  |  Branch (465:7): [True: 3, False: 248]
  |  Branch (465:24): [True: 3, False: 0]
  |  Branch (465:43): [True: 3, False: 0]
  |  Branch (465:62): [True: 3, False: 0]
  ------------------
  466|      3|      Lexer::isSpace(buf[i+4])) {
  ------------------
  |  Branch (466:7): [True: 3, False: 0]
  ------------------
  467|      3|    more = readXRefTable(pos, i + 5, posSet);
  468|       |
  469|       |  // parse an xref stream
  470|    270|  } else {
  471|    270|    obj.initNull();
  472|    270|    parser = new Parser(NULL,
  473|    270|	       new Lexer(NULL,
  474|    270|		 str->makeSubStream(start + *pos, gFalse, 0, &obj)),
  ------------------
  |  |   18|    270|#define gFalse 0
  ------------------
  475|    270|	       gTrue);
  ------------------
  |  |   17|    270|#define gTrue 1
  ------------------
  476|    270|    if (!parser->getObj(&obj, gTrue)->isInt()) {
  ------------------
  |  |   17|    270|#define gTrue 1
  ------------------
  |  Branch (476:9): [True: 49, False: 221]
  ------------------
  477|     49|      goto err;
  478|     49|    }
  479|    221|    obj.free();
  480|    221|    if (!parser->getObj(&obj, gTrue)->isInt()) {
  ------------------
  |  |   17|    221|#define gTrue 1
  ------------------
  |  Branch (480:9): [True: 10, False: 211]
  ------------------
  481|     10|      goto err;
  482|     10|    }
  483|    211|    obj.free();
  484|    211|    if (!parser->getObj(&obj, gTrue)->isCmd("obj")) {
  ------------------
  |  |   17|    211|#define gTrue 1
  ------------------
  |  Branch (484:9): [True: 13, False: 198]
  ------------------
  485|     13|      goto err;
  486|     13|    }
  487|    198|    obj.free();
  488|    198|    if (!parser->getObj(&obj)->isStream()) {
  ------------------
  |  Branch (488:9): [True: 16, False: 182]
  ------------------
  489|     16|      goto err;
  490|     16|    }
  491|    182|    more = readXRefStream(obj.getStream(), pos);
  492|    182|    obj.free();
  493|    182|    delete parser;
  494|    182|  }
  495|       |
  496|    185|  return more;
  497|       |
  498|     88| err:
  499|     88|  obj.free();
  500|     88|  delete parser;
  501|     88|  if (hybrid) {
  ------------------
  |  Branch (501:7): [True: 0, False: 88]
  ------------------
  502|      0|    error(errSyntaxError, -1, "Invalid XRefStm link in trailer");
  503|     88|  } else {
  504|     88|    ok = gFalse;
  ------------------
  |  |   18|     88|#define gFalse 0
  ------------------
  505|     88|  }
  506|     88|  return gFalse;
  ------------------
  |  |   18|     88|#define gFalse 0
  ------------------
  507|    273|}
_ZN4XRef13readXRefTableEPliP10XRefPosSet:
  509|      3|GBool XRef::readXRefTable(GFileOffset *pos, int offset, XRefPosSet *posSet) {
  510|      3|  XRefEntry entry;
  511|      3|  Parser *parser;
  512|      3|  Object obj, obj2;
  513|      3|  char buf[6];
  514|      3|  GFileOffset off, pos2;
  515|      3|  GBool more;
  516|      3|  int first, n, digit, newSize, gen, i, c;
  517|       |
  518|      3|  str->setPos(start + *pos + offset);
  519|       |
  520|      5|  while (1) {
  ------------------
  |  Branch (520:10): [True: 5, Folded]
  ------------------
  521|     19|    do {
  522|     19|      c = str->getChar();
  523|     19|    } while (Lexer::isSpace(c));
  ------------------
  |  Branch (523:14): [True: 14, False: 5]
  ------------------
  524|      5|    if (c == 't') {
  ------------------
  |  Branch (524:9): [True: 2, False: 3]
  ------------------
  525|      2|      if (str->getBlock(buf, 6) != 6 || memcmp(buf, "railer", 6)) {
  ------------------
  |  Branch (525:11): [True: 0, False: 2]
  |  Branch (525:41): [True: 0, False: 2]
  ------------------
  526|      0|	goto err1;
  527|      0|      }
  528|      2|      break;
  529|      2|    }
  530|      3|    if (c < '0' || c > '9') {
  ------------------
  |  Branch (530:9): [True: 0, False: 3]
  |  Branch (530:20): [True: 0, False: 3]
  ------------------
  531|      0|      goto err1;
  532|      0|    }
  533|      3|    first = 0;
  534|      8|    do {
  535|      8|      digit = c - '0';
  536|      8|      if (first > (INT_MAX - digit) / 10) {
  ------------------
  |  Branch (536:11): [True: 0, False: 8]
  ------------------
  537|      0|	goto err1;
  538|      0|      }
  539|      8|      first = (first * 10) + digit;
  540|      8|      c = str->getChar();
  541|      8|    } while (c >= '0' && c <= '9');
  ------------------
  |  Branch (541:14): [True: 5, False: 3]
  |  Branch (541:26): [True: 5, False: 0]
  ------------------
  542|      3|    if (!Lexer::isSpace(c)) {
  ------------------
  |  Branch (542:9): [True: 0, False: 3]
  ------------------
  543|      0|      goto err1;
  544|      0|    }
  545|      3|    do {
  546|      3|      c = str->getChar();
  547|      3|    } while (Lexer::isSpace(c));
  ------------------
  |  Branch (547:14): [True: 0, False: 3]
  ------------------
  548|      3|    n = 0;
  549|      3|    do {
  550|      3|      digit = c - '0';
  551|      3|      if (n > (INT_MAX - digit) / 10) {
  ------------------
  |  Branch (551:11): [True: 0, False: 3]
  ------------------
  552|      0|	goto err1;
  553|      0|      }
  554|      3|      n = (n * 10) + digit;
  555|      3|      c = str->getChar();
  556|      3|    } while (c >= '0' && c <= '9');
  ------------------
  |  Branch (556:14): [True: 0, False: 3]
  |  Branch (556:26): [True: 0, False: 0]
  ------------------
  557|      3|    if (!Lexer::isSpace(c)) {
  ------------------
  |  Branch (557:9): [True: 0, False: 3]
  ------------------
  558|      0|      goto err1;
  559|      0|    }
  560|      3|    if (first > INT_MAX - n) {
  ------------------
  |  Branch (560:9): [True: 0, False: 3]
  ------------------
  561|      0|      goto err1;
  562|      0|    }
  563|      3|    if (first + n > size) {
  ------------------
  |  Branch (563:9): [True: 0, False: 3]
  ------------------
  564|      0|      newSize = size ? size : 512;
  ------------------
  |  Branch (564:17): [True: 0, False: 0]
  ------------------
  565|      0|      do {
  566|      0|	if (newSize > INT_MAX / 2) {
  ------------------
  |  Branch (566:6): [True: 0, False: 0]
  ------------------
  567|      0|	  goto err1;
  568|      0|	}
  569|      0|	newSize <<= 1;
  570|      0|      } while (first + n > newSize);
  ------------------
  |  Branch (570:16): [True: 0, False: 0]
  ------------------
  571|      0|      entries = (XRefEntry *)greallocn(entries, newSize, sizeof(XRefEntry));
  572|      0|      for (i = size; i < newSize; ++i) {
  ------------------
  |  Branch (572:22): [True: 0, False: 0]
  ------------------
  573|      0|	entries[i].offset = (GFileOffset)-1;
  574|      0|	entries[i].type = xrefEntryFree;
  575|      0|      }
  576|      0|      size = newSize;
  577|      0|    }
  578|      4|    for (i = first; i < first + n; ++i) {
  ------------------
  |  Branch (578:21): [True: 2, False: 2]
  ------------------
  579|      4|      do {
  580|      4|	c = str->getChar();
  581|      4|      } while (Lexer::isSpace(c));
  ------------------
  |  Branch (581:16): [True: 2, False: 2]
  ------------------
  582|      2|      off = 0;
  583|     14|      do {
  584|     14|	off = (off * 10) + (c - '0');
  585|     14|	c = str->getChar();
  586|     14|      } while (c >= '0' && c <= '9');
  ------------------
  |  Branch (586:16): [True: 13, False: 1]
  |  Branch (586:28): [True: 12, False: 1]
  ------------------
  587|      2|      if (!Lexer::isSpace(c)) {
  ------------------
  |  Branch (587:11): [True: 1, False: 1]
  ------------------
  588|      1|	goto err1;
  589|      1|      }
  590|      1|      entry.offset = off;
  591|      1|      do {
  592|      1|	c = str->getChar();
  593|      1|      } while (Lexer::isSpace(c));
  ------------------
  |  Branch (593:16): [True: 0, False: 1]
  ------------------
  594|      1|      gen = 0;
  595|      5|      do {
  596|      5|	gen = (gen * 10) + (c - '0');
  597|      5|	c = str->getChar();
  598|      5|      } while (c >= '0' && c <= '9');
  ------------------
  |  Branch (598:16): [True: 4, False: 1]
  |  Branch (598:28): [True: 4, False: 0]
  ------------------
  599|      1|      if (!Lexer::isSpace(c)) {
  ------------------
  |  Branch (599:11): [True: 0, False: 1]
  ------------------
  600|      0|	goto err1;
  601|      0|      }
  602|      1|      entry.gen = gen;
  603|      1|      do {
  604|      1|	c = str->getChar();
  605|      1|      } while (Lexer::isSpace(c));
  ------------------
  |  Branch (605:16): [True: 0, False: 1]
  ------------------
  606|      1|      if (c == 'n') {
  ------------------
  |  Branch (606:11): [True: 1, False: 0]
  ------------------
  607|      1|	entry.type = xrefEntryUncompressed;
  608|      1|      } else if (c == 'f') {
  ------------------
  |  Branch (608:18): [True: 0, False: 0]
  ------------------
  609|      0|	entry.type = xrefEntryFree;
  610|      0|      } else {
  611|      0|	goto err1;
  612|      0|      }
  613|      1|      c = str->getChar();
  614|      1|      if (!Lexer::isSpace(c)) {
  ------------------
  |  Branch (614:11): [True: 0, False: 1]
  ------------------
  615|      0|	goto err1;
  616|      0|      }
  617|      1|      if (entries[i].offset == (GFileOffset)-1) {
  ------------------
  |  Branch (617:11): [True: 1, False: 0]
  ------------------
  618|      1|	entries[i] = entry;
  619|       |	// PDF files of patents from the IBM Intellectual Property
  620|       |	// Network have a bug: the xref table claims to start at 1
  621|       |	// instead of 0.
  622|      1|	if (i == 1 && first == 1 &&
  ------------------
  |  Branch (622:6): [True: 0, False: 1]
  |  Branch (622:16): [True: 0, False: 0]
  ------------------
  623|      0|	    entries[1].offset == 0 && entries[1].gen == 65535 &&
  ------------------
  |  Branch (623:6): [True: 0, False: 0]
  |  Branch (623:32): [True: 0, False: 0]
  ------------------
  624|      0|	    entries[1].type == xrefEntryFree) {
  ------------------
  |  Branch (624:6): [True: 0, False: 0]
  ------------------
  625|      0|	  i = first = 0;
  626|      0|	  entries[0] = entries[1];
  627|      0|	  entries[1].offset = (GFileOffset)-1;
  628|      0|	}
  629|      1|	if (i > last) {
  ------------------
  |  Branch (629:6): [True: 0, False: 1]
  ------------------
  630|      0|	  last = i;
  631|      0|	}
  632|      1|      }
  633|      1|    }
  634|      3|  }
  635|       |
  636|       |  // read the trailer dictionary
  637|      2|  obj.initNull();
  638|      2|  parser = new Parser(NULL,
  639|      2|	     new Lexer(NULL,
  640|      2|	       str->makeSubStream(str->getPos(), gFalse, 0, &obj)),
  ------------------
  |  |   18|      2|#define gFalse 0
  ------------------
  641|      2|	     gTrue);
  ------------------
  |  |   17|      2|#define gTrue 1
  ------------------
  642|      2|  parser->getObj(&obj);
  643|      2|  delete parser;
  644|      2|  if (!obj.isDict()) {
  ------------------
  |  Branch (644:7): [True: 0, False: 2]
  ------------------
  645|      0|    obj.free();
  646|      0|    goto err1;
  647|      0|  }
  648|       |
  649|       |  // get the 'Prev' pointer
  650|       |  //~ this can be a 64-bit int (?)
  651|      2|  obj.getDict()->lookupNF("Prev", &obj2);
  652|      2|  if (obj2.isInt()) {
  ------------------
  |  Branch (652:7): [True: 1, False: 1]
  ------------------
  653|      1|    *pos = (GFileOffset)(Guint)obj2.getInt();
  654|      1|    more = gTrue;
  ------------------
  |  |   17|      1|#define gTrue 1
  ------------------
  655|      1|  } else if (obj2.isRef()) {
  ------------------
  |  Branch (655:14): [True: 0, False: 1]
  ------------------
  656|       |    // certain buggy PDF generators generate "/Prev NNN 0 R" instead
  657|       |    // of "/Prev NNN"
  658|      0|    *pos = (GFileOffset)(Guint)obj2.getRefNum();
  659|      0|    more = gTrue;
  ------------------
  |  |   17|      0|#define gTrue 1
  ------------------
  660|      1|  } else {
  661|      1|    more = gFalse;
  ------------------
  |  |   18|      1|#define gFalse 0
  ------------------
  662|      1|  }
  663|      2|  obj2.free();
  664|       |
  665|       |  // save the first trailer dictionary
  666|      2|  if (trailerDict.isNone()) {
  ------------------
  |  Branch (666:7): [True: 1, False: 1]
  ------------------
  667|      1|    obj.copy(&trailerDict);
  668|      1|  }
  669|       |
  670|       |  // check for an 'XRefStm' key
  671|       |  //~ this can be a 64-bit int (?)
  672|      2|  if (obj.getDict()->lookup("XRefStm", &obj2)->isInt()) {
  ------------------
  |  Branch (672:7): [True: 1, False: 1]
  ------------------
  673|      1|    pos2 = (GFileOffset)(Guint)obj2.getInt();
  674|      1|    readXRef(&pos2, posSet, gTrue);
  ------------------
  |  |   17|      1|#define gTrue 1
  ------------------
  675|      1|    if (!ok) {
  ------------------
  |  Branch (675:9): [True: 0, False: 1]
  ------------------
  676|      0|      obj2.free();
  677|      0|      obj.free();
  678|      0|      goto err1;
  679|      0|    }
  680|      1|  }
  681|      2|  obj2.free();
  682|       |
  683|      2|  obj.free();
  684|      2|  return more;
  685|       |
  686|      1| err1:
  687|      1|  ok = gFalse;
  ------------------
  |  |   18|      1|#define gFalse 0
  ------------------
  688|      1|  return gFalse;
  ------------------
  |  |   18|      1|#define gFalse 0
  ------------------
  689|      2|}
_ZN4XRef14readXRefStreamEP6StreamPl:
  691|    182|GBool XRef::readXRefStream(Stream *xrefStr, GFileOffset *pos) {
  692|    182|  Dict *dict;
  693|    182|  int w[3];
  694|    182|  GBool more;
  695|    182|  Object obj, obj2, idx;
  696|    182|  int newSize, first, n, i;
  697|       |
  698|    182|  dict = xrefStr->getDict();
  699|       |
  700|    182|  if (!dict->lookupNF("Size", &obj)->isInt()) {
  ------------------
  |  Branch (700:7): [True: 4, False: 178]
  ------------------
  701|      4|    goto err1;
  702|      4|  }
  703|    178|  newSize = obj.getInt();
  704|    178|  obj.free();
  705|    178|  if (newSize < 0) {
  ------------------
  |  Branch (705:7): [True: 0, False: 178]
  ------------------
  706|      0|    goto err1;
  707|      0|  }
  708|    178|  if (newSize > size) {
  ------------------
  |  Branch (708:7): [True: 116, False: 62]
  ------------------
  709|    116|    entries = (XRefEntry *)greallocn(entries, newSize, sizeof(XRefEntry));
  710|  11.3k|    for (i = size; i < newSize; ++i) {
  ------------------
  |  Branch (710:20): [True: 11.1k, False: 116]
  ------------------
  711|  11.1k|      entries[i].offset = (GFileOffset)-1;
  712|  11.1k|      entries[i].type = xrefEntryFree;
  713|  11.1k|    }
  714|    116|    size = newSize;
  715|    116|  }
  716|       |
  717|    178|  if (!dict->lookupNF("W", &obj)->isArray() ||
  ------------------
  |  Branch (717:7): [True: 1, False: 177]
  ------------------
  718|    177|      obj.arrayGetLength() < 3) {
  ------------------
  |  Branch (718:7): [True: 0, False: 177]
  ------------------
  719|      1|    goto err1;
  720|      1|  }
  721|    706|  for (i = 0; i < 3; ++i) {
  ------------------
  |  Branch (721:15): [True: 530, False: 176]
  ------------------
  722|    530|    if (!obj.arrayGet(i, &obj2)->isInt()) {
  ------------------
  |  Branch (722:9): [True: 1, False: 529]
  ------------------
  723|      1|      obj2.free();
  724|      1|      goto err1;
  725|      1|    }
  726|    529|    w[i] = obj2.getInt();
  727|    529|    obj2.free();
  728|    529|  }
  729|    176|  obj.free();
  730|    176|  if (w[0] < 0 || w[0] > 8 ||
  ------------------
  |  Branch (730:7): [True: 0, False: 176]
  |  Branch (730:19): [True: 0, False: 176]
  ------------------
  731|    176|      w[1] < 0 || w[1] > 8 ||
  ------------------
  |  Branch (731:7): [True: 0, False: 176]
  |  Branch (731:19): [True: 0, False: 176]
  ------------------
  732|    176|      w[2] < 0 || w[2] > 8) {
  ------------------
  |  Branch (732:7): [True: 0, False: 176]
  |  Branch (732:19): [True: 0, False: 176]
  ------------------
  733|      0|    goto err0;
  734|      0|  }
  735|       |
  736|    176|  xrefStr->reset();
  737|    176|  dict->lookupNF("Index", &idx);
  738|    176|  if (idx.isArray()) {
  ------------------
  |  Branch (738:7): [True: 111, False: 65]
  ------------------
  739|    540|    for (i = 0; i+1 < idx.arrayGetLength(); i += 2) {
  ------------------
  |  Branch (739:17): [True: 440, False: 100]
  ------------------
  740|    440|      if (!idx.arrayGet(i, &obj)->isInt()) {
  ------------------
  |  Branch (740:11): [True: 0, False: 440]
  ------------------
  741|      0|	idx.free();
  742|      0|	goto err1;
  743|      0|      }
  744|    440|      first = obj.getInt();
  745|    440|      obj.free();
  746|    440|      if (!idx.arrayGet(i+1, &obj)->isInt()) {
  ------------------
  |  Branch (746:11): [True: 0, False: 440]
  ------------------
  747|      0|	idx.free();
  748|      0|	goto err1;
  749|      0|      }
  750|    440|      n = obj.getInt();
  751|    440|      obj.free();
  752|    440|      if (first < 0 || n < 0 ||
  ------------------
  |  Branch (752:11): [True: 0, False: 440]
  |  Branch (752:24): [True: 1, False: 439]
  ------------------
  753|    439|	  !readXRefStreamSection(xrefStr, w, first, n)) {
  ------------------
  |  Branch (753:4): [True: 10, False: 429]
  ------------------
  754|     11|	idx.free();
  755|     11|	goto err0;
  756|     11|      }
  757|    440|    }
  758|    111|  } else {
  759|     65|    if (!readXRefStreamSection(xrefStr, w, 0, newSize)) {
  ------------------
  |  Branch (759:9): [True: 5, False: 60]
  ------------------
  760|      5|      idx.free();
  761|      5|      goto err0;
  762|      5|    }
  763|     65|  }
  764|    160|  idx.free();
  765|       |
  766|       |  //~ this can be a 64-bit int (?)
  767|    160|  dict->lookupNF("Prev", &obj);
  768|    160|  if (obj.isInt()) {
  ------------------
  |  Branch (768:7): [True: 74, False: 86]
  ------------------
  769|     74|    *pos = (GFileOffset)(Guint)obj.getInt();
  770|     74|    more = gTrue;
  ------------------
  |  |   17|     74|#define gTrue 1
  ------------------
  771|     86|  } else {
  772|     86|    more = gFalse;
  ------------------
  |  |   18|     86|#define gFalse 0
  ------------------
  773|     86|  }
  774|    160|  obj.free();
  775|    160|  if (trailerDict.isNone()) {
  ------------------
  |  Branch (775:7): [True: 100, False: 60]
  ------------------
  776|    100|    trailerDict.initDict(dict);
  777|    100|  }
  778|       |
  779|    160|  return more;
  780|       |
  781|      6| err1:
  782|      6|  obj.free();
  783|     22| err0:
  784|     22|  ok = gFalse;
  ------------------
  |  |   18|     22|#define gFalse 0
  ------------------
  785|     22|  return gFalse;
  ------------------
  |  |   18|     22|#define gFalse 0
  ------------------
  786|      6|}
_ZN4XRef21readXRefStreamSectionEP6StreamPiii:
  788|    504|GBool XRef::readXRefStreamSection(Stream *xrefStr, int *w, int first, int n) {
  789|    504|  long long type, gen, offset;
  790|    504|  int c, newSize, i, j;
  791|       |
  792|    504|  if (first + n < 0) {
  ------------------
  |  Branch (792:7): [True: 1, False: 503]
  ------------------
  793|      1|    return gFalse;
  ------------------
  |  |   18|      1|#define gFalse 0
  ------------------
  794|      1|  }
  795|    503|  if (first + n > size) {
  ------------------
  |  Branch (795:7): [True: 35, False: 468]
  ------------------
  796|     35|    for (newSize = size ? 2 * size : 1024;
  ------------------
  |  Branch (796:20): [True: 35, False: 0]
  ------------------
  797|     81|	 first + n > newSize && newSize > 0;
  ------------------
  |  Branch (797:3): [True: 47, False: 34]
  |  Branch (797:26): [True: 46, False: 1]
  ------------------
  798|     46|	 newSize <<= 1) ;
  799|     35|    if (newSize < 0) {
  ------------------
  |  Branch (799:9): [True: 1, False: 34]
  ------------------
  800|      1|      return gFalse;
  ------------------
  |  |   18|      1|#define gFalse 0
  ------------------
  801|      1|    }
  802|     34|    entries = (XRefEntry *)greallocn(entries, newSize, sizeof(XRefEntry));
  803|    499|    for (i = size; i < newSize; ++i) {
  ------------------
  |  Branch (803:20): [True: 465, False: 34]
  ------------------
  804|    465|      entries[i].offset = (GFileOffset)-1;
  805|    465|      entries[i].type = xrefEntryFree;
  806|    465|    }
  807|     34|    size = newSize;
  808|     34|  }
  809|  4.63k|  for (i = first; i < first + n; ++i) {
  ------------------
  |  Branch (809:19): [True: 4.14k, False: 489]
  ------------------
  810|  4.14k|    if (w[0] == 0) {
  ------------------
  |  Branch (810:9): [True: 456, False: 3.69k]
  ------------------
  811|    456|      type = 1;
  812|  3.69k|    } else {
  813|  7.55k|      for (type = 0, j = 0; j < w[0]; ++j) {
  ------------------
  |  Branch (813:29): [True: 3.86k, False: 3.69k]
  ------------------
  814|  3.86k|	if ((c = xrefStr->getChar()) == EOF) {
  ------------------
  |  Branch (814:6): [True: 2, False: 3.86k]
  ------------------
  815|      2|	  return gFalse;
  ------------------
  |  |   18|      2|#define gFalse 0
  ------------------
  816|      2|	}
  817|  3.86k|	type = (type << 8) + c;
  818|  3.86k|      }
  819|  3.69k|    }
  820|  13.0k|    for (offset = 0, j = 0; j < w[1]; ++j) {
  ------------------
  |  Branch (820:29): [True: 8.88k, False: 4.14k]
  ------------------
  821|  8.88k|      if ((c = xrefStr->getChar()) == EOF) {
  ------------------
  |  Branch (821:11): [True: 0, False: 8.88k]
  ------------------
  822|      0|	return gFalse;
  ------------------
  |  |   18|      0|#define gFalse 0
  ------------------
  823|      0|      }
  824|  8.88k|      offset = (offset << 8) + c;
  825|  8.88k|    }
  826|  4.14k|    if (offset < 0 || offset > GFILEOFFSET_MAX) {
  ------------------
  |  |  128|  4.14k|#define GFILEOFFSET_MAX 0x7fffffffffffffffLL
  ------------------
  |  Branch (826:9): [True: 0, False: 4.14k]
  |  Branch (826:23): [True: 0, False: 4.14k]
  ------------------
  827|      0|      return gFalse;
  ------------------
  |  |   18|      0|#define gFalse 0
  ------------------
  828|      0|    }
  829|  8.36k|    for (gen = 0, j = 0; j < w[2]; ++j) {
  ------------------
  |  Branch (829:26): [True: 4.22k, False: 4.14k]
  ------------------
  830|  4.22k|      if ((c = xrefStr->getChar()) == EOF) {
  ------------------
  |  Branch (830:11): [True: 1, False: 4.22k]
  ------------------
  831|      1|	return gFalse;
  ------------------
  |  |   18|      1|#define gFalse 0
  ------------------
  832|      1|      }
  833|  4.22k|      gen = (gen << 8) + c;
  834|  4.22k|    }
  835|       |    // some PDF generators include a free entry with gen=0xffffffff
  836|  4.14k|    if ((gen < 0 || gen > INT_MAX) && type != 0) {
  ------------------
  |  Branch (836:10): [True: 0, False: 4.14k]
  |  Branch (836:21): [True: 1, False: 4.14k]
  |  Branch (836:39): [True: 1, False: 0]
  ------------------
  837|      1|      return gFalse;
  ------------------
  |  |   18|      1|#define gFalse 0
  ------------------
  838|      1|    }
  839|  4.14k|    if (entries[i].offset == (GFileOffset)-1) {
  ------------------
  |  Branch (839:9): [True: 3.90k, False: 242]
  ------------------
  840|  3.90k|      switch (type) {
  841|    333|      case 0:
  ------------------
  |  Branch (841:7): [True: 333, False: 3.56k]
  ------------------
  842|    333|	entries[i].offset = (GFileOffset)offset;
  843|    333|	entries[i].gen = (int)gen;
  844|    333|	entries[i].type = xrefEntryFree;
  845|    333|	break;
  846|  1.70k|      case 1:
  ------------------
  |  Branch (846:7): [True: 1.70k, False: 2.20k]
  ------------------
  847|  1.70k|	entries[i].offset = (GFileOffset)offset;
  848|  1.70k|	entries[i].gen = (int)gen;
  849|  1.70k|	entries[i].type = xrefEntryUncompressed;
  850|  1.70k|	break;
  851|  1.86k|      case 2:
  ------------------
  |  Branch (851:7): [True: 1.86k, False: 2.04k]
  ------------------
  852|  1.86k|	entries[i].offset = (GFileOffset)offset;
  853|  1.86k|	entries[i].gen = (int)gen;
  854|  1.86k|	entries[i].type = xrefEntryCompressed;
  855|  1.86k|	break;
  856|      9|      default:
  ------------------
  |  Branch (856:7): [True: 9, False: 3.89k]
  ------------------
  857|      9|	return gFalse;
  ------------------
  |  |   18|      9|#define gFalse 0
  ------------------
  858|  3.90k|      }
  859|  3.89k|      if (i > last) {
  ------------------
  |  Branch (859:11): [True: 2.17k, False: 1.72k]
  ------------------
  860|  2.17k|	last = i;
  861|  2.17k|      }
  862|  3.89k|    }
  863|  4.14k|  }
  864|       |
  865|    489|  return gTrue;
  ------------------
  |  |   17|    489|#define gTrue 1
  ------------------
  866|    502|}
_ZN4XRef13constructXRefEv:
  869|  4.73k|GBool XRef::constructXRef() {
  870|  4.73k|  int *streamObjNums = NULL;
  871|  4.73k|  int streamObjNumsLen = 0;
  872|  4.73k|  int streamObjNumsSize = 0;
  873|  4.73k|  int lastObjNum = -1;
  874|  4.73k|  rootNum = -1;
  875|  4.73k|  int streamEndsSize = 0;
  876|  4.73k|  streamEndsLen = 0;
  877|  4.73k|  char buf[4096 + 1];
  878|  4.73k|  str->reset();
  879|  4.73k|  GFileOffset bufPos = start;
  880|  4.73k|  char *p = buf;
  881|  4.73k|  char *end = buf;
  882|  4.73k|  GBool startOfLine = gTrue;
  ------------------
  |  |   17|  4.73k|#define gTrue 1
  ------------------
  883|  4.73k|  GBool space = gTrue;
  ------------------
  |  |   17|  4.73k|#define gTrue 1
  ------------------
  884|  4.73k|  GBool eof = gFalse;
  ------------------
  |  |   18|  4.73k|#define gFalse 0
  ------------------
  885|  45.3M|  while (1) {
  ------------------
  |  Branch (885:10): [True: 45.3M, Folded]
  ------------------
  886|  45.3M|    if (end - p < 256 && !eof) {
  ------------------
  |  Branch (886:9): [True: 1.04M, False: 44.3M]
  |  Branch (886:26): [True: 15.0k, False: 1.03M]
  ------------------
  887|  15.0k|      memcpy(buf, p, end - p);
  888|  15.0k|      bufPos += p - buf;
  889|  15.0k|      p = buf + (end - p);
  890|  15.0k|      int n = (int)(buf + 4096 - p);
  891|  15.0k|      int m = str->getBlock(p, n);
  892|  15.0k|      end = p + m;
  893|  15.0k|      *end = '\0';
  894|  15.0k|      p = buf;
  895|  15.0k|      eof = m < n;
  896|  15.0k|    }
  897|  45.3M|    if (p == end && eof) {
  ------------------
  |  Branch (897:9): [True: 4.73k, False: 45.3M]
  |  Branch (897:21): [True: 4.73k, False: 0]
  ------------------
  898|  4.73k|      break;
  899|  4.73k|    }
  900|  45.3M|    if (startOfLine && !strncmp(p, "trailer", 7)) {
  ------------------
  |  Branch (900:9): [True: 3.01M, False: 42.3M]
  |  Branch (900:24): [True: 22.7k, False: 2.99M]
  ------------------
  901|  22.7k|      constructTrailerDict((GFileOffset)(bufPos + (p + 7 - buf)));
  902|  22.7k|      p += 7;
  903|  22.7k|      startOfLine = gFalse;
  ------------------
  |  |   18|  22.7k|#define gFalse 0
  ------------------
  904|  22.7k|      space = gFalse;
  ------------------
  |  |   18|  22.7k|#define gFalse 0
  ------------------
  905|  45.3M|    } else if (startOfLine && !strncmp(p, "endstream", 9)) {
  ------------------
  |  Branch (905:16): [True: 2.99M, False: 42.3M]
  |  Branch (905:31): [True: 20.5k, False: 2.97M]
  ------------------
  906|  20.5k|      if (streamEndsLen == streamEndsSize) {
  ------------------
  |  Branch (906:11): [True: 2.40k, False: 18.1k]
  ------------------
  907|  2.40k|	streamEndsSize += 64;
  908|  2.40k|	streamEnds = (GFileOffset *)greallocn(streamEnds, streamEndsSize,
  909|  2.40k|					      sizeof(GFileOffset));
  910|  2.40k|      }
  911|  20.5k|      streamEnds[streamEndsLen++] = (GFileOffset)(bufPos + (p - buf));
  912|  20.5k|      p += 9;
  913|  20.5k|      startOfLine = gFalse;
  ------------------
  |  |   18|  20.5k|#define gFalse 0
  ------------------
  914|  20.5k|      space = gFalse;
  ------------------
  |  |   18|  20.5k|#define gFalse 0
  ------------------
  915|  45.3M|    } else if (space && *p >= '0' && *p <= '9') {
  ------------------
  |  Branch (915:16): [True: 10.7M, False: 34.5M]
  |  Branch (915:25): [True: 2.03M, False: 8.70M]
  |  Branch (915:38): [True: 982k, False: 1.04M]
  ------------------
  916|   982k|      p = constructObjectEntry(p, (GFileOffset)(bufPos + (p - buf)),
  917|   982k|			       &lastObjNum);
  918|   982k|      startOfLine = gFalse;
  ------------------
  |  |   18|   982k|#define gFalse 0
  ------------------
  919|   982k|      space = gFalse;
  ------------------
  |  |   18|   982k|#define gFalse 0
  ------------------
  920|  44.3M|    } else if (p[0] == '>' && p[1] == '>') {
  ------------------
  |  Branch (920:16): [True: 818k, False: 43.5M]
  |  Branch (920:31): [True: 531k, False: 287k]
  ------------------
  921|   531k|      p += 2;
  922|   531k|      startOfLine = gFalse;
  ------------------
  |  |   18|   531k|#define gFalse 0
  ------------------
  923|   531k|      space = gFalse;
  ------------------
  |  |   18|   531k|#define gFalse 0
  ------------------
  924|       |      // skip any PDF whitespace except for '\0'
  925|   779k|      while (*p == '\t' || *p == '\n' || *p == '\x0c' ||
  ------------------
  |  Branch (925:14): [True: 1.16k, False: 778k]
  |  Branch (925:28): [True: 28.2k, False: 749k]
  |  Branch (925:42): [True: 179k, False: 570k]
  ------------------
  926|   570k|	     *p == '\r' || *p == ' ') {
  ------------------
  |  Branch (926:7): [True: 25.0k, False: 545k]
  |  Branch (926:21): [True: 13.7k, False: 531k]
  ------------------
  927|   247k|	if (*p == '\n' || *p == '\r') {
  ------------------
  |  Branch (927:6): [True: 28.2k, False: 219k]
  |  Branch (927:20): [True: 25.0k, False: 194k]
  ------------------
  928|  53.3k|	  startOfLine = gTrue;
  ------------------
  |  |   17|  53.3k|#define gTrue 1
  ------------------
  929|  53.3k|	}
  930|   247k|	space = gTrue;
  ------------------
  |  |   17|   247k|#define gTrue 1
  ------------------
  931|   247k|	++p;
  932|   247k|      }
  933|   531k|      if (!strncmp(p, "stream", 6)) {
  ------------------
  |  Branch (933:11): [True: 284k, False: 246k]
  ------------------
  934|   284k|	if (lastObjNum >= 0) {
  ------------------
  |  Branch (934:6): [True: 281k, False: 3.08k]
  ------------------
  935|   281k|	  if (streamObjNumsLen == streamObjNumsSize) {
  ------------------
  |  Branch (935:8): [True: 7.52k, False: 273k]
  ------------------
  936|  7.52k|	    streamObjNumsSize += 64;
  937|  7.52k|	    streamObjNums = (int *)greallocn(streamObjNums, streamObjNumsSize,
  938|  7.52k|					     sizeof(int));
  939|  7.52k|	  }
  940|   281k|	  streamObjNums[streamObjNumsLen++] = lastObjNum;
  941|   281k|	}
  942|   284k|	p += 6;
  943|   284k|	startOfLine = gFalse;
  ------------------
  |  |   18|   284k|#define gFalse 0
  ------------------
  944|   284k|	space = gFalse;
  ------------------
  |  |   18|   284k|#define gFalse 0
  ------------------
  945|   284k|      }
  946|  43.8M|    } else {
  947|  43.8M|      if (*p == '\n' || *p == '\r') {
  ------------------
  |  Branch (947:11): [True: 830k, False: 42.9M]
  |  Branch (947:25): [True: 515k, False: 42.4M]
  ------------------
  948|  1.34M|	startOfLine = gTrue;
  ------------------
  |  |   17|  1.34M|#define gTrue 1
  ------------------
  949|  1.34M|	space = gTrue;
  ------------------
  |  |   17|  1.34M|#define gTrue 1
  ------------------
  950|  42.4M|      } else if (Lexer::isSpace(*p & 0xff)) {
  ------------------
  |  Branch (950:18): [True: 9.33M, False: 33.1M]
  ------------------
  951|  9.33M|	space = gTrue;
  ------------------
  |  |   17|  9.33M|#define gTrue 1
  ------------------
  952|  33.1M|      } else {
  953|  33.1M|	startOfLine = gFalse;
  ------------------
  |  |   18|  33.1M|#define gFalse 0
  ------------------
  954|  33.1M|	space = gFalse;
  ------------------
  |  |   18|  33.1M|#define gFalse 0
  ------------------
  955|  33.1M|      }
  956|  43.8M|      ++p;
  957|  43.8M|    }
  958|  45.3M|  }
  959|       |
  960|       |  // read each stream object, check for xref or object stream
  961|   285k|  for (int i = 0; i < streamObjNumsLen; ++i) {
  ------------------
  |  Branch (961:19): [True: 280k, False: 4.73k]
  ------------------
  962|   280k|    Object obj;
  963|   280k|    fetch(streamObjNums[i], entries[streamObjNums[i]].gen, &obj);
  964|   280k|    if (obj.isStream()) {
  ------------------
  |  Branch (964:9): [True: 236k, False: 44.7k]
  ------------------
  965|   236k|      Dict *dict = obj.streamGetDict();
  966|   236k|      Object type;
  967|   236k|      dict->lookup("Type", &type);
  968|   236k|      if (type.isName("XRef")) {
  ------------------
  |  Branch (968:11): [True: 3.17k, False: 232k]
  ------------------
  969|  3.17k|	saveTrailerDict(dict, gTrue);
  ------------------
  |  |   17|  3.17k|#define gTrue 1
  ------------------
  970|   232k|      } else if (type.isName("ObjStm")) {
  ------------------
  |  Branch (970:18): [True: 210k, False: 22.4k]
  ------------------
  971|   210k|	constructObjectStreamEntries(&obj, streamObjNums[i]);
  972|   210k|      }
  973|   236k|      type.free();
  974|   236k|    }
  975|   280k|    obj.free();
  976|   280k|  }
  977|       |
  978|  4.73k|  gfree(streamObjNums);
  979|       |
  980|       |  // if the file is encrypted, then any objects fetched here will be
  981|       |  // incorrect (because decryption is not yet enabled), so clear the
  982|       |  // cache to avoid that problem
  983|  80.2k|  for (int i = 0; i < xrefCacheSize; ++i) {
  ------------------
  |  |   49|  80.2k|#define xrefCacheSize 16
  ------------------
  |  Branch (983:19): [True: 75.4k, False: 4.73k]
  ------------------
  984|  75.4k|    if (cache[i].num >= 0) {
  ------------------
  |  Branch (984:9): [True: 22.0k, False: 53.4k]
  ------------------
  985|  22.0k|      cache[i].obj.free();
  986|  22.0k|      cache[i].num = -1;
  987|  22.0k|    }
  988|  75.4k|  }
  989|       |
  990|  4.73k|  if (rootNum < 0) {
  ------------------
  |  Branch (990:7): [True: 2.11k, False: 2.62k]
  ------------------
  991|  2.11k|    error(errSyntaxError, -1, "Couldn't find trailer dictionary");
  992|  2.11k|    return gFalse;
  ------------------
  |  |   18|  2.11k|#define gFalse 0
  ------------------
  993|  2.11k|  }
  994|  2.62k|  return gTrue;
  ------------------
  |  |   17|  2.62k|#define gTrue 1
  ------------------
  995|  4.73k|}
_ZN4XRef20constructTrailerDictEl:
  998|  22.7k|void XRef::constructTrailerDict(GFileOffset pos) {
  999|  22.7k|  Object newTrailerDict, obj;
 1000|  22.7k|  obj.initNull();
 1001|  22.7k|  Parser *parser =
 1002|  22.7k|      new Parser(NULL,
 1003|  22.7k|		 new Lexer(NULL,
 1004|  22.7k|			   str->makeSubStream(pos, gFalse, 0, &obj)),
  ------------------
  |  |   18|  22.7k|#define gFalse 0
  ------------------
 1005|  22.7k|		 gFalse);
  ------------------
  |  |   18|  22.7k|#define gFalse 0
  ------------------
 1006|  22.7k|  parser->getObj(&newTrailerDict);
 1007|  22.7k|  if (newTrailerDict.isDict()) {
  ------------------
  |  Branch (1007:7): [True: 15.7k, False: 7.01k]
  ------------------
 1008|  15.7k|    saveTrailerDict(newTrailerDict.getDict(), gFalse);
  ------------------
  |  |   18|  15.7k|#define gFalse 0
  ------------------
 1009|  15.7k|  }
 1010|  22.7k|  newTrailerDict.free();
 1011|  22.7k|  delete parser;
 1012|  22.7k|}
_ZN4XRef15saveTrailerDictEP4Dicti:
 1016|  18.9k|void XRef::saveTrailerDict(Dict *dict, GBool isXRefStream) {
 1017|  18.9k|  Object obj;
 1018|  18.9k|  dict->lookupNF("Root", &obj);
 1019|  18.9k|  if (obj.isRef()) {
  ------------------
  |  Branch (1019:7): [True: 4.62k, False: 14.2k]
  ------------------
 1020|  4.62k|    int newRootNum = obj.getRefNum();
 1021|       |    // the xref stream scanning code runs after all objects are found,
 1022|       |    // so we can check for a valid root object number at that point
 1023|  4.62k|    if (!isXRefStream || newRootNum <= last) {
  ------------------
  |  Branch (1023:9): [True: 1.95k, False: 2.67k]
  |  Branch (1023:26): [True: 2.55k, False: 118]
  ------------------
 1024|  4.50k|      rootNum = newRootNum;
 1025|  4.50k|      rootGen = obj.getRefGen();
 1026|  4.50k|      if (!trailerDict.isNone()) {
  ------------------
  |  Branch (1026:11): [True: 1.96k, False: 2.54k]
  ------------------
 1027|  1.96k|	trailerDict.free();
 1028|  1.96k|      }
 1029|  4.50k|      trailerDict.initDict(dict);
 1030|  4.50k|    }
 1031|  4.62k|  }
 1032|  18.9k|  obj.free();
 1033|  18.9k|}
_ZN4XRef20constructObjectEntryEPclPi:
 1037|   982k|char *XRef::constructObjectEntry(char *p, GFileOffset pos, int *objNum) {
 1038|       |  // we look for non-end-of-line space characters here, to deal with
 1039|       |  // situations like:
 1040|       |  //    nnn          <-- garbage digits on a line
 1041|       |  //    nnn nnn obj  <-- actual object
 1042|       |  // and we also ignore '\0' (because it's used to terminate the
 1043|       |  // buffer in this damage-scanning code)
 1044|   982k|  int num = 0;
 1045|  2.68M|  do {
 1046|  2.68M|    num = (num * 10) + (*p - '0');
 1047|  2.68M|    ++p;
 1048|  2.68M|  } while (*p >= '0' && *p <= '9' && num < 100000000);
  ------------------
  |  Branch (1048:12): [True: 1.87M, False: 810k]
  |  Branch (1048:25): [True: 1.70M, False: 165k]
  |  Branch (1048:38): [True: 1.70M, False: 5.97k]
  ------------------
 1049|   982k|  if (*p != '\t' && *p != '\x0c' && *p != ' ') {
  ------------------
  |  Branch (1049:7): [True: 981k, False: 712]
  |  Branch (1049:21): [True: 915k, False: 66.1k]
  |  Branch (1049:37): [True: 517k, False: 397k]
  ------------------
 1050|   517k|    return p;
 1051|   517k|  }
 1052|   495k|  do {
 1053|   495k|    ++p;
 1054|   495k|  } while (*p == '\t' || *p == '\x0c' || *p == ' ');
  ------------------
  |  Branch (1054:12): [True: 4.00k, False: 491k]
  |  Branch (1054:26): [True: 4.31k, False: 487k]
  |  Branch (1054:42): [True: 22.9k, False: 464k]
  ------------------
 1055|   464k|  if (!(*p >= '0' && *p <= '9')) {
  ------------------
  |  Branch (1055:9): [True: 438k, False: 26.2k]
  |  Branch (1055:22): [True: 322k, False: 116k]
  ------------------
 1056|   142k|    return p;
 1057|   142k|  }
 1058|   322k|  int gen = 0;
 1059|   573k|  do {
 1060|   573k|    gen = (gen * 10) + (*p - '0');
 1061|   573k|    ++p;
 1062|   573k|  } while (*p >= '0' && *p <= '9' && gen < 100000000);
  ------------------
  |  Branch (1062:12): [True: 260k, False: 312k]
  |  Branch (1062:25): [True: 251k, False: 9.32k]
  |  Branch (1062:38): [True: 251k, False: 558]
  ------------------
 1063|   322k|  if (*p != '\t' && *p != '\x0c' && *p != ' ') {
  ------------------
  |  Branch (1063:7): [True: 321k, False: 240]
  |  Branch (1063:21): [True: 318k, False: 3.04k]
  |  Branch (1063:37): [True: 19.0k, False: 299k]
  ------------------
 1064|  19.0k|    return p;
 1065|  19.0k|  }
 1066|   312k|  do {
 1067|   312k|    ++p;
 1068|   312k|  } while (*p == '\t' || *p == '\x0c' || *p == ' ');
  ------------------
  |  Branch (1068:12): [True: 1.29k, False: 310k]
  |  Branch (1068:26): [True: 3.77k, False: 307k]
  |  Branch (1068:42): [True: 4.02k, False: 303k]
  ------------------
 1069|   303k|  if (strncmp(p, "obj", 3)) {
  ------------------
  |  Branch (1069:7): [True: 228k, False: 74.6k]
  ------------------
 1070|   228k|    return p;
 1071|   228k|  }
 1072|       |
 1073|  74.6k|  if (constructXRefEntry(num, gen, pos - start, xrefEntryUncompressed)) {
  ------------------
  |  Branch (1073:7): [True: 74.6k, False: 0]
  ------------------
 1074|  74.6k|    *objNum = num;
 1075|  74.6k|  }
 1076|       |
 1077|  74.6k|  return p;
 1078|   303k|}
_ZN4XRef28constructObjectStreamEntriesEP6Objecti:
 1082|   210k|void XRef::constructObjectStreamEntries(Object *objStr, int objStrObjNum) {
 1083|   210k|  Object obj1, obj2;
 1084|       |
 1085|       |  // get the object count
 1086|   210k|  if (!objStr->streamGetDict()->lookup("N", &obj1)->isInt()) {
  ------------------
  |  Branch (1086:7): [True: 585, False: 209k]
  ------------------
 1087|    585|    obj1.free();
 1088|    585|    return;
 1089|    585|  }
 1090|   209k|  int nObjects = obj1.getInt();
 1091|   209k|  obj1.free();
 1092|   209k|  if (nObjects <= 0 || nObjects > 1000000) {
  ------------------
  |  Branch (1092:7): [True: 208, False: 209k]
  |  Branch (1092:24): [True: 197, False: 209k]
  ------------------
 1093|    405|    return;
 1094|    405|  }
 1095|       |
 1096|       |  // parse the header: object numbers and offsets
 1097|   209k|  Parser *parser = new Parser(NULL,
 1098|   209k|			      new Lexer(NULL, objStr->getStream()->copy()),
 1099|   209k|			      gFalse);
  ------------------
  |  |   18|   209k|#define gFalse 0
  ------------------
 1100|  49.7M|  for (int i = 0; i < nObjects; ++i) {
  ------------------
  |  Branch (1100:19): [True: 49.5M, False: 209k]
  ------------------
 1101|  49.5M|    parser->getObj(&obj1, gTrue);
  ------------------
  |  |   17|  49.5M|#define gTrue 1
  ------------------
 1102|  49.5M|    parser->getObj(&obj2, gTrue);
  ------------------
  |  |   17|  49.5M|#define gTrue 1
  ------------------
 1103|  49.5M|    if (obj1.isInt() && obj2.isInt()) {
  ------------------
  |  Branch (1103:9): [True: 116k, False: 49.4M]
  |  Branch (1103:25): [True: 62.7k, False: 53.7k]
  ------------------
 1104|  62.7k|      int num = obj1.getInt();
 1105|  62.7k|      if (num >= 0 && num < 1000000) {
  ------------------
  |  Branch (1105:11): [True: 62.6k, False: 167]
  |  Branch (1105:23): [True: 61.9k, False: 672]
  ------------------
 1106|  61.9k|	constructXRefEntry(num, i, objStrObjNum, xrefEntryCompressed);
 1107|  61.9k|      }
 1108|  62.7k|    }
 1109|  49.5M|    obj2.free();
 1110|  49.5M|    obj1.free();
 1111|  49.5M|  }
 1112|   209k|  delete parser;
 1113|   209k|}
_ZN4XRef18constructXRefEntryEiil13XRefEntryType:
 1116|   136k|			       XRefEntryType type) {
 1117|   136k|  if (num >= size) {
  ------------------
  |  Branch (1117:7): [True: 5.52k, False: 131k]
  ------------------
 1118|  5.52k|    int newSize = (num + 1 + 255) & ~255;
 1119|  5.52k|    if (newSize < 0) {
  ------------------
  |  Branch (1119:9): [True: 0, False: 5.52k]
  ------------------
 1120|      0|      return gFalse;
  ------------------
  |  |   18|      0|#define gFalse 0
  ------------------
 1121|      0|    }
 1122|  5.52k|    entries = (XRefEntry *)greallocn(entries, newSize, sizeof(XRefEntry));
 1123|  89.2M|    for (int i = size; i < newSize; ++i) {
  ------------------
  |  Branch (1123:24): [True: 89.2M, False: 5.52k]
  ------------------
 1124|  89.2M|      entries[i].offset = (GFileOffset)-1;
 1125|  89.2M|      entries[i].type = xrefEntryFree;
 1126|  89.2M|    }
 1127|  5.52k|    size = newSize;
 1128|  5.52k|  }
 1129|       |
 1130|   136k|  if (entries[num].type == xrefEntryFree ||
  ------------------
  |  Branch (1130:7): [True: 85.3k, False: 51.2k]
  ------------------
 1131|   133k|      gen >= entries[num].gen) {
  ------------------
  |  Branch (1131:7): [True: 48.1k, False: 3.16k]
  ------------------
 1132|   133k|    entries[num].offset = pos;
 1133|   133k|    entries[num].gen = gen;
 1134|   133k|    entries[num].type = type;
 1135|   133k|    if (num > last) {
  ------------------
  |  Branch (1135:9): [True: 25.3k, False: 108k]
  ------------------
 1136|  25.3k|      last = num;
 1137|  25.3k|    }
 1138|   133k|  }
 1139|       |
 1140|   136k|  return gTrue;
  ------------------
  |  |   17|   136k|#define gTrue 1
  ------------------
 1141|   136k|}
_ZN4XRef13setEncryptionEiiPhii14CryptAlgorithm:
 1145|    183|			 CryptAlgorithm encAlgorithmA) {
 1146|    183|  int i;
 1147|       |
 1148|    183|  encrypted = gTrue;
  ------------------
  |  |   17|    183|#define gTrue 1
  ------------------
 1149|    183|  permFlags = permFlagsA;
 1150|    183|  ownerPasswordOk = ownerPasswordOkA;
 1151|    183|  if (keyLengthA <= 32) {
  ------------------
  |  Branch (1151:7): [True: 183, False: 0]
  ------------------
 1152|    183|    keyLength = keyLengthA;
 1153|    183|  } else {
 1154|      0|    keyLength = 32;
 1155|      0|  }
 1156|  4.34k|  for (i = 0; i < keyLength; ++i) {
  ------------------
  |  Branch (1156:15): [True: 4.15k, False: 183]
  ------------------
 1157|  4.15k|    fileKey[i] = fileKeyA[i];
 1158|  4.15k|  }
 1159|    183|  encVersion = encVersionA;
 1160|    183|  encAlgorithm = encAlgorithmA;
 1161|    183|}
_ZN4XRef5fetchEiiP6Objecti:
 1193|  56.4M|Object *XRef::fetch(int num, int gen, Object *obj, int recursion) {
 1194|  56.4M|  XRefEntry *e;
 1195|  56.4M|  Parser *parser;
 1196|  56.4M|  Object obj1, obj2, obj3;
 1197|  56.4M|  XRefCacheEntry tmp;
 1198|  56.4M|  int i, j;
 1199|       |
 1200|       |  // check for bogus ref - this can happen in corrupted PDF files
 1201|  56.4M|  if (num < 0 || num >= size) {
  ------------------
  |  Branch (1201:7): [True: 0, False: 56.4M]
  |  Branch (1201:18): [True: 200k, False: 56.2M]
  ------------------
 1202|   200k|    goto err;
 1203|   200k|  }
 1204|       |
 1205|       |  // check the cache
 1206|  56.2M|#if MULTITHREADED
 1207|  56.2M|  gLockMutex(&cacheMutex);
  ------------------
  |  |   53|  56.2M|#define gLockMutex(m) pthread_mutex_lock(m)
  ------------------
 1208|  56.2M|#endif
 1209|  56.2M|  if (cache[0].num == num && cache[0].gen == gen) {
  ------------------
  |  Branch (1209:7): [True: 746k, False: 55.4M]
  |  Branch (1209:30): [True: 656k, False: 90.3k]
  ------------------
 1210|   656k|    cache[0].obj.copy(obj);
 1211|   656k|#if MULTITHREADED
 1212|   656k|    gUnlockMutex(&cacheMutex);
  ------------------
  |  |   54|   656k|#define gUnlockMutex(m) pthread_mutex_unlock(m)
  ------------------
 1213|   656k|#endif
 1214|   656k|    return obj;
 1215|   656k|  }
 1216|   886M|  for (i = 1; i < xrefCacheSize; ++i) {
  ------------------
  |  |   49|   886M|#define xrefCacheSize 16
  ------------------
  |  Branch (1216:15): [True: 831M, False: 55.3M]
  ------------------
 1217|   831M|    if (cache[i].num == num && cache[i].gen == gen) {
  ------------------
  |  Branch (1217:9): [True: 230k, False: 831M]
  |  Branch (1217:32): [True: 177k, False: 52.6k]
  ------------------
 1218|   177k|      tmp = cache[i];
 1219|   600k|      for (j = i; j > 0; --j) {
  ------------------
  |  Branch (1219:19): [True: 422k, False: 177k]
  ------------------
 1220|   422k|	cache[j] = cache[j - 1];
 1221|   422k|      }
 1222|   177k|      cache[0] = tmp;
 1223|   177k|      cache[0].obj.copy(obj);
 1224|   177k|#if MULTITHREADED
 1225|   177k|      gUnlockMutex(&cacheMutex);
  ------------------
  |  |   54|   177k|#define gUnlockMutex(m) pthread_mutex_unlock(m)
  ------------------
 1226|   177k|#endif
 1227|   177k|      return obj;
 1228|   177k|    }
 1229|   831M|  }
 1230|  55.3M|#if MULTITHREADED
 1231|  55.3M|  gUnlockMutex(&cacheMutex);
  ------------------
  |  |   54|  55.3M|#define gUnlockMutex(m) pthread_mutex_unlock(m)
  ------------------
 1232|  55.3M|#endif
 1233|       |
 1234|  55.3M|  e = &entries[num];
 1235|  55.3M|  switch (e->type) {
 1236|       |
 1237|   227k|  case xrefEntryUncompressed:
  ------------------
  |  Branch (1237:3): [True: 227k, False: 55.1M]
  ------------------
 1238|   227k|    if (e->gen != gen) {
  ------------------
  |  Branch (1238:9): [True: 136k, False: 90.2k]
  ------------------
 1239|   136k|      goto err;
 1240|   136k|    }
 1241|  90.2k|    obj1.initNull();
 1242|  90.2k|    parser = new Parser(this,
 1243|  90.2k|	       new Lexer(this,
 1244|  90.2k|		 str->makeSubStream(start + e->offset, gFalse, 0, &obj1)),
  ------------------
  |  |   18|  90.2k|#define gFalse 0
  ------------------
 1245|  90.2k|	       gTrue);
  ------------------
  |  |   17|  90.2k|#define gTrue 1
  ------------------
 1246|  90.2k|    parser->getObj(&obj1, gTrue);
  ------------------
  |  |   17|  90.2k|#define gTrue 1
  ------------------
 1247|  90.2k|    parser->getObj(&obj2, gTrue);
  ------------------
  |  |   17|  90.2k|#define gTrue 1
  ------------------
 1248|  90.2k|    parser->getObj(&obj3, gTrue);
  ------------------
  |  |   17|  90.2k|#define gTrue 1
  ------------------
 1249|  90.2k|    if (!obj1.isInt() || obj1.getInt() != num ||
  ------------------
  |  Branch (1249:9): [True: 430, False: 89.8k]
  |  Branch (1249:26): [True: 892, False: 88.9k]
  ------------------
 1250|  88.9k|	!obj2.isInt() || obj2.getInt() != gen ||
  ------------------
  |  Branch (1250:2): [True: 179, False: 88.7k]
  |  Branch (1250:19): [True: 363, False: 88.4k]
  ------------------
 1251|  88.4k|	!obj3.isCmd("obj")) {
  ------------------
  |  Branch (1251:2): [True: 3.12k, False: 85.3k]
  ------------------
 1252|  4.98k|      obj1.free();
 1253|  4.98k|      obj2.free();
 1254|  4.98k|      obj3.free();
 1255|  4.98k|      delete parser;
 1256|  4.98k|      goto err;
 1257|  4.98k|    }
 1258|  85.3k|    parser->getObj(obj, gFalse, encrypted ? fileKey : (Guchar *)NULL,
  ------------------
  |  |   18|  85.3k|#define gFalse 0
  ------------------
  |  Branch (1258:33): [True: 4.40k, False: 80.9k]
  ------------------
 1259|  85.3k|		   encAlgorithm, keyLength, num, gen, recursion);
 1260|  85.3k|    obj1.free();
 1261|  85.3k|    obj2.free();
 1262|  85.3k|    obj3.free();
 1263|  85.3k|    delete parser;
 1264|  85.3k|    break;
 1265|       |
 1266|   106k|  case xrefEntryCompressed:
  ------------------
  |  Branch (1266:3): [True: 106k, False: 55.2M]
  ------------------
 1267|       |#if 0 // Adobe apparently ignores the generation number on compressed objects
 1268|       |    if (gen != 0) {
 1269|       |      goto err;
 1270|       |    }
 1271|       |#endif
 1272|   106k|    if (e->offset >= (GFileOffset)size ||
  ------------------
  |  Branch (1272:9): [True: 472, False: 105k]
  ------------------
 1273|   105k|	entries[e->offset].type != xrefEntryUncompressed) {
  ------------------
  |  Branch (1273:2): [True: 486, False: 105k]
  ------------------
 1274|    958|      error(errSyntaxError, -1, "Invalid object stream");
 1275|    958|      goto err;
 1276|    958|    }
 1277|   105k|    if (!getObjectStreamObject((int)e->offset, e->gen, num, obj, recursion)) {
  ------------------
  |  Branch (1277:9): [True: 74.8k, False: 30.2k]
  ------------------
 1278|  74.8k|      goto err;
 1279|  74.8k|    }
 1280|  30.2k|    break;
 1281|       |
 1282|  55.0M|  default:
  ------------------
  |  Branch (1282:3): [True: 55.0M, False: 333k]
  ------------------
 1283|  55.0M|    goto err;
 1284|  55.3M|  }
 1285|       |
 1286|       |  // put the new object in the cache, throwing away the oldest object
 1287|       |  // currently in the cache
 1288|   115k|#if MULTITHREADED
 1289|   115k|  gLockMutex(&cacheMutex);
  ------------------
  |  |   53|   115k|#define gLockMutex(m) pthread_mutex_lock(m)
  ------------------
 1290|   115k|#endif
 1291|   115k|  if (cache[xrefCacheSize - 1].num >= 0) {
  ------------------
  |  |   49|   115k|#define xrefCacheSize 16
  ------------------
  |  Branch (1291:7): [True: 61.8k, False: 53.6k]
  ------------------
 1292|  61.8k|    cache[xrefCacheSize - 1].obj.free();
  ------------------
  |  |   49|  61.8k|#define xrefCacheSize 16
  ------------------
 1293|  61.8k|  }
 1294|  1.84M|  for (i = xrefCacheSize - 1; i > 0; --i) {
  ------------------
  |  |   49|   115k|#define xrefCacheSize 16
  ------------------
  |  Branch (1294:31): [True: 1.73M, False: 115k]
  ------------------
 1295|  1.73M|    cache[i] = cache[i - 1];
 1296|  1.73M|  }
 1297|   115k|  cache[0].num = num;
 1298|   115k|  cache[0].gen = gen;
 1299|   115k|  obj->copy(&cache[0].obj);
 1300|   115k|#if MULTITHREADED
 1301|   115k|  gUnlockMutex(&cacheMutex);
  ------------------
  |  |   54|   115k|#define gUnlockMutex(m) pthread_mutex_unlock(m)
  ------------------
 1302|   115k|#endif
 1303|       |
 1304|   115k|  return obj;
 1305|       |
 1306|  55.4M| err:
 1307|  55.4M|  return obj->initNull();
 1308|  55.3M|}
_ZN4XRef21getObjectStreamObjectEiiiP6Objecti:
 1311|   105k|				  int objNum, Object *obj, int recursion) {
 1312|   105k|  if (recursion >= objectRecursionLimit) {
  ------------------
  |  |   20|   105k|#define objectRecursionLimit 500
  ------------------
  |  Branch (1312:7): [True: 137, False: 104k]
  ------------------
 1313|    137|    return gFalse;
  ------------------
  |  |   18|    137|#define gFalse 0
  ------------------
 1314|    137|  }
 1315|       |
 1316|       |  // check for a cached ObjectStream
 1317|   104k|#if MULTITHREADED
 1318|   104k|  gLockMutex(&objStrsMutex);
  ------------------
  |  |   53|   104k|#define gLockMutex(m) pthread_mutex_lock(m)
  ------------------
 1319|   104k|#endif
 1320|   104k|  ObjectStream *objStr = getObjectStreamFromCache(objStrNum);
 1321|   104k|  GBool found = gFalse;
  ------------------
  |  |   18|   104k|#define gFalse 0
  ------------------
 1322|   104k|  if (objStr) {
  ------------------
  |  Branch (1322:7): [True: 26.3k, False: 78.6k]
  ------------------
 1323|  26.3k|    objStr->getObject(objIdx, objNum, obj);
 1324|  26.3k|    cleanObjectStreamCache();
 1325|  26.3k|    found = gTrue;
  ------------------
  |  |   17|  26.3k|#define gTrue 1
  ------------------
 1326|  26.3k|  }
 1327|   104k|#if MULTITHREADED
 1328|   104k|  gUnlockMutex(&objStrsMutex);
  ------------------
  |  |   54|   104k|#define gUnlockMutex(m) pthread_mutex_unlock(m)
  ------------------
 1329|   104k|#endif
 1330|   104k|  if (found) {
  ------------------
  |  Branch (1330:7): [True: 26.3k, False: 78.6k]
  ------------------
 1331|  26.3k|    return gTrue;
  ------------------
  |  |   17|  26.3k|#define gTrue 1
  ------------------
 1332|  26.3k|  }
 1333|       |
 1334|       |  // load a new ObjectStream
 1335|  78.6k|  objStr = new ObjectStream(this, objStrNum, recursion + 1);
 1336|  78.6k|  if (!objStr->isOk()) {
  ------------------
  |  Branch (1336:7): [True: 74.7k, False: 3.88k]
  ------------------
 1337|  74.7k|    delete objStr;
 1338|  74.7k|    return gFalse;
  ------------------
  |  |   18|  74.7k|#define gFalse 0
  ------------------
 1339|  74.7k|  }
 1340|  3.88k|  objStr->getObject(objIdx, objNum, obj);
 1341|  3.88k|#if MULTITHREADED
 1342|  3.88k|  gLockMutex(&objStrsMutex);
  ------------------
  |  |   53|  3.88k|#define gLockMutex(m) pthread_mutex_lock(m)
  ------------------
 1343|  3.88k|#endif
 1344|  3.88k|  addObjectStreamToCache(objStr);
 1345|  3.88k|  cleanObjectStreamCache();
 1346|  3.88k|#if MULTITHREADED
 1347|  3.88k|  gUnlockMutex(&objStrsMutex);
  ------------------
  |  |   54|  3.88k|#define gUnlockMutex(m) pthread_mutex_unlock(m)
  ------------------
 1348|  3.88k|#endif
 1349|  3.88k|  return gTrue;
  ------------------
  |  |   17|  3.88k|#define gTrue 1
  ------------------
 1350|  78.6k|}
_ZN4XRef24getObjectStreamFromCacheEi:
 1353|   104k|ObjectStream *XRef::getObjectStreamFromCache(int objStrNum) {
 1354|       |  // check the MRU entry in the cache
 1355|   104k|  if (objStrs[0] && objStrs[0]->getObjStrNum() == objStrNum) {
  ------------------
  |  Branch (1355:7): [True: 32.4k, False: 72.4k]
  |  Branch (1355:21): [True: 25.9k, False: 6.48k]
  ------------------
 1356|  25.9k|    ObjectStream *objStr = objStrs[0];
 1357|  25.9k|    objStrLastUse[0] = objStrTime++;
 1358|  25.9k|    return objStr;
 1359|  25.9k|  }
 1360|       |
 1361|       |  // check the rest of the cache
 1362|  87.8k|  for (int i = 1; i < objStrCacheLength; ++i) {
  ------------------
  |  Branch (1362:19): [True: 9.27k, False: 78.6k]
  ------------------
 1363|  9.27k|    if (objStrs[i] && objStrs[i]->getObjStrNum() == objStrNum) {
  ------------------
  |  Branch (1363:9): [True: 9.27k, False: 0]
  |  Branch (1363:23): [True: 366, False: 8.90k]
  ------------------
 1364|    366|      ObjectStream *objStr = objStrs[i];
 1365|    943|      for (int j = i; j > 0; --j) {
  ------------------
  |  Branch (1365:23): [True: 577, False: 366]
  ------------------
 1366|    577|	objStrs[j] = objStrs[j - 1];
 1367|    577|	objStrLastUse[j] = objStrLastUse[j - 1];
 1368|    577|      }
 1369|    366|      objStrs[0] = objStr;
 1370|    366|      objStrLastUse[0] = objStrTime++;
 1371|    366|      return objStr;
 1372|    366|    }
 1373|  9.27k|  }
 1374|       |
 1375|  78.6k|  return NULL;
 1376|  78.9k|}
_ZN4XRef22addObjectStreamToCacheEP12ObjectStream:
 1379|  3.88k|void XRef::addObjectStreamToCache(ObjectStream *objStr) {
 1380|       |  // add to the cache
 1381|  3.88k|  if (objStrCacheLength == objStrCacheSize) {
  ------------------
  |  |   51|  3.88k|#define objStrCacheSize 128
  ------------------
  |  Branch (1381:7): [True: 493, False: 3.39k]
  ------------------
 1382|    493|    delete objStrs[objStrCacheSize - 1];
  ------------------
  |  |   51|    493|#define objStrCacheSize 128
  ------------------
 1383|    493|    --objStrCacheLength;
 1384|    493|  }
 1385|   100k|  for (int j = objStrCacheLength; j > 0; --j) {
  ------------------
  |  Branch (1385:35): [True: 96.9k, False: 3.88k]
  ------------------
 1386|  96.9k|    objStrs[j] = objStrs[j - 1];
 1387|  96.9k|    objStrLastUse[j] = objStrLastUse[j - 1];
 1388|  96.9k|  }
 1389|  3.88k|  ++objStrCacheLength;
 1390|  3.88k|  objStrs[0] = objStr;
 1391|  3.88k|  objStrLastUse[0] = objStrTime++;
 1392|  3.88k|}
_ZN4XRef22cleanObjectStreamCacheEv:
 1399|  30.2k|void XRef::cleanObjectStreamCache() {
 1400|       |  // NB: objStrTime and objStrLastUse[] are unsigned ints, so the
 1401|       |  // mod-2^32 arithmetic makes the subtraction work out, even if the
 1402|       |  // time wraps around.
 1403|  30.2k|  if (objStrCacheLength > 1 &&
  ------------------
  |  Branch (1403:7): [True: 27.0k, False: 3.18k]
  ------------------
 1404|  27.0k|      objStrTime - objStrLastUse[objStrCacheLength - 1]
  ------------------
  |  Branch (1404:7): [True: 0, False: 27.0k]
  ------------------
 1405|  27.0k|        > objStrCacheTimeout) {
  ------------------
  |  |   52|  27.0k|#define objStrCacheTimeout 1000
  ------------------
 1406|      0|    delete objStrs[objStrCacheLength - 1];
 1407|       |    objStrs[objStrCacheLength - 1] = NULL;
 1408|      0|    --objStrCacheLength;
 1409|      0|  }
 1410|  30.2k|}
_ZN4XRef12getStreamEndElPl:
 1421|  98.0k|GBool XRef::getStreamEnd(GFileOffset streamStart, GFileOffset *streamEnd) {
 1422|  98.0k|  int a, b, m;
 1423|       |
 1424|  98.0k|  if (streamEndsLen == 0 ||
  ------------------
  |  Branch (1424:7): [True: 19.2k, False: 78.8k]
  ------------------
 1425|  78.8k|      streamStart > streamEnds[streamEndsLen - 1]) {
  ------------------
  |  Branch (1425:7): [True: 15.3k, False: 63.4k]
  ------------------
 1426|  34.5k|    return gFalse;
  ------------------
  |  |   18|  34.5k|#define gFalse 0
  ------------------
 1427|  34.5k|  }
 1428|       |
 1429|  63.4k|  a = -1;
 1430|  63.4k|  b = streamEndsLen - 1;
 1431|       |  // invariant: streamEnds[a] < streamStart <= streamEnds[b]
 1432|   317k|  while (b - a > 1) {
  ------------------
  |  Branch (1432:10): [True: 254k, False: 63.4k]
  ------------------
 1433|   254k|    m = (a + b) / 2;
 1434|   254k|    if (streamStart <= streamEnds[m]) {
  ------------------
  |  Branch (1434:9): [True: 113k, False: 140k]
  ------------------
 1435|   113k|      b = m;
 1436|   140k|    } else {
 1437|   140k|      a = m;
 1438|   140k|    }
 1439|   254k|  }
 1440|  63.4k|  *streamEnd = streamEnds[b];
 1441|  63.4k|  return gTrue;
  ------------------
  |  |   17|  63.4k|#define gTrue 1
  ------------------
 1442|  98.0k|}
_ZN4XRef15strToFileOffsetEPc:
 1444|    315|GFileOffset XRef::strToFileOffset(char *s) {
 1445|    315|  GFileOffset x, d;
 1446|    315|  char *p;
 1447|       |
 1448|    315|  x = 0;
 1449|  1.02k|  for (p = s; *p && isdigit(*p & 0xff); ++p) {
  ------------------
  |  Branch (1449:15): [True: 1.01k, False: 9]
  |  Branch (1449:21): [True: 723, False: 295]
  ------------------
 1450|    723|    d = *p - '0';
 1451|    723|    if (x > (GFILEOFFSET_MAX - d) / 10) {
  ------------------
  |  |  128|    723|#define GFILEOFFSET_MAX 0x7fffffffffffffffLL
  ------------------
  |  Branch (1451:9): [True: 11, False: 712]
  ------------------
 1452|     11|      break;
 1453|     11|    }
 1454|    712|    x = 10 * x + d;
 1455|    712|  }
 1456|    315|  return x;
 1457|    315|}
_ZN10XRefPosSet9getLengthEv:
   54|    198|  int getLength() { return len; }
_ZN10XRefPosSet3getEi:
   55|    273|  GFileOffset get(int idx) { return tab[idx]; }
_ZN12ObjectStream4isOkEv:
  134|  78.6k|  GBool isOk() { return ok; }
_ZN12ObjectStream12getObjStrNumEv:
  139|  41.7k|  int getObjStrNum() { return objStrNum; }

_ZN4XRef13getNumObjectsEv:
  101|   143k|  int getNumObjects() { return last + 1; }
_ZN4XRef4isOkEv:
   64|  9.34k|  GBool isOk() { return ok; }
_ZN4XRef12getErrorCodeEv:
   67|  6.73k|  int getErrorCode() { return errCode; }
_ZN4XRef10getCatalogEP6Object:
   91|  2.58k|  Object *getCatalog(Object *obj) { return fetch(rootNum, rootGen, obj); }
_ZN4XRef14getTrailerDictEv:
  124|  2.82k|  Object *getTrailerDict() { return &trailerDict; }

_ZN6ZxNodeC2Ev:
   64|  1.73M|ZxNode::ZxNode() {
   65|  1.73M|  next = NULL;
   66|  1.73M|  parent = NULL;
   67|       |  firstChild = lastChild = NULL;
   68|  1.73M|}
_ZN6ZxNodeD2Ev:
   70|  1.73M|ZxNode::~ZxNode() {
   71|  1.73M|  ZxNode *child;
   72|       |
   73|  3.46M|  while (firstChild) {
  ------------------
  |  Branch (73:10): [True: 1.73M, False: 1.73M]
  ------------------
   74|  1.73M|    child = firstChild;
   75|  1.73M|    firstChild = firstChild->next;
   76|  1.73M|    delete child;
   77|  1.73M|  }
   78|  1.73M|}
_ZN6ZxNode21findFirstChildElementEPKc:
  143|   178k|ZxElement *ZxNode::findFirstChildElement(const char *type) {
  144|   178k|  ZxNode *child;
  145|       |
  146|   608k|  for (child = firstChild; child; child = child->next) {
  ------------------
  |  Branch (146:28): [True: 438k, False: 169k]
  ------------------
  147|   438k|    if (child->isElement(type)) {
  ------------------
  |  Branch (147:9): [True: 9.09k, False: 429k]
  ------------------
  148|  9.09k|      return (ZxElement *)child;
  149|  9.09k|    }
  150|   438k|  }
  151|   169k|  return NULL;
  152|   178k|}
_ZN6ZxNode8addChildEPS_:
  186|  1.73M|void ZxNode::addChild(ZxNode *child) {
  187|  1.73M|  if (lastChild) {
  ------------------
  |  Branch (187:7): [True: 1.43M, False: 301k]
  ------------------
  188|  1.43M|    lastChild->next = child;
  189|  1.43M|    lastChild = child;
  190|  1.43M|  } else {
  191|   301k|    firstChild = lastChild = child;
  192|   301k|  }
  193|  1.73M|  child->parent = this;
  194|       |  child->next = NULL;
  195|  1.73M|}
_ZN5ZxDocC2Ev:
  199|  1.15k|ZxDoc::ZxDoc() {
  200|  1.15k|  xmlDecl = NULL;
  201|  1.15k|  docTypeDecl = NULL;
  202|       |  root = NULL;
  203|  1.15k|}
_ZN5ZxDoc7loadMemEPKcj:
  205|  1.15k|ZxDoc *ZxDoc::loadMem(const char *data, Guint dataLen) {
  206|  1.15k|  ZxDoc *doc;
  207|       |
  208|  1.15k|  doc = new ZxDoc();
  209|  1.15k|  if (!doc->parse(data, dataLen)) {
  ------------------
  |  Branch (209:7): [True: 349, False: 801]
  ------------------
  210|    349|    delete doc;
  211|    349|    return NULL;
  212|    349|  }
  213|    801|  return doc;
  214|  1.15k|}
_ZN5ZxDoc8addChildEP6ZxNode:
  262|  1.86k|void ZxDoc::addChild(ZxNode *node) {
  263|  1.86k|  if (node->isXMLDecl() && !xmlDecl) {
  ------------------
  |  Branch (263:7): [True: 501, False: 1.35k]
  |  Branch (263:28): [True: 501, False: 0]
  ------------------
  264|    501|    xmlDecl = (ZxXMLDecl *)node;
  265|  1.35k|  } else if (node->isDocTypeDecl() && !docTypeDecl) {
  ------------------
  |  Branch (265:14): [True: 41, False: 1.31k]
  |  Branch (265:39): [True: 41, False: 0]
  ------------------
  266|     41|    docTypeDecl = (ZxDocTypeDecl *)node;
  267|  1.31k|  } else if (node->isElement() && !root) {
  ------------------
  |  Branch (267:14): [True: 801, False: 517]
  |  Branch (267:35): [True: 801, False: 0]
  ------------------
  268|    801|    root = (ZxElement *)node;
  269|    801|  }
  270|  1.86k|  ZxNode::addChild(node);
  271|  1.86k|}
_ZN5ZxDoc5parseEPKcj:
  273|  1.15k|bool ZxDoc::parse(const char *data, Guint dataLen) {
  274|  1.15k|  parsePtr = data;
  275|  1.15k|  parseEnd = data + dataLen;
  276|       |  
  277|  1.15k|  parseSpace();
  278|  1.15k|  parseBOM();
  279|  1.15k|  parseSpace();
  280|  1.15k|  parseXMLDecl(this);
  281|  1.15k|  parseMisc(this);
  282|  1.15k|  parseDocTypeDecl(this);
  283|  1.15k|  parseMisc(this);
  284|  1.15k|  if (match("<")) {
  ------------------
  |  Branch (284:7): [True: 801, False: 349]
  ------------------
  285|    801|    parseElement(this);
  286|    801|  }
  287|  1.15k|  parseMisc(this);
  288|       |  return root != NULL;
  289|  1.15k|}
_ZN5ZxDoc12parseXMLDeclEP6ZxNode:
  291|  1.15k|void ZxDoc::parseXMLDecl(ZxNode *par) {
  292|  1.15k|  GString *version, *encoding, *s;
  293|  1.15k|  bool standalone;
  294|       |
  295|  1.15k|  if (!match("<?xml")) {
  ------------------
  |  Branch (295:7): [True: 649, False: 501]
  ------------------
  296|    649|    return;
  297|    649|  }
  298|    501|  parsePtr += 5;
  299|    501|  parseSpace();
  300|       |
  301|       |  // version
  302|    501|  version = NULL;
  303|    501|  if (match("version")) {
  ------------------
  |  Branch (303:7): [True: 475, False: 26]
  ------------------
  304|    475|    parsePtr += 7;
  305|    475|    parseSpace();
  306|    475|    if (match("=")) {
  ------------------
  |  Branch (306:9): [True: 459, False: 16]
  ------------------
  307|    459|      ++parsePtr;
  308|    459|      parseSpace();
  309|    459|      version = parseQuotedString();
  310|    459|    }
  311|    475|  }
  312|    501|  if (!version) {
  ------------------
  |  Branch (312:7): [True: 42, False: 459]
  ------------------
  313|     42|    version = new GString("1.0");
  314|     42|  }
  315|    501|  parseSpace();
  316|       |	
  317|       |  // encoding
  318|    501|  encoding = NULL;
  319|    501|  if (match("encoding")) {
  ------------------
  |  Branch (319:7): [True: 337, False: 164]
  ------------------
  320|    337|    parsePtr += 8;
  321|    337|    parseSpace();
  322|    337|    if (match("=")) {
  ------------------
  |  Branch (322:9): [True: 311, False: 26]
  ------------------
  323|    311|      ++parsePtr;
  324|    311|      parseSpace();
  325|    311|      encoding = parseQuotedString();
  326|    311|    }
  327|    337|  }
  328|    501|  parseSpace();
  329|       |
  330|       |  // standalone
  331|    501|  standalone = false;
  332|    501|  if (match("standalone")) {
  ------------------
  |  Branch (332:7): [True: 67, False: 434]
  ------------------
  333|     67|    parsePtr += 10;
  334|     67|    parseSpace();
  335|     67|    if (match("=")) {
  ------------------
  |  Branch (335:9): [True: 49, False: 18]
  ------------------
  336|     49|      ++parsePtr;
  337|     49|      parseSpace();
  338|     49|      s = parseQuotedString();
  339|     49|      standalone = !s->cmp("yes");
  340|     49|      delete s;
  341|     49|    }
  342|     67|  }
  343|    501|  parseSpace();
  344|       |
  345|    501|  if (match("?>")) {
  ------------------
  |  Branch (345:7): [True: 268, False: 233]
  ------------------
  346|    268|    parsePtr += 2;
  347|    268|  }
  348|       |
  349|    501|  par->addChild(new ZxXMLDecl(version, encoding, standalone));
  350|    501|}
_ZN5ZxDoc16parseDocTypeDeclEP6ZxNode:
  353|  1.15k|void ZxDoc::parseDocTypeDecl(ZxNode *par) {
  354|  1.15k|  GString *name;
  355|  1.15k|  int state;
  356|  1.15k|  char c, quote;
  357|       |
  358|  1.15k|  if (!match("<!DOCTYPE")) {
  ------------------
  |  Branch (358:7): [True: 1.10k, False: 41]
  ------------------
  359|  1.10k|    return;
  360|  1.10k|  }
  361|     41|  parsePtr += 9;
  362|     41|  parseSpace();
  363|       |
  364|     41|  name = parseName();
  365|     41|  parseSpace();
  366|       |
  367|     41|  state = 0;
  368|     41|  quote = '\0';
  369|   413k|  while (parsePtr < parseEnd && state < 4) {
  ------------------
  |  Branch (369:10): [True: 413k, False: 19]
  |  Branch (369:33): [True: 413k, False: 22]
  ------------------
  370|   413k|    c = *parsePtr++;
  371|   413k|    switch (state) {
  ------------------
  |  Branch (371:13): [True: 413k, False: 0]
  ------------------
  372|  44.7k|    case 0: // not in square brackets; not in quotes
  ------------------
  |  Branch (372:5): [True: 44.7k, False: 368k]
  ------------------
  373|  44.7k|      if (c == '>') {
  ------------------
  |  Branch (373:11): [True: 22, False: 44.7k]
  ------------------
  374|     22|	state = 4;
  375|  44.7k|      } else if (c == '"' || c == '\'') {
  ------------------
  |  Branch (375:18): [True: 570, False: 44.1k]
  |  Branch (375:30): [True: 99, False: 44.0k]
  ------------------
  376|    669|	state = 1;
  377|  44.0k|      } else if (c == '[') {
  ------------------
  |  Branch (377:18): [True: 653, False: 43.4k]
  ------------------
  378|    653|	state = 2;
  379|    653|      }
  380|  44.7k|      break;
  381|  74.0k|    case 1: // not in square brackets; in quotes
  ------------------
  |  Branch (381:5): [True: 74.0k, False: 338k]
  ------------------
  382|  74.0k|      if (c == quote) {
  ------------------
  |  Branch (382:11): [True: 665, False: 73.3k]
  ------------------
  383|    665|	state = 0;
  384|    665|      }
  385|  74.0k|      break;
  386|   201k|    case 2: // in square brackets; not in quotes
  ------------------
  |  Branch (386:5): [True: 201k, False: 211k]
  ------------------
  387|   201k|      if (c == ']') {
  ------------------
  |  Branch (387:11): [True: 642, False: 200k]
  ------------------
  388|    642|	state = 0;
  389|   200k|      } else if (c == '"' || c == '\'') {
  ------------------
  |  Branch (389:18): [True: 722, False: 199k]
  |  Branch (389:30): [True: 454, False: 199k]
  ------------------
  390|  1.17k|	state = 3;
  391|  1.17k|      }
  392|   201k|      break;
  393|  93.1k|    case 3: // in square brackets; in quotes
  ------------------
  |  Branch (393:5): [True: 93.1k, False: 319k]
  ------------------
  394|  93.1k|      if (c == quote) {
  ------------------
  |  Branch (394:11): [True: 1.17k, False: 91.9k]
  ------------------
  395|  1.17k|	state = 2;
  396|  1.17k|      }
  397|  93.1k|      break;
  398|   413k|    }
  399|   413k|  }
  400|       |
  401|     41|  par->addChild(new ZxDocTypeDecl(name));
  402|     41|}
_ZN5ZxDoc12parseElementEP6ZxNode:
  405|  1.03M|void ZxDoc::parseElement(ZxNode *par) {
  406|  1.03M|  GString *type;
  407|  1.03M|  ZxElement *elem;
  408|  1.03M|  ZxAttr *attr;
  409|       |
  410|  1.03M|  ++parsePtr;
  411|  1.03M|  type = parseName();
  412|  1.03M|  elem = new ZxElement(type);
  413|  1.03M|  parseSpace();
  414|  1.14M|  while ((attr = parseAttr())) {
  ------------------
  |  Branch (414:10): [True: 113k, False: 1.03M]
  ------------------
  415|   113k|    elem->addAttr(attr);
  416|   113k|    parseSpace();
  417|   113k|  }
  418|  1.03M|  if (match("/>")) {
  ------------------
  |  Branch (418:7): [True: 23.9k, False: 1.00M]
  ------------------
  419|  23.9k|    parsePtr += 2;
  420|  1.00M|  } else if (match(">")) {
  ------------------
  |  Branch (420:14): [True: 300k, False: 706k]
  ------------------
  421|   300k|    ++parsePtr;
  422|   300k|    parseContent(elem);
  423|   300k|  }
  424|  1.03M|  par->addChild(elem);
  425|  1.03M|}
_ZN5ZxDoc9parseAttrEv:
  427|  1.14M|ZxAttr *ZxDoc::parseAttr() {
  428|  1.14M|  GString *name, *value;
  429|  1.14M|  const char *start;
  430|  1.14M|  char quote, c;
  431|  1.14M|  unsigned int x;
  432|  1.14M|  int n;
  433|       |
  434|  1.14M|  name = parseName();
  435|  1.14M|  parseSpace();
  436|  1.14M|  if (!match("=")) {
  ------------------
  |  Branch (436:7): [True: 1.00M, False: 135k]
  ------------------
  437|  1.00M|    delete name;
  438|  1.00M|    return NULL;
  439|  1.00M|  }
  440|   135k|  ++parsePtr;
  441|   135k|  parseSpace();
  442|   135k|  if (!(parsePtr < parseEnd && (*parsePtr == '"' || *parsePtr == '\''))) {
  ------------------
  |  Branch (442:9): [True: 135k, False: 5]
  |  Branch (442:33): [True: 112k, False: 22.8k]
  |  Branch (442:53): [True: 566, False: 22.3k]
  ------------------
  443|  22.3k|    delete name;
  444|  22.3k|    return NULL;
  445|  22.3k|  }
  446|   113k|  quote = *parsePtr++;
  447|   113k|  value = new GString();
  448|   291k|  while (parsePtr < parseEnd && *parsePtr != quote) {
  ------------------
  |  Branch (448:10): [True: 291k, False: 103]
  |  Branch (448:33): [True: 177k, False: 113k]
  ------------------
  449|   177k|    if (*parsePtr == '&') {
  ------------------
  |  Branch (449:9): [True: 42.7k, False: 135k]
  ------------------
  450|  42.7k|      ++parsePtr;
  451|  42.7k|      if (parsePtr < parseEnd && *parsePtr == '#') {
  ------------------
  |  Branch (451:11): [True: 42.7k, False: 3]
  |  Branch (451:34): [True: 22.2k, False: 20.5k]
  ------------------
  452|  22.2k|	++parsePtr;
  453|  22.2k|	if (parsePtr < parseEnd && *parsePtr == 'x') {
  ------------------
  |  Branch (453:6): [True: 22.2k, False: 2]
  |  Branch (453:29): [True: 10.8k, False: 11.4k]
  ------------------
  454|  10.8k|	  ++parsePtr;
  455|  10.8k|	  x = 0;
  456|  18.1k|	  while (parsePtr < parseEnd) {
  ------------------
  |  Branch (456:11): [True: 18.0k, False: 8]
  ------------------
  457|  18.0k|	    c = *parsePtr;
  458|  18.0k|	    if (c >= '0' && c <= '9') {
  ------------------
  |  Branch (458:10): [True: 14.3k, False: 3.71k]
  |  Branch (458:22): [True: 1.87k, False: 12.5k]
  ------------------
  459|  1.87k|	      x = (x << 4) + (c - '0');
  460|  16.2k|	    } else if (c >= 'a' && c <= 'f') {
  ------------------
  |  Branch (460:17): [True: 7.34k, False: 8.87k]
  |  Branch (460:29): [True: 2.42k, False: 4.91k]
  ------------------
  461|  2.42k|	      x = (x << 4) + (10 + c - 'a');
  462|  13.7k|	    } else if (c >= 'A' && c <= 'F') {
  ------------------
  |  Branch (462:17): [True: 8.47k, False: 5.32k]
  |  Branch (462:29): [True: 2.95k, False: 5.51k]
  ------------------
  463|  2.95k|	      x = (x << 4) + (10 + c - 'A');
  464|  10.8k|	    } else {
  465|  10.8k|	      break;
  466|  10.8k|	    }
  467|  7.25k|	    ++parsePtr;
  468|  7.25k|	  }
  469|  10.8k|	  if (parsePtr < parseEnd && *parsePtr == ';') {
  ------------------
  |  Branch (469:8): [True: 10.8k, False: 8]
  |  Branch (469:31): [True: 349, False: 10.4k]
  ------------------
  470|    349|	    ++parsePtr;
  471|    349|	  }
  472|  10.8k|	  appendUTF8(value, x);
  473|  11.4k|	} else {
  474|  11.4k|	  x = 0;
  475|  12.3k|	  while (parsePtr < parseEnd) {
  ------------------
  |  Branch (475:11): [True: 12.3k, False: 3]
  ------------------
  476|  12.3k|	    c = *parsePtr;
  477|  12.3k|	    if (c >= '0' && c <= '9') {
  ------------------
  |  Branch (477:10): [True: 7.53k, False: 4.82k]
  |  Branch (477:22): [True: 948, False: 6.58k]
  ------------------
  478|    948|	      x = x * 10 + (c - '0');
  479|  11.4k|	    } else {
  480|  11.4k|	      break;
  481|  11.4k|	    }
  482|    948|	    ++parsePtr;
  483|    948|	  }
  484|  11.4k|	  if (parsePtr < parseEnd && *parsePtr == ';') {
  ------------------
  |  Branch (484:8): [True: 11.4k, False: 3]
  |  Branch (484:31): [True: 266, False: 11.1k]
  ------------------
  485|    266|	    ++parsePtr;
  486|    266|	  }
  487|  11.4k|	  appendUTF8(value, x);
  488|  11.4k|	}
  489|  22.2k|      } else {
  490|  20.5k|	start = parsePtr;
  491|  20.5k|	for (++parsePtr;
  492|  1.41M|	     parsePtr < parseEnd && *parsePtr != ';' &&
  ------------------
  |  Branch (492:7): [True: 1.41M, False: 22]
  |  Branch (492:30): [True: 1.41M, False: 321]
  ------------------
  493|  1.41M|	       *parsePtr != quote && *parsePtr != '&';
  ------------------
  |  Branch (493:9): [True: 1.40M, False: 5.53k]
  |  Branch (493:31): [True: 1.39M, False: 14.6k]
  ------------------
  494|  1.39M|	     ++parsePtr) ;
  495|  20.5k|	n = (int)(parsePtr - start);
  496|  20.5k|	if (parsePtr < parseEnd && *parsePtr == ';') {
  ------------------
  |  Branch (496:6): [True: 20.4k, False: 22]
  |  Branch (496:29): [True: 321, False: 20.1k]
  ------------------
  497|    321|	  ++parsePtr;
  498|    321|	}
  499|  20.5k|	if (n == 2 && !strncmp(start, "lt", 2)) {
  ------------------
  |  Branch (499:6): [True: 1.84k, False: 18.6k]
  |  Branch (499:16): [True: 274, False: 1.57k]
  ------------------
  500|    274|	  value->append('<');
  501|  20.2k|	} else if (n == 2 && !strncmp(start, "gt", 2)) {
  ------------------
  |  Branch (501:13): [True: 1.57k, False: 18.6k]
  |  Branch (501:23): [True: 294, False: 1.27k]
  ------------------
  502|    294|	  value->append('>');
  503|  19.9k|	} else if (n == 3 && !strncmp(start, "amp", 3)) {
  ------------------
  |  Branch (503:13): [True: 614, False: 19.3k]
  |  Branch (503:23): [True: 0, False: 614]
  ------------------
  504|      0|	  value->append('&');
  505|  19.9k|	} else if (n == 4 && !strncmp(start, "apos", 4)) {
  ------------------
  |  Branch (505:13): [True: 601, False: 19.3k]
  |  Branch (505:23): [True: 0, False: 601]
  ------------------
  506|      0|	  value->append('\'');
  507|  19.9k|	} else if (n == 4 && !strncmp(start, "quot", 4)) {
  ------------------
  |  Branch (507:13): [True: 601, False: 19.3k]
  |  Branch (507:23): [True: 0, False: 601]
  ------------------
  508|      0|	  value->append('"');
  509|  19.9k|	} else {
  510|  19.9k|	  value->append(start - 1, (int)(parsePtr - start) + 1);
  511|  19.9k|	}
  512|  20.5k|      }
  513|   135k|    } else {
  514|   135k|      start = parsePtr;
  515|   135k|      for (++parsePtr;
  516|  13.6M|	   parsePtr < parseEnd && *parsePtr != quote && *parsePtr != '&';
  ------------------
  |  Branch (516:5): [True: 13.6M, False: 68]
  |  Branch (516:28): [True: 13.5M, False: 106k]
  |  Branch (516:50): [True: 13.4M, False: 28.1k]
  ------------------
  517|  13.4M|	   ++parsePtr) ;
  518|   135k|      value->append(start, (int)(parsePtr - start));
  519|   135k|    }
  520|   177k|  }
  521|   113k|  if (parsePtr < parseEnd && *parsePtr == quote) {
  ------------------
  |  Branch (521:7): [True: 113k, False: 103]
  |  Branch (521:30): [True: 113k, False: 0]
  ------------------
  522|   113k|    ++parsePtr;
  523|   113k|  }
  524|   113k|  return new ZxAttr(name, value);
  525|   135k|}
_ZN5ZxDoc12parseContentEP9ZxElement:
  528|   300k|void ZxDoc::parseContent(ZxElement *par) {
  529|   300k|  GString *endType;
  530|       |
  531|   300k|  endType = (new GString("</"))->append(par->getType());
  532|       |
  533|  2.03M|  while (parsePtr < parseEnd) {
  ------------------
  |  Branch (533:10): [True: 1.78M, False: 243k]
  ------------------
  534|  1.78M|    if (match(endType->getCString())) {
  ------------------
  |  Branch (534:9): [True: 57.0k, False: 1.73M]
  ------------------
  535|  57.0k|      parsePtr += endType->getLength();
  536|  57.0k|      parseSpace();
  537|  57.0k|      if (match(">")) {
  ------------------
  |  Branch (537:11): [True: 38.2k, False: 18.7k]
  ------------------
  538|  38.2k|	++parsePtr;
  539|  38.2k|      }
  540|  57.0k|      break;
  541|  1.73M|    } else if (match("<?")) {
  ------------------
  |  Branch (541:16): [True: 11.8k, False: 1.72M]
  ------------------
  542|  11.8k|      parsePI(par);
  543|  1.72M|    } else if (match("<![CDATA[")) {
  ------------------
  |  Branch (543:16): [True: 47, False: 1.72M]
  ------------------
  544|     47|      parseCDSect(par);
  545|  1.72M|    } else if (match("<!--")) {
  ------------------
  |  Branch (545:16): [True: 1.92k, False: 1.71M]
  ------------------
  546|  1.92k|      parseComment(par);
  547|  1.71M|    } else if (match("<")) {
  ------------------
  |  Branch (547:16): [True: 1.03M, False: 687k]
  ------------------
  548|  1.03M|      parseElement(par);
  549|  1.03M|    } else {
  550|   687k|      parseCharData(par);
  551|   687k|    }
  552|  1.78M|  }
  553|       |
  554|   300k|  delete endType;
  555|   300k|}
_ZN5ZxDoc13parseCharDataEP9ZxElement:
  557|   687k|void ZxDoc::parseCharData(ZxElement *par) {
  558|   687k|  GString *data;
  559|   687k|  const char *start;
  560|   687k|  char c;
  561|   687k|  unsigned int x;
  562|   687k|  int n;
  563|       |
  564|   687k|  data = new GString();
  565|  1.72M|  while (parsePtr < parseEnd && *parsePtr != '<') {
  ------------------
  |  Branch (565:10): [True: 1.72M, False: 500]
  |  Branch (565:33): [True: 1.04M, False: 687k]
  ------------------
  566|  1.04M|    if (*parsePtr == '&') {
  ------------------
  |  Branch (566:9): [True: 259k, False: 783k]
  ------------------
  567|   259k|      ++parsePtr;
  568|   259k|      if (parsePtr < parseEnd && *parsePtr == '#') {
  ------------------
  |  Branch (568:11): [True: 258k, False: 10]
  |  Branch (568:34): [True: 123k, False: 135k]
  ------------------
  569|   123k|	++parsePtr;
  570|   123k|	if (parsePtr < parseEnd && *parsePtr == 'x') {
  ------------------
  |  Branch (570:6): [True: 123k, False: 3]
  |  Branch (570:29): [True: 11.8k, False: 111k]
  ------------------
  571|  11.8k|	  ++parsePtr;
  572|  11.8k|	  x = 0;
  573|  20.1k|	  while (parsePtr < parseEnd) {
  ------------------
  |  Branch (573:11): [True: 20.1k, False: 4]
  ------------------
  574|  20.1k|	    c = *parsePtr;
  575|  20.1k|	    if (c >= '0' && c <= '9') {
  ------------------
  |  Branch (575:10): [True: 14.8k, False: 5.29k]
  |  Branch (575:22): [True: 1.45k, False: 13.3k]
  ------------------
  576|  1.45k|	      x = (x << 4) + (c - '0');
  577|  18.6k|	    } else if (c >= 'a' && c <= 'f') {
  ------------------
  |  Branch (577:17): [True: 6.30k, False: 12.3k]
  |  Branch (577:29): [True: 1.98k, False: 4.31k]
  ------------------
  578|  1.98k|	      x = (x << 4) + (10 + c - 'a');
  579|  16.7k|	    } else if (c >= 'A' && c <= 'F') {
  ------------------
  |  Branch (579:17): [True: 9.99k, False: 6.70k]
  |  Branch (579:29): [True: 4.89k, False: 5.10k]
  ------------------
  580|  4.89k|	      x = (x << 4) + (10 + c - 'A');
  581|  11.8k|	    } else {
  582|  11.8k|	      break;
  583|  11.8k|	    }
  584|  8.32k|	    ++parsePtr;
  585|  8.32k|	  }
  586|  11.8k|	  if (parsePtr < parseEnd && *parsePtr == ';') {
  ------------------
  |  Branch (586:8): [True: 11.8k, False: 4]
  |  Branch (586:31): [True: 220, False: 11.5k]
  ------------------
  587|    220|	    ++parsePtr;
  588|    220|	  }
  589|  11.8k|	  appendUTF8(data, x);
  590|   111k|	} else {
  591|   111k|	  x = 0;
  592|   121k|	  while (parsePtr < parseEnd) {
  ------------------
  |  Branch (592:11): [True: 121k, False: 6]
  ------------------
  593|   121k|	    c = *parsePtr;
  594|   121k|	    if (c >= '0' && c <= '9') {
  ------------------
  |  Branch (594:10): [True: 49.9k, False: 71.2k]
  |  Branch (594:22): [True: 9.71k, False: 40.2k]
  ------------------
  595|  9.71k|	      x = x * 10 + (c - '0');
  596|   111k|	    } else {
  597|   111k|	      break;
  598|   111k|	    }
  599|  9.71k|	    ++parsePtr;
  600|  9.71k|	  }
  601|   111k|	  if (parsePtr < parseEnd && *parsePtr == ';') {
  ------------------
  |  Branch (601:8): [True: 111k, False: 6]
  |  Branch (601:31): [True: 396, False: 111k]
  ------------------
  602|    396|	    ++parsePtr;
  603|    396|	  }
  604|   111k|	  appendUTF8(data, x);
  605|   111k|	}
  606|   135k|      } else {
  607|   135k|	start = parsePtr;
  608|   135k|	for (++parsePtr;
  609|  5.96M|	     parsePtr < parseEnd && *parsePtr != ';' &&
  ------------------
  |  Branch (609:7): [True: 5.96M, False: 64]
  |  Branch (609:30): [True: 5.96M, False: 577]
  ------------------
  610|  5.96M|	       *parsePtr != '<' && *parsePtr != '&';
  ------------------
  |  Branch (610:9): [True: 5.91M, False: 49.2k]
  |  Branch (610:29): [True: 5.82M, False: 85.7k]
  ------------------
  611|  5.82M|	     ++parsePtr) ;
  612|   135k|	n = (int)(parsePtr - start);
  613|   135k|	if (parsePtr < parseEnd && *parsePtr == ';') {
  ------------------
  |  Branch (613:6): [True: 135k, False: 64]
  |  Branch (613:29): [True: 577, False: 135k]
  ------------------
  614|    577|	  ++parsePtr;
  615|    577|	}
  616|   135k|	if (n == 2 && !strncmp(start, "lt", 2)) {
  ------------------
  |  Branch (616:6): [True: 3.24k, False: 132k]
  |  Branch (616:16): [True: 478, False: 2.77k]
  ------------------
  617|    478|	  data->append('<');
  618|   135k|	} else if (n == 2 && !strncmp(start, "gt", 2)) {
  ------------------
  |  Branch (618:13): [True: 2.77k, False: 132k]
  |  Branch (618:23): [True: 331, False: 2.43k]
  ------------------
  619|    331|	  data->append('>');
  620|   134k|	} else if (n == 3 && !strncmp(start, "amp", 3)) {
  ------------------
  |  Branch (620:13): [True: 5.49k, False: 129k]
  |  Branch (620:23): [True: 120, False: 5.37k]
  ------------------
  621|    120|	  data->append('&');
  622|   134k|	} else if (n == 4 && !strncmp(start, "apos", 4)) {
  ------------------
  |  Branch (622:13): [True: 5.88k, False: 128k]
  |  Branch (622:23): [True: 0, False: 5.88k]
  ------------------
  623|      0|	  data->append('\'');
  624|   134k|	} else if (n == 4 && !strncmp(start, "quot", 4)) {
  ------------------
  |  Branch (624:13): [True: 5.88k, False: 128k]
  |  Branch (624:23): [True: 0, False: 5.88k]
  ------------------
  625|      0|	  data->append('"');
  626|   134k|	} else {
  627|   134k|	  data->append(start - 1, (int)(parsePtr - start) + 1);
  628|   134k|	}
  629|   135k|      }
  630|   783k|    } else {
  631|   783k|      start = parsePtr;
  632|   783k|      for (++parsePtr;
  633|  25.8M|	   parsePtr < parseEnd && *parsePtr != '<' && *parsePtr != '&';
  ------------------
  |  Branch (633:5): [True: 25.8M, False: 425]
  |  Branch (633:28): [True: 25.2M, False: 636k]
  |  Branch (633:48): [True: 25.1M, False: 146k]
  ------------------
  634|  25.1M|	   ++parsePtr) ;
  635|   783k|      data->append(start, (int)(parsePtr - start));
  636|   783k|    }
  637|  1.04M|  }
  638|   687k|  par->addChild(new ZxCharData(data, true));
  639|   687k|}
_ZN5ZxDoc10appendUTF8EP7GStringj:
  641|   145k|void ZxDoc::appendUTF8(GString *s, unsigned int c) {
  642|   145k|  if (c <= 0x7f) {
  ------------------
  |  Branch (642:7): [True: 141k, False: 4.50k]
  ------------------
  643|   141k|    s->append((char)c);
  644|   141k|  } else if (c <= 0x7ff) {
  ------------------
  |  Branch (644:14): [True: 1.48k, False: 3.02k]
  ------------------
  645|  1.48k|    s->append((char)(0xc0 + (c >> 6)));
  646|  1.48k|    s->append((char)(0x80 + (c & 0x3f)));
  647|  3.02k|  } else if (c <= 0xffff) {
  ------------------
  |  Branch (647:14): [True: 1.11k, False: 1.90k]
  ------------------
  648|  1.11k|    s->append((char)(0xe0 + (c >> 12)));
  649|  1.11k|    s->append((char)(0x80 + ((c >> 6) & 0x3f)));
  650|  1.11k|    s->append((char)(0x80 + (c & 0x3f)));
  651|  1.90k|  } else if (c <= 0x1fffff) {
  ------------------
  |  Branch (651:14): [True: 814, False: 1.09k]
  ------------------
  652|    814|    s->append((char)(0xf0 + (c >> 18)));
  653|    814|    s->append((char)(0x80 + ((c >> 12) & 0x3f)));
  654|    814|    s->append((char)(0x80 + ((c >> 6) & 0x3f)));
  655|    814|    s->append((char)(0x80 + (c & 0x3f)));
  656|  1.09k|  } else if (c <= 0x3ffffff) {
  ------------------
  |  Branch (656:14): [True: 330, False: 760]
  ------------------
  657|    330|    s->append((char)(0xf8 + (c >> 24)));
  658|    330|    s->append((char)(0x80 + ((c >> 18) & 0x3f)));
  659|    330|    s->append((char)(0x80 + ((c >> 12) & 0x3f)));
  660|    330|    s->append((char)(0x80 + ((c >> 6) & 0x3f)));
  661|    330|    s->append((char)(0x80 + (c & 0x3f)));
  662|    760|  } else if (c <= 0x7fffffff) {
  ------------------
  |  Branch (662:14): [True: 358, False: 402]
  ------------------
  663|    358|    s->append((char)(0xfc + (c >> 30)));
  664|    358|    s->append((char)(0x80 + ((c >> 24) & 0x3f)));
  665|    358|    s->append((char)(0x80 + ((c >> 18) & 0x3f)));
  666|    358|    s->append((char)(0x80 + ((c >> 12) & 0x3f)));
  667|    358|    s->append((char)(0x80 + ((c >> 6) & 0x3f)));
  668|    358|    s->append((char)(0x80 + (c & 0x3f)));
  669|    358|  }
  670|   145k|}
_ZN5ZxDoc11parseCDSectEP6ZxNode:
  673|     47|void ZxDoc::parseCDSect(ZxNode *par) {
  674|     47|  const char *start;
  675|       |
  676|     47|  parsePtr += 9;
  677|     47|  start = parsePtr;
  678|  98.0k|  while (parsePtr < parseEnd - 3) {
  ------------------
  |  Branch (678:10): [True: 98.0k, False: 9]
  ------------------
  679|  98.0k|    if (!strncmp(parsePtr, "]]>", 3)) {
  ------------------
  |  Branch (679:9): [True: 38, False: 98.0k]
  ------------------
  680|     38|      par->addChild(new ZxCharData(new GString(start, (int)(parsePtr - start)),
  681|     38|				   false));
  682|     38|      parsePtr += 3;
  683|     38|      return;
  684|     38|    }
  685|  98.0k|    ++parsePtr;
  686|  98.0k|  }
  687|      9|  parsePtr = parseEnd;
  688|      9|  par->addChild(new ZxCharData(new GString(start, (int)(parsePtr - start)),
  689|      9|			       false));
  690|      9|}
_ZN5ZxDoc9parseMiscEP6ZxNode:
  692|  3.45k|void ZxDoc::parseMisc(ZxNode *par) {
  693|  10.8k|  while (1) {
  ------------------
  |  Branch (693:10): [True: 10.8k, Folded]
  ------------------
  694|  10.8k|    if (match("<!--")) {
  ------------------
  |  Branch (694:9): [True: 93, False: 10.7k]
  ------------------
  695|     93|      parseComment(par);
  696|  10.7k|    } else if (match("<?")) {
  ------------------
  |  Branch (696:16): [True: 429, False: 10.3k]
  ------------------
  697|    429|      parsePI(par);
  698|  10.3k|    } else if (parsePtr < parseEnd && (*parsePtr == '\x20' ||
  ------------------
  |  Branch (698:16): [True: 9.42k, False: 907]
  |  Branch (698:40): [True: 2.80k, False: 6.61k]
  ------------------
  699|  6.61k|				       *parsePtr == '\x09' ||
  ------------------
  |  Branch (699:12): [True: 1.25k, False: 5.36k]
  ------------------
  700|  5.36k|				       *parsePtr == '\x0d' ||
  ------------------
  |  Branch (700:12): [True: 1.50k, False: 3.86k]
  ------------------
  701|  6.88k|				       *parsePtr == '\x0a')) {
  ------------------
  |  Branch (701:12): [True: 1.31k, False: 2.54k]
  ------------------
  702|  6.88k|      ++parsePtr;
  703|  6.88k|    } else {
  704|  3.45k|      break;
  705|  3.45k|    }
  706|  10.8k|  }
  707|  3.45k|}
_ZN5ZxDoc12parseCommentEP6ZxNode:
  710|  2.01k|void ZxDoc::parseComment(ZxNode *par) {
  711|  2.01k|  const char *start;
  712|       |
  713|  2.01k|  parsePtr += 4;
  714|  2.01k|  start = parsePtr;
  715|   253k|  while (parsePtr <= parseEnd - 3) {
  ------------------
  |  Branch (715:10): [True: 253k, False: 16]
  ------------------
  716|   253k|    if (!strncmp(parsePtr, "-->", 3)) {
  ------------------
  |  Branch (716:9): [True: 2.00k, False: 251k]
  ------------------
  717|  2.00k|      par->addChild(new ZxComment(new GString(start, (int)(parsePtr - start))));
  718|  2.00k|      parsePtr += 3;
  719|  2.00k|      return;
  720|  2.00k|    }
  721|   251k|    ++parsePtr;
  722|   251k|  }
  723|     16|  parsePtr = parseEnd;
  724|     16|}
_ZN5ZxDoc7parsePIEP6ZxNode:
  727|  12.2k|void ZxDoc::parsePI(ZxNode *par) {
  728|  12.2k|  GString *target;
  729|  12.2k|  const char *start;
  730|       |
  731|  12.2k|  parsePtr += 2;
  732|  12.2k|  target = parseName();
  733|  12.2k|  parseSpace();
  734|  12.2k|  start = parsePtr;
  735|  2.29M|  while (parsePtr <= parseEnd - 2) {
  ------------------
  |  Branch (735:10): [True: 2.29M, False: 89]
  ------------------
  736|  2.29M|    if (!strncmp(parsePtr, "?>", 2)) {
  ------------------
  |  Branch (736:9): [True: 12.1k, False: 2.28M]
  ------------------
  737|  12.1k|      par->addChild(new ZxPI(target, new GString(start,
  738|  12.1k|						 (int)(parsePtr - start))));
  739|  12.1k|      parsePtr += 2;
  740|  12.1k|      return;
  741|  12.1k|    }
  742|  2.28M|    ++parsePtr;
  743|  2.28M|  }
  744|     89|  parsePtr = parseEnd;
  745|     89|  par->addChild(new ZxPI(target, new GString(start, (int)(parsePtr - start))));
  746|     89|}
_ZN5ZxDoc9parseNameEv:
  750|  2.18M|GString *ZxDoc::parseName() {
  751|  2.18M|  GString *name;
  752|       |
  753|  2.18M|  name = new GString();
  754|  2.18M|  if (parsePtr < parseEnd && nameStartChar[*parsePtr & 0xff]) {
  ------------------
  |  Branch (754:7): [True: 2.18M, False: 147]
  |  Branch (754:30): [True: 915k, False: 1.27M]
  ------------------
  755|   915k|    name->append(*parsePtr++);
  756|  3.70M|    while (parsePtr < parseEnd && nameChar[*parsePtr & 0xff]) {
  ------------------
  |  Branch (756:12): [True: 3.70M, False: 18]
  |  Branch (756:35): [True: 2.78M, False: 915k]
  ------------------
  757|  2.78M|      name->append(*parsePtr++);
  758|  2.78M|    }
  759|   915k|  }
  760|  2.18M|  return name;
  761|  2.18M|}
_ZN5ZxDoc17parseQuotedStringEv:
  763|    819|GString *ZxDoc::parseQuotedString() {
  764|    819|  GString *s;
  765|    819|  const char *start;
  766|    819|  char quote;
  767|       |
  768|    819|  if (parsePtr < parseEnd && (*parsePtr == '"' || *parsePtr == '\'')) {
  ------------------
  |  Branch (768:7): [True: 816, False: 3]
  |  Branch (768:31): [True: 703, False: 113]
  |  Branch (768:51): [True: 51, False: 62]
  ------------------
  769|    754|    quote = *parsePtr++;
  770|    754|    start = parsePtr;
  771|  37.6k|    while (parsePtr < parseEnd && *parsePtr != quote) {
  ------------------
  |  Branch (771:12): [True: 37.6k, False: 1]
  |  Branch (771:35): [True: 36.9k, False: 753]
  ------------------
  772|  36.9k|      ++parsePtr;
  773|  36.9k|    }
  774|    754|    s = new GString(start, (int)(parsePtr - start));
  775|    754|    if (parsePtr < parseEnd && *parsePtr == quote) {
  ------------------
  |  Branch (775:9): [True: 753, False: 1]
  |  Branch (775:32): [True: 753, False: 0]
  ------------------
  776|    753|      ++parsePtr;
  777|    753|    }
  778|    754|  } else {
  779|     65|    s = new GString();
  780|     65|  }
  781|    819|  return s;
  782|    819|}
_ZN5ZxDoc8parseBOMEv:
  784|  1.15k|void ZxDoc::parseBOM() {
  785|  1.15k|  if (match("\xef\xbb\xbf")) {
  ------------------
  |  Branch (785:7): [True: 14, False: 1.13k]
  ------------------
  786|     14|    parsePtr += 3;
  787|     14|  }
  788|  1.15k|}
_ZN5ZxDoc10parseSpaceEv:
  790|  2.50M|void ZxDoc::parseSpace() {
  791|  2.94M|  while (parsePtr < parseEnd && (*parsePtr == '\x20' ||
  ------------------
  |  Branch (791:10): [True: 2.94M, False: 343]
  |  Branch (791:34): [True: 197k, False: 2.75M]
  ------------------
  792|  2.75M|				 *parsePtr == '\x09' ||
  ------------------
  |  Branch (792:6): [True: 32.1k, False: 2.71M]
  ------------------
  793|  2.71M|				 *parsePtr == '\x0d' ||
  ------------------
  |  Branch (793:6): [True: 50.8k, False: 2.66M]
  ------------------
  794|  2.66M|				 *parsePtr == '\x0a')) {
  ------------------
  |  Branch (794:6): [True: 168k, False: 2.50M]
  ------------------
  795|   448k|    ++parsePtr;
  796|   448k|  }
  797|  2.50M|}
_ZN5ZxDoc5matchEPKc:
  799|  11.9M|bool ZxDoc::match(const char *s) {
  800|  11.9M|  int n;
  801|       |
  802|  11.9M|  n = (int)strlen(s);
  803|  11.9M|  return parseEnd - parsePtr >= n && !strncmp(parsePtr, s, n);
  ------------------
  |  Branch (803:10): [True: 11.9M, False: 3.13k]
  |  Branch (803:38): [True: 1.60M, False: 10.3M]
  ------------------
  804|  11.9M|}
_ZN9ZxXMLDeclC2EP7GStringS1_b:
  822|    501|ZxXMLDecl::ZxXMLDecl(GString *versionA, GString *encodingA, bool standaloneA) {
  823|    501|  version = versionA;
  824|    501|  encoding = encodingA;
  825|    501|  standalone = standaloneA;
  826|    501|}
_ZN9ZxXMLDeclD2Ev:
  828|    501|ZxXMLDecl::~ZxXMLDecl() {
  829|    501|  delete version;
  830|    501|  if (encoding) {
  ------------------
  |  Branch (830:7): [True: 311, False: 190]
  ------------------
  831|    311|    delete encoding;
  832|    311|  }
  833|    501|}
_ZN13ZxDocTypeDeclC2EP7GString:
  858|     41|ZxDocTypeDecl::ZxDocTypeDecl(GString *nameA) {
  859|     41|  name = nameA;
  860|     41|}
_ZN13ZxDocTypeDeclD2Ev:
  862|     41|ZxDocTypeDecl::~ZxDocTypeDecl() {
  863|     41|  delete name;
  864|     41|}
_ZN9ZxCommentC2EP7GString:
  880|  2.00k|ZxComment::ZxComment(GString *textA) {
  881|  2.00k|  text = textA;
  882|  2.00k|}
_ZN9ZxCommentD2Ev:
  884|  2.00k|ZxComment::~ZxComment() {
  885|  2.00k|  delete text;
  886|  2.00k|}
_ZN4ZxPIC2EP7GStringS1_:
  902|  12.2k|ZxPI::ZxPI(GString *targetA, GString *textA) {
  903|  12.2k|  target = targetA;
  904|  12.2k|  text = textA;
  905|  12.2k|}
_ZN4ZxPID2Ev:
  907|  12.2k|ZxPI::~ZxPI() {
  908|  12.2k|  delete target;
  909|  12.2k|  delete text;
  910|  12.2k|}
_ZN9ZxElementC2EP7GString:
  928|  1.03M|ZxElement::ZxElement(GString *typeA) {
  929|  1.03M|  type = typeA;
  930|  1.03M|  attrs = new GHash();
  931|       |  firstAttr = lastAttr = NULL;
  932|  1.03M|}
_ZN9ZxElementD2Ev:
  934|  1.03M|ZxElement::~ZxElement() {
  935|  1.03M|  delete type;
  936|  1.03M|  deleteGHash(attrs, ZxAttr);
  ------------------
  |  |   60|  1.03M|  do {                                             \
  |  |   61|  1.03M|    GHash *_hash = (hash);                         \
  |  |   62|  1.03M|    {                                              \
  |  |   63|  1.03M|      GHashIter *_iter;                            \
  |  |   64|  1.03M|      GString *_key;                               \
  |  |   65|  1.03M|      void *_p;                                    \
  |  |   66|  1.03M|      _hash->startIter(&_iter);                    \
  |  |   67|  1.14M|      while (_hash->getNext(&_iter, &_key, &_p)) { \
  |  |  ------------------
  |  |  |  Branch (67:14): [True: 113k, False: 1.03M]
  |  |  ------------------
  |  |   68|   113k|        delete (T*)_p;                             \
  |  |   69|   113k|      }                                            \
  |  |   70|  1.03M|      delete _hash;                                \
  |  |   71|  1.03M|    }                                              \
  |  |   72|  1.03M|  } while(0)
  |  |  ------------------
  |  |  |  Branch (72:11): [Folded, False: 1.03M]
  |  |  ------------------
  ------------------
  937|  1.03M|}
_ZN9ZxElement9isElementEPKc:
  939|  1.42M|bool ZxElement::isElement(const char *typeA) {
  940|  1.42M|  return !type->cmp(typeA);
  941|  1.42M|}
_ZN9ZxElement8findAttrEPKc:
  943|   301k|ZxAttr *ZxElement::findAttr(const char *attrName) {
  944|   301k|  return (ZxAttr *)attrs->lookup(attrName);
  945|   301k|}
_ZN9ZxElement7addAttrEP6ZxAttr:
  947|   113k|void ZxElement::addAttr(ZxAttr *attr) {
  948|   113k|  attrs->add(attr->getName(), attr);
  949|   113k|  if (lastAttr) {
  ------------------
  |  Branch (949:7): [True: 31.5k, False: 81.8k]
  ------------------
  950|  31.5k|    lastAttr->next = attr;
  951|  31.5k|    lastAttr= attr;
  952|  81.8k|  } else {
  953|  81.8k|    firstAttr = lastAttr = attr;
  954|  81.8k|  }
  955|   113k|  attr->parent = this;
  956|       |  attr->next = NULL;
  957|   113k|}
_ZN6ZxAttrC2EP7GStringS1_:
 1025|   113k|ZxAttr::ZxAttr(GString *nameA, GString *valueA) {
 1026|   113k|  name = nameA;
 1027|   113k|  value = valueA;
 1028|   113k|  parent = NULL;
 1029|       |  next = NULL;
 1030|   113k|}
_ZN6ZxAttrD2Ev:
 1032|   113k|ZxAttr::~ZxAttr() {
 1033|   113k|  delete name;
 1034|   113k|  delete value;
 1035|   113k|}
_ZN10ZxCharDataC2EP7GStringb:
 1039|   687k|ZxCharData::ZxCharData(GString *dataA, bool parsedA) {
 1040|   687k|  data = dataA;
 1041|   687k|  parsed = parsedA;
 1042|   687k|}
_ZN10ZxCharDataD2Ev:
 1044|   687k|ZxCharData::~ZxCharData() {
 1045|   687k|  delete data;
 1046|   687k|}

_ZN5ZxDoc7getRootEv:
   88|  3.20k|  ZxElement *getRoot() { return root; }
_ZN10ZxCharData7getDataEv:
  257|  1.36k|  GString *getData() { return data; }
_ZN6ZxAttr8getValueEv:
  234|  41.3k|  GString *getValue() { return value; }
_ZN9ZxElement7getTypeEv:
  209|   403k|  GString *getType() { return type; }
_ZN6ZxNode9isXMLDeclEv:
   36|  1.35k|  virtual bool isXMLDecl()  { return false; }
_ZN6ZxNode13isDocTypeDeclEv:
   37|  1.31k|  virtual bool isDocTypeDecl() { return false; }
_ZN6ZxNode9isElementEv:
   40|   148k|  virtual bool isElement() { return false; }
_ZN6ZxNode9isElementEPKc:
   41|   200k|  virtual bool isElement(const char *type) { return false; }
_ZN6ZxNode10isCharDataEv:
   42|    937|  virtual bool isCharData() { return false; }
_ZN6ZxNode13getFirstChildEv:
   43|   166k|  virtual ZxNode *getFirstChild() { return firstChild; }
_ZN6ZxNode12getNextChildEv:
   44|   412k|  virtual ZxNode *getNextChild() { return next; }
_ZN9ZxXMLDecl9isXMLDeclEv:
  129|    501|  virtual bool isXMLDecl() { return true; }
_ZN13ZxDocTypeDecl13isDocTypeDeclEv:
  151|     41|  virtual bool isDocTypeDecl() { return true; }
_ZN9ZxElement9isElementEv:
  207|   267k|  virtual bool isElement() { return true; }
_ZN6ZxAttr7getNameEv:
  233|   113k|  GString *getName() { return name; }
_ZN10ZxCharData10isCharDataEv:
  256|  1.36k|  virtual bool isCharData() { return true; }

