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

_ZN5GHashC2Ei:
   34|  1.25M|GHash::GHash(GBool deleteKeysA) {
   35|  1.25M|  int h;
   36|       |
   37|  1.25M|  deleteKeys = deleteKeysA;
   38|  1.25M|  size = 7;
   39|  1.25M|  tab = (GHashBucket **)gmallocn(size, sizeof(GHashBucket *));
   40|  10.0M|  for (h = 0; h < size; ++h) {
  ------------------
  |  Branch (40:15): [True: 8.79M, False: 1.25M]
  ------------------
   41|       |    tab[h] = NULL;
   42|  8.79M|  }
   43|  1.25M|  len = 0;
   44|  1.25M|}
_ZN5GHashD2Ev:
   46|  1.25M|GHash::~GHash() {
   47|  1.25M|  GHashBucket *p;
   48|  1.25M|  int h;
   49|       |
   50|  10.0M|  for (h = 0; h < size; ++h) {
  ------------------
  |  Branch (50:15): [True: 8.80M, False: 1.25M]
  ------------------
   51|  9.01M|    while (tab[h]) {
  ------------------
  |  Branch (51:12): [True: 210k, False: 8.80M]
  ------------------
   52|   210k|      p = tab[h];
   53|   210k|      tab[h] = p->next;
   54|   210k|      if (deleteKeys) {
  ------------------
  |  Branch (54:11): [True: 10.5k, False: 199k]
  ------------------
   55|  10.5k|	delete p->key;
   56|  10.5k|      }
   57|   210k|      delete p;
   58|   210k|    }
   59|  8.80M|  }
   60|  1.25M|  gfree(tab);
   61|  1.25M|}
_ZN5GHash3addEP7GStringPv:
   63|   188k|void GHash::add(GString *key, void *val) {
   64|   188k|  GHashBucket *p;
   65|   188k|  int h;
   66|       |
   67|       |  // expand the table if necessary
   68|   188k|  if (len >= size) {
  ------------------
  |  Branch (68:7): [True: 779, False: 187k]
  ------------------
   69|    779|    expand();
   70|    779|  }
   71|       |
   72|       |  // add the new symbol
   73|   188k|  p = new GHashBucket;
   74|   188k|  p->key = key;
   75|   188k|  p->val.p = val;
   76|   188k|  h = hash(key);
   77|   188k|  p->next = tab[h];
   78|   188k|  tab[h] = p;
   79|   188k|  ++len;
   80|   188k|}
_ZN5GHash3addEP7GStringi:
   82|  21.8k|void GHash::add(GString *key, int val) {
   83|  21.8k|  GHashBucket *p;
   84|  21.8k|  int h;
   85|       |
   86|       |  // expand the table if necessary
   87|  21.8k|  if (len >= size) {
  ------------------
  |  Branch (87:7): [True: 300, False: 21.5k]
  ------------------
   88|    300|    expand();
   89|    300|  }
   90|       |
   91|       |  // add the new symbol
   92|  21.8k|  p = new GHashBucket;
   93|  21.8k|  p->key = key;
   94|  21.8k|  p->val.i = val;
   95|  21.8k|  h = hash(key);
   96|  21.8k|  p->next = tab[h];
   97|  21.8k|  tab[h] = p;
   98|  21.8k|  ++len;
   99|  21.8k|}
_ZN5GHash7replaceEP7GStringi:
  115|  30.4k|void GHash::replace(GString *key, int val) {
  116|  30.4k|  GHashBucket *p;
  117|  30.4k|  int h;
  118|       |
  119|  30.4k|  if ((p = find(key, &h))) {
  ------------------
  |  Branch (119:7): [True: 8.57k, False: 21.8k]
  ------------------
  120|  8.57k|    p->val.i = val;
  121|  8.57k|    if (deleteKeys) {
  ------------------
  |  Branch (121:9): [True: 0, False: 8.57k]
  ------------------
  122|      0|      delete key;
  123|      0|    }
  124|  21.8k|  } else {
  125|  21.8k|    add(key, val);
  126|  21.8k|  }
  127|  30.4k|}
_ZN5GHash6lookupEP7GString:
  129|  3.39k|void *GHash::lookup(GString *key) {
  130|  3.39k|  GHashBucket *p;
  131|  3.39k|  int h;
  132|       |
  133|  3.39k|  if (!(p = find(key, &h))) {
  ------------------
  |  Branch (133:7): [True: 3.38k, False: 6]
  ------------------
  134|  3.38k|    return NULL;
  135|  3.38k|  }
  136|      6|  return p->val.p;
  137|  3.39k|}
_ZN5GHash9lookupIntEP7GString:
  139|  30.4k|int GHash::lookupInt(GString *key) {
  140|  30.4k|  GHashBucket *p;
  141|  30.4k|  int h;
  142|       |
  143|  30.4k|  if (!(p = find(key, &h))) {
  ------------------
  |  Branch (143:7): [True: 21.8k, False: 8.57k]
  ------------------
  144|  21.8k|    return 0;
  145|  21.8k|  }
  146|  8.57k|  return p->val.i;
  147|  30.4k|}
_ZN5GHash6lookupEPKc:
  149|   748k|void *GHash::lookup(const char *key) {
  150|   748k|  GHashBucket *p;
  151|   748k|  int h;
  152|       |
  153|   748k|  if (!(p = find(key, &h))) {
  ------------------
  |  Branch (153:7): [True: 716k, False: 31.4k]
  ------------------
  154|   716k|    return NULL;
  155|   716k|  }
  156|  31.4k|  return p->val.p;
  157|   748k|}
_ZN5GHash9startIterEPP9GHashIter:
  261|  1.21M|void GHash::startIter(GHashIter **iter) {
  262|  1.21M|  *iter = new GHashIter;
  263|  1.21M|  (*iter)->h = -1;
  264|       |  (*iter)->p = NULL;
  265|  1.21M|}
_ZN5GHash7getNextEPP9GHashIterPP7GStringPPv:
  267|  1.40M|GBool GHash::getNext(GHashIter **iter, GString **key, void **val) {
  268|  1.40M|  if (!*iter) {
  ------------------
  |  Branch (268:7): [True: 0, False: 1.40M]
  ------------------
  269|      0|    return gFalse;
  ------------------
  |  |   18|      0|#define gFalse 0
  ------------------
  270|      0|  }
  271|  1.40M|  if ((*iter)->p) {
  ------------------
  |  Branch (271:7): [True: 188k, False: 1.21M]
  ------------------
  272|   188k|    (*iter)->p = (*iter)->p->next;
  273|   188k|  }
  274|  9.91M|  while (!(*iter)->p) {
  ------------------
  |  Branch (274:10): [True: 9.73M, False: 188k]
  ------------------
  275|  9.73M|    if (++(*iter)->h == size) {
  ------------------
  |  Branch (275:9): [True: 1.21M, False: 8.51M]
  ------------------
  276|  1.21M|      delete *iter;
  277|  1.21M|      *iter = NULL;
  278|  1.21M|      return gFalse;
  ------------------
  |  |   18|  1.21M|#define gFalse 0
  ------------------
  279|  1.21M|    }
  280|  8.51M|    (*iter)->p = tab[(*iter)->h];
  281|  8.51M|  }
  282|   188k|  *key = (*iter)->p->key;
  283|   188k|  *val = (*iter)->p->val.p;
  284|   188k|  return gTrue;
  ------------------
  |  |   17|   188k|#define gTrue 1
  ------------------
  285|  1.40M|}
_ZN5GHash6expandEv:
  312|  1.07k|void GHash::expand() {
  313|  1.07k|  GHashBucket **oldTab;
  314|  1.07k|  GHashBucket *p;
  315|  1.07k|  int oldSize, h, i;
  316|       |
  317|  1.07k|  oldSize = size;
  318|  1.07k|  oldTab = tab;
  319|  1.07k|  size = 2*size + 1;
  320|  1.07k|  tab = (GHashBucket **)gmallocn(size, sizeof(GHashBucket *));
  321|  26.5k|  for (h = 0; h < size; ++h) {
  ------------------
  |  Branch (321:15): [True: 25.4k, False: 1.07k]
  ------------------
  322|  25.4k|    tab[h] = NULL;
  323|  25.4k|  }
  324|  13.2k|  for (i = 0; i < oldSize; ++i) {
  ------------------
  |  Branch (324:15): [True: 12.2k, False: 1.07k]
  ------------------
  325|  24.4k|    while (oldTab[i]) {
  ------------------
  |  Branch (325:12): [True: 12.2k, False: 12.2k]
  ------------------
  326|  12.2k|      p = oldTab[i];
  327|  12.2k|      oldTab[i] = oldTab[i]->next;
  328|  12.2k|      h = hash(p->key);
  329|  12.2k|      p->next = tab[h];
  330|  12.2k|      tab[h] = p;
  331|  12.2k|    }
  332|  12.2k|  }
  333|  1.07k|  gfree(oldTab);
  334|  1.07k|}
_ZN5GHash4findEP7GStringPi:
  336|  64.2k|GHashBucket *GHash::find(GString *key, int *h) {
  337|  64.2k|  GHashBucket *p;
  338|       |
  339|  64.2k|  *h = hash(key);
  340|  74.6k|  for (p = tab[*h]; p; p = p->next) {
  ------------------
  |  Branch (340:21): [True: 27.4k, False: 47.1k]
  ------------------
  341|  27.4k|    if (!p->key->cmp(key)) {
  ------------------
  |  Branch (341:9): [True: 17.1k, False: 10.3k]
  ------------------
  342|  17.1k|      return p;
  343|  17.1k|    }
  344|  27.4k|  }
  345|  47.1k|  return NULL;
  346|  64.2k|}
_ZN5GHash4findEPKcPi:
  348|   748k|GHashBucket *GHash::find(const char *key, int *h) {
  349|   748k|  GHashBucket *p;
  350|       |
  351|   748k|  *h = hash(key);
  352|   754k|  for (p = tab[*h]; p; p = p->next) {
  ------------------
  |  Branch (352:21): [True: 38.2k, False: 716k]
  ------------------
  353|  38.2k|    if (!p->key->cmp(key)) {
  ------------------
  |  Branch (353:9): [True: 31.4k, False: 6.83k]
  ------------------
  354|  31.4k|      return p;
  355|  31.4k|    }
  356|  38.2k|  }
  357|   716k|  return NULL;
  358|   748k|}
_ZN5GHash4hashEP7GString:
  360|   286k|int GHash::hash(GString *key) {
  361|   286k|  const char *p;
  362|   286k|  unsigned int h;
  363|   286k|  int i;
  364|       |
  365|   286k|  h = 0;
  366|  20.5M|  for (p = key->getCString(), i = 0; i < key->getLength(); ++p, ++i) {
  ------------------
  |  Branch (366:38): [True: 20.3M, False: 286k]
  ------------------
  367|  20.3M|    h = 17 * h + (int)(*p & 0xff);
  368|  20.3M|  }
  369|   286k|  return (int)(h % size);
  370|   286k|}
_ZN5GHash4hashEPKc:
  372|   748k|int GHash::hash(const char *key) {
  373|   748k|  const char *p;
  374|   748k|  unsigned int h;
  375|       |
  376|   748k|  h = 0;
  377|  7.86M|  for (p = key; *p; ++p) {
  ------------------
  |  Branch (377:17): [True: 7.11M, False: 748k]
  ------------------
  378|  7.11M|    h = 17 * h + (int)(*p & 0xff);
  379|  7.11M|  }
  380|   748k|  return (int)(h % size);
  381|   748k|}

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

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

Object.cc:_ZL16gAtomicIncrementPl:
   67|  2.22M|static inline GAtomicCounter gAtomicIncrement(GAtomicCounter *counter) {
   68|  2.22M|  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.22M|  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.22M|  return newVal;
   81|  2.22M|}
Object.cc:_ZL16gAtomicDecrementPl:
   85|  3.29M|static inline GAtomicCounter gAtomicDecrement(GAtomicCounter *counter) {
   86|  3.29M|  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.29M|  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.29M|  return newVal;
   99|  3.29M|}

_ZN7GStringC2Ev:
  129|  3.26M|GString::GString() {
  130|       |  s = NULL;
  131|  3.26M|  resize(length = 0);
  132|  3.26M|  s[0] = '\0';
  133|  3.26M|}
_ZN7GStringC2EPKc:
  135|  2.12M|GString::GString(const char *sA) {
  136|  2.12M|  int n = (int)strlen(sA);
  137|       |
  138|       |  s = NULL;
  139|  2.12M|  resize(length = n);
  140|  2.12M|  memcpy(s, sA, n + 1);
  141|  2.12M|}
_ZN7GStringC2EPKci:
  143|   928k|GString::GString(const char *sA, int lengthA) {
  144|       |  s = NULL;
  145|   928k|  resize(length = lengthA);
  146|   928k|  memcpy(s, sA, length * sizeof(char));
  147|   928k|  s[length] = '\0';
  148|   928k|}
_ZN7GStringC2EPS_:
  157|   650k|GString::GString(GString *str) {
  158|       |  s = NULL;
  159|   650k|  resize(length = str->getLength());
  160|   650k|  memcpy(s, str->getCString(), length + 1);
  161|   650k|}
_ZN7GString6formatEPKcz:
  185|  27.9k|GString *GString::format(const char *fmt, ...) {
  186|  27.9k|  va_list argList;
  187|  27.9k|  GString *s;
  188|       |
  189|  27.9k|  s = new GString();
  190|  27.9k|  va_start(argList, fmt);
  191|  27.9k|  s->appendfv(fmt, argList);
  192|       |  va_end(argList);
  193|  27.9k|  return s;
  194|  27.9k|}
_ZN7GStringD2Ev:
  204|  6.92M|GString::~GString() {
  205|  6.92M|  delete[] s;
  206|  6.92M|}
_ZN7GString6appendEc:
  214|  6.42M|GString *GString::append(char c) {
  215|  6.42M|  if (length > INT_MAX - 1) {
  ------------------
  |  Branch (215:7): [True: 0, False: 6.42M]
  ------------------
  216|      0|    gMemError("Integer overflow in GString::append()");
  217|      0|  }
  218|  6.42M|  resize(length + 1);
  219|  6.42M|  s[length++] = c;
  220|  6.42M|  s[length] = '\0';
  221|  6.42M|  return this;
  222|  6.42M|}
_ZN7GString6appendEPS_:
  224|   291k|GString *GString::append(GString *str) {
  225|   291k|  int n = str->getLength();
  226|       |
  227|   291k|  if (length > INT_MAX - n) {
  ------------------
  |  Branch (227:7): [True: 0, False: 291k]
  ------------------
  228|      0|    gMemError("Integer overflow in GString::append()");
  229|      0|  }
  230|   291k|  resize(length + n);
  231|   291k|  memcpy(s + length, str->getCString(), n + 1);
  232|   291k|  length += n;
  233|   291k|  return this;
  234|   291k|}
_ZN7GString6appendEPKc:
  236|   806k|GString *GString::append(const char *str) {
  237|   806k|  int n = (int)strlen(str);
  238|       |
  239|   806k|  if (length > INT_MAX - n) {
  ------------------
  |  Branch (239:7): [True: 0, False: 806k]
  ------------------
  240|      0|    gMemError("Integer overflow in GString::append()");
  241|      0|  }
  242|   806k|  resize(length + n);
  243|   806k|  memcpy(s + length, str, n + 1);
  244|   806k|  length += n;
  245|   806k|  return this;
  246|   806k|}
_ZN7GString6appendEPKci:
  248|  7.03M|GString *GString::append(const char *str, int lengthA) {
  249|  7.03M|  if (lengthA < 0 || length > INT_MAX - lengthA) {
  ------------------
  |  Branch (249:7): [True: 0, False: 7.03M]
  |  Branch (249:22): [True: 0, False: 7.03M]
  ------------------
  250|      0|    gMemError("Integer overflow in GString::append()");
  251|      0|  }
  252|  7.03M|  resize(length + lengthA);
  253|  7.03M|  memcpy(s + length, str, lengthA);
  254|  7.03M|  length += lengthA;
  255|  7.03M|  s[length] = '\0';
  256|  7.03M|  return this;
  257|  7.03M|}
_ZN7GString7appendfEPKcz:
  259|  30.4k|GString *GString::appendf(const char *fmt, ...) {
  260|  30.4k|  va_list argList;
  261|       |
  262|  30.4k|  va_start(argList, fmt);
  263|  30.4k|  appendfv(fmt, argList);
  264|       |  va_end(argList);
  265|  30.4k|  return this;
  266|  30.4k|}
_ZN7GString8appendfvEPKcP13__va_list_tag:
  268|  58.4k|GString *GString::appendfv(const char *fmt, va_list argList) {
  269|  58.4k|  GStringFormatArg *args;
  270|  58.4k|  int argsLen, argsSize;
  271|  58.4k|  GStringFormatArg arg;
  272|  58.4k|  int idx, width, prec;
  273|  58.4k|  GBool reverseAlign, zeroFill;
  274|  58.4k|  GStringFormatType ft;
  275|  58.4k|  char buf[65];
  276|  58.4k|  int len, i;
  277|  58.4k|  const char *p0, *p1;
  278|  58.4k|  const char *str;
  279|       |
  280|  58.4k|  argsLen = 0;
  281|  58.4k|  argsSize = 8;
  282|  58.4k|  args = (GStringFormatArg *)gmallocn(argsSize, sizeof(GStringFormatArg));
  283|       |
  284|  58.4k|  p0 = fmt;
  285|   233k|  while (*p0) {
  ------------------
  |  Branch (285:10): [True: 175k, False: 58.4k]
  ------------------
  286|   175k|    if (*p0 == '{') {
  ------------------
  |  Branch (286:9): [True: 86.4k, False: 88.8k]
  ------------------
  287|  86.4k|      ++p0;
  288|  86.4k|      if (*p0 == '{') {
  ------------------
  |  Branch (288:11): [True: 0, False: 86.4k]
  ------------------
  289|      0|	++p0;
  290|      0|	append('{');
  291|  86.4k|      } else {
  292|       |
  293|       |	// parse the format string
  294|  86.4k|	if (!(*p0 >= '0' && *p0 <= '9')) {
  ------------------
  |  Branch (294:8): [True: 86.4k, False: 0]
  |  Branch (294:22): [True: 86.4k, False: 0]
  ------------------
  295|      0|	  break;
  296|      0|	}
  297|  86.4k|	idx = *p0 - '0';
  298|  86.4k|	for (++p0; *p0 >= '0' && *p0 <= '9'; ++p0) {
  ------------------
  |  Branch (298:13): [True: 86.4k, False: 0]
  |  Branch (298:27): [True: 0, False: 86.4k]
  ------------------
  299|      0|	  idx = 10 * idx + (*p0 - '0');
  300|      0|	}
  301|  86.4k|	if (*p0 != ':') {
  ------------------
  |  Branch (301:6): [True: 0, False: 86.4k]
  ------------------
  302|      0|	  break;
  303|      0|	}
  304|  86.4k|	++p0;
  305|  86.4k|	if (*p0 == '-') {
  ------------------
  |  Branch (305:6): [True: 0, False: 86.4k]
  ------------------
  306|      0|	  reverseAlign = gTrue;
  ------------------
  |  |   17|      0|#define gTrue 1
  ------------------
  307|      0|	  ++p0;
  308|  86.4k|	} else {
  309|  86.4k|	  reverseAlign = gFalse;
  ------------------
  |  |   18|  86.4k|#define gFalse 0
  ------------------
  310|  86.4k|	}
  311|  86.4k|	width = 0;
  312|  86.4k|	zeroFill = *p0 == '0';
  313|  86.4k|	for (; *p0 >= '0' && *p0 <= '9'; ++p0) {
  ------------------
  |  Branch (313:9): [True: 86.4k, False: 0]
  |  Branch (313:23): [True: 0, False: 86.4k]
  ------------------
  314|      0|	  width = 10 * width + (*p0 - '0');
  315|      0|	}
  316|  86.4k|	if (width < 0) {
  ------------------
  |  Branch (316:6): [True: 0, False: 86.4k]
  ------------------
  317|      0|	  width = 0;
  318|      0|	}
  319|  86.4k|	if (*p0 == '.') {
  ------------------
  |  Branch (319:6): [True: 0, False: 86.4k]
  ------------------
  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|  86.4k|	} else {
  326|  86.4k|	  prec = 0;
  327|  86.4k|	}
  328|  86.4k|	for (ft = (GStringFormatType)0;
  329|  1.65M|	     formatStrings[ft];
  ------------------
  |  Branch (329:7): [True: 1.65M, False: 0]
  ------------------
  330|  1.65M|	     ft = (GStringFormatType)(ft + 1)) {
  331|  1.65M|	  if (!strncmp(p0, formatStrings[ft], strlen(formatStrings[ft]))) {
  ------------------
  |  Branch (331:8): [True: 86.4k, False: 1.56M]
  ------------------
  332|  86.4k|	    break;
  333|  86.4k|	  }
  334|  1.65M|	}
  335|  86.4k|	if (!formatStrings[ft]) {
  ------------------
  |  Branch (335:6): [True: 0, False: 86.4k]
  ------------------
  336|      0|	  break;
  337|      0|	}
  338|  86.4k|	p0 += strlen(formatStrings[ft]);
  339|  86.4k|	if (*p0 != '}') {
  ------------------
  |  Branch (339:6): [True: 0, False: 86.4k]
  ------------------
  340|      0|	  break;
  341|      0|	}
  342|  86.4k|	++p0;
  343|       |
  344|       |	// fetch the argument
  345|  86.4k|	if (idx > argsLen) {
  ------------------
  |  Branch (345:6): [True: 0, False: 86.4k]
  ------------------
  346|      0|	  break;
  347|      0|	}
  348|  86.4k|	if (idx == argsLen) {
  ------------------
  |  Branch (348:6): [True: 86.4k, False: 0]
  ------------------
  349|  86.4k|	  if (argsLen == argsSize) {
  ------------------
  |  Branch (349:8): [True: 0, False: 86.4k]
  ------------------
  350|      0|	    argsSize *= 2;
  351|      0|	    args = (GStringFormatArg *)greallocn(args, argsSize,
  352|      0|						 sizeof(GStringFormatArg));
  353|      0|	  }
  354|  86.4k|	  switch (ft) {
  ------------------
  |  Branch (354:12): [True: 86.4k, False: 0]
  ------------------
  355|  30.4k|	  case fmtIntDecimal:
  ------------------
  |  Branch (355:4): [True: 30.4k, False: 55.9k]
  ------------------
  356|  30.4k|	  case fmtIntHex:
  ------------------
  |  Branch (356:4): [True: 0, False: 86.4k]
  ------------------
  357|  30.4k|	  case fmtIntOctal:
  ------------------
  |  Branch (357:4): [True: 0, False: 86.4k]
  ------------------
  358|  30.4k|	  case fmtIntBinary:
  ------------------
  |  Branch (358:4): [True: 0, False: 86.4k]
  ------------------
  359|  30.4k|	  case fmtSpace:
  ------------------
  |  Branch (359:4): [True: 0, False: 86.4k]
  ------------------
  360|  30.4k|	    args[argsLen].i = va_arg(argList, int);
  361|  30.4k|	    break;
  362|      0|	  case fmtUIntDecimal:
  ------------------
  |  Branch (362:4): [True: 0, False: 86.4k]
  ------------------
  363|      0|	  case fmtUIntHex:
  ------------------
  |  Branch (363:4): [True: 0, False: 86.4k]
  ------------------
  364|      0|	  case fmtUIntOctal:
  ------------------
  |  Branch (364:4): [True: 0, False: 86.4k]
  ------------------
  365|      0|	  case fmtUIntBinary:
  ------------------
  |  Branch (365:4): [True: 0, False: 86.4k]
  ------------------
  366|      0|	    args[argsLen].ui = va_arg(argList, Guint);
  367|      0|	    break;
  368|      0|	  case fmtLongDecimal:
  ------------------
  |  Branch (368:4): [True: 0, False: 86.4k]
  ------------------
  369|      0|	  case fmtLongHex:
  ------------------
  |  Branch (369:4): [True: 0, False: 86.4k]
  ------------------
  370|      0|	  case fmtLongOctal:
  ------------------
  |  Branch (370:4): [True: 0, False: 86.4k]
  ------------------
  371|      0|	  case fmtLongBinary:
  ------------------
  |  Branch (371:4): [True: 0, False: 86.4k]
  ------------------
  372|      0|	    args[argsLen].l = va_arg(argList, long);
  373|      0|	    break;
  374|      0|	  case fmtULongDecimal:
  ------------------
  |  Branch (374:4): [True: 0, False: 86.4k]
  ------------------
  375|      0|	  case fmtULongHex:
  ------------------
  |  Branch (375:4): [True: 0, False: 86.4k]
  ------------------
  376|      0|	  case fmtULongOctal:
  ------------------
  |  Branch (376:4): [True: 0, False: 86.4k]
  ------------------
  377|      0|	  case fmtULongBinary:
  ------------------
  |  Branch (377:4): [True: 0, False: 86.4k]
  ------------------
  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: 86.4k]
  ------------------
  382|      0|	  case fmtLongLongHex:
  ------------------
  |  Branch (382:4): [True: 0, False: 86.4k]
  ------------------
  383|      0|	  case fmtLongLongOctal:
  ------------------
  |  Branch (383:4): [True: 0, False: 86.4k]
  ------------------
  384|      0|	  case fmtLongLongBinary:
  ------------------
  |  Branch (384:4): [True: 0, False: 86.4k]
  ------------------
  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: 86.4k]
  ------------------
  390|      0|	  case fmtULongLongHex:
  ------------------
  |  Branch (390:4): [True: 0, False: 86.4k]
  ------------------
  391|      0|	  case fmtULongLongOctal:
  ------------------
  |  Branch (391:4): [True: 0, False: 86.4k]
  ------------------
  392|      0|	  case fmtULongLongBinary:
  ------------------
  |  Branch (392:4): [True: 0, False: 86.4k]
  ------------------
  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: 86.4k]
  ------------------
  397|      0|	  case fmtDoubleTrim:
  ------------------
  |  Branch (397:4): [True: 0, False: 86.4k]
  ------------------
  398|      0|	    args[argsLen].f = va_arg(argList, double);
  399|      0|	    break;
  400|      0|	  case fmtChar:
  ------------------
  |  Branch (400:4): [True: 0, False: 86.4k]
  ------------------
  401|      0|	    args[argsLen].c = (char)va_arg(argList, int);
  402|      0|	    break;
  403|      0|	  case fmtString:
  ------------------
  |  Branch (403:4): [True: 0, False: 86.4k]
  ------------------
  404|      0|	    args[argsLen].s = va_arg(argList, char *);
  405|      0|	    break;
  406|  55.9k|	  case fmtGString:
  ------------------
  |  Branch (406:4): [True: 55.9k, False: 30.4k]
  ------------------
  407|  55.9k|	    args[argsLen].gs = va_arg(argList, GString *);
  408|  55.9k|	    break;
  409|  86.4k|	  }
  410|  86.4k|	  ++argsLen;
  411|  86.4k|	}
  412|       |
  413|       |	// format the argument
  414|  86.4k|	arg = args[idx];
  415|  86.4k|	str = NULL;
  416|  86.4k|	len = 0;
  417|  86.4k|	switch (ft) {
  ------------------
  |  Branch (417:10): [True: 86.4k, False: 0]
  ------------------
  418|  30.4k|	case fmtIntDecimal:
  ------------------
  |  Branch (418:2): [True: 30.4k, False: 55.9k]
  ------------------
  419|  30.4k|	  formatInt(arg.i, buf, sizeof(buf), zeroFill, width, 10, &str, &len);
  420|  30.4k|	  break;
  421|      0|	case fmtIntHex:
  ------------------
  |  Branch (421:2): [True: 0, False: 86.4k]
  ------------------
  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: 86.4k]
  ------------------
  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: 86.4k]
  ------------------
  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: 86.4k]
  ------------------
  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: 86.4k]
  ------------------
  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: 86.4k]
  ------------------
  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: 86.4k]
  ------------------
  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: 86.4k]
  ------------------
  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: 86.4k]
  ------------------
  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: 86.4k]
  ------------------
  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: 86.4k]
  ------------------
  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: 86.4k]
  ------------------
  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: 86.4k]
  ------------------
  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: 86.4k]
  ------------------
  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: 86.4k]
  ------------------
  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: 86.4k]
  ------------------
  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: 86.4k]
  ------------------
  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: 86.4k]
  ------------------
  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: 86.4k]
  ------------------
  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: 86.4k]
  ------------------
  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: 86.4k]
  ------------------
  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: 86.4k]
  ------------------
  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: 86.4k]
  ------------------
  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: 86.4k]
  ------------------
  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: 86.4k]
  ------------------
  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: 86.4k]
  ------------------
  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: 86.4k]
  ------------------
  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|  55.9k|	case fmtGString:
  ------------------
  |  Branch (524:2): [True: 55.9k, False: 30.4k]
  ------------------
  525|  55.9k|	  if (arg.gs) {
  ------------------
  |  Branch (525:8): [True: 55.9k, False: 0]
  ------------------
  526|  55.9k|	    str = arg.gs->getCString();
  527|  55.9k|	    len = arg.gs->getLength();
  528|  55.9k|	  } else {
  529|      0|	    str = "(null)";
  530|      0|	    len = 6;
  531|      0|	  }
  532|  55.9k|	  reverseAlign = !reverseAlign;
  533|  55.9k|	  break;
  534|      0|	case fmtSpace:
  ------------------
  |  Branch (534:2): [True: 0, False: 86.4k]
  ------------------
  535|      0|	  str = buf;
  536|      0|	  len = 0;
  537|      0|	  width = arg.i;
  538|      0|	  break;
  539|  86.4k|	}
  540|       |
  541|       |	// append the formatted arg, handling width and alignment
  542|  86.4k|	if (!reverseAlign && len < width) {
  ------------------
  |  Branch (542:6): [True: 30.4k, False: 55.9k]
  |  Branch (542:23): [True: 0, False: 30.4k]
  ------------------
  543|      0|	  for (i = len; i < width; ++i) {
  ------------------
  |  Branch (543:18): [True: 0, False: 0]
  ------------------
  544|      0|	    append(' ');
  545|      0|	  }
  546|      0|	}
  547|  86.4k|	append(str, len);
  548|  86.4k|	if (reverseAlign && len < width) {
  ------------------
  |  Branch (548:6): [True: 55.9k, False: 30.4k]
  |  Branch (548:22): [True: 0, False: 55.9k]
  ------------------
  549|      0|	  for (i = len; i < width; ++i) {
  ------------------
  |  Branch (549:18): [True: 0, False: 0]
  ------------------
  550|      0|	    append(' ');
  551|      0|	  }
  552|      0|	}
  553|  86.4k|      }
  554|       |
  555|  88.8k|    } else if (*p0 == '}') {
  ------------------
  |  Branch (555:16): [True: 0, False: 88.8k]
  ------------------
  556|      0|      ++p0;
  557|      0|      if (*p0 == '}') {
  ------------------
  |  Branch (557:11): [True: 0, False: 0]
  ------------------
  558|      0|	++p0;
  559|      0|      }
  560|      0|      append('}');
  561|       |      
  562|  88.8k|    } else {
  563|  88.8k|      for (p1 = p0 + 1; *p1 && *p1 != '{' && *p1 != '}'; ++p1) ;
  ------------------
  |  Branch (563:25): [True: 58.4k, False: 30.4k]
  |  Branch (563:32): [True: 0, False: 58.4k]
  |  Branch (563:46): [True: 0, False: 0]
  ------------------
  564|  88.8k|      append(p0, (int)(p1 - p0));
  565|  88.8k|      p0 = p1;
  566|  88.8k|    }
  567|   175k|  }
  568|       |
  569|  58.4k|  gfree(args);
  570|  58.4k|  return this;
  571|  58.4k|}
_ZN7GString9formatIntExPciiiiPPKcPi:
  576|  30.4k|			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|  30.4k|  static char vals[17] = "0123456789abcdef";
  583|  30.4k|  GBool neg;
  584|  30.4k|  int start, i, j;
  585|       |
  586|  30.4k|  i = bufSize;
  587|  30.4k|  if ((neg = x < 0)) {
  ------------------
  |  Branch (587:7): [True: 0, False: 30.4k]
  ------------------
  588|      0|    x = -x;
  589|      0|  }
  590|  30.4k|  start = neg ? 1 : 0;
  ------------------
  |  Branch (590:11): [True: 0, False: 30.4k]
  ------------------
  591|  30.4k|  if (x == 0) {
  ------------------
  |  Branch (591:7): [True: 21.8k, False: 8.57k]
  ------------------
  592|  21.8k|    buf[--i] = '0';
  593|  21.8k|  } else {
  594|  19.7k|    while (i > start && x) {
  ------------------
  |  Branch (594:12): [True: 19.7k, False: 0]
  |  Branch (594:25): [True: 11.1k, False: 8.57k]
  ------------------
  595|  11.1k|      buf[--i] = vals[x % base];
  596|  11.1k|      x /= base;
  597|  11.1k|    }
  598|  8.57k|  }
  599|  30.4k|  if (zeroFill) {
  ------------------
  |  Branch (599:7): [True: 0, False: 30.4k]
  ------------------
  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|  30.4k|  if (neg) {
  ------------------
  |  Branch (604:7): [True: 0, False: 30.4k]
  ------------------
  605|      0|    buf[--i] = '-';
  606|      0|  }
  607|  30.4k|  *p = buf + i;
  608|  30.4k|  *len = bufSize - i;
  609|  30.4k|}
_ZN7GString3delEii:
  738|    382|GString *GString::del(int i, int n) {
  739|    382|  int j;
  740|       |
  741|    382|  if (i >= 0 && n > 0 && i <= INT_MAX - n) {
  ------------------
  |  Branch (741:7): [True: 382, False: 0]
  |  Branch (741:17): [True: 382, False: 0]
  |  Branch (741:26): [True: 382, False: 0]
  ------------------
  742|    382|    if (i + n > length) {
  ------------------
  |  Branch (742:9): [True: 0, False: 382]
  ------------------
  743|      0|      n = length - i;
  744|      0|    }
  745|   586k|    for (j = i; j <= length - n; ++j) {
  ------------------
  |  Branch (745:17): [True: 586k, False: 382]
  ------------------
  746|   586k|      s[j] = s[j + n];
  747|   586k|    }
  748|    382|    resize(length -= n);
  749|    382|  }
  750|    382|  return this;
  751|    382|}
_ZN7GString3cmpEPS_:
  775|  27.8k|int GString::cmp(GString *str) {
  776|  27.8k|  int n1, n2, i, x;
  777|  27.8k|  char *p1, *p2;
  778|       |
  779|  27.8k|  n1 = length;
  780|  27.8k|  n2 = str->length;
  781|   614k|  for (i = 0, p1 = s, p2 = str->s; i < n1 && i < n2; ++i, ++p1, ++p2) {
  ------------------
  |  Branch (781:36): [True: 596k, False: 17.6k]
  |  Branch (781:46): [True: 596k, False: 129]
  ------------------
  782|   596k|    x = (*p1 & 0xff) - (*p2 & 0xff);
  783|   596k|    if (x != 0) {
  ------------------
  |  Branch (783:9): [True: 9.99k, False: 586k]
  ------------------
  784|  9.99k|      return x;
  785|  9.99k|    }
  786|   596k|  }
  787|  17.8k|  return n1 - n2;
  788|  27.8k|}
_ZN7GString3cmpEPKc:
  810|  1.36M|int GString::cmp(const char *sA) {
  811|  1.36M|  int n1, i, x;
  812|  1.36M|  const char *p1, *p2;
  813|       |
  814|  1.36M|  n1 = length;
  815|  1.69M|  for (i = 0, p1 = s, p2 = sA; i < n1 && *p2; ++i, ++p1, ++p2) {
  ------------------
  |  Branch (815:32): [True: 1.16M, False: 522k]
  |  Branch (815:42): [True: 1.16M, False: 499]
  ------------------
  816|  1.16M|    x = (*p1 & 0xff) - (*p2 & 0xff);
  817|  1.16M|    if (x != 0) {
  ------------------
  |  Branch (817:9): [True: 840k, False: 327k]
  ------------------
  818|   840k|      return x;
  819|   840k|    }
  820|  1.16M|  }
  821|   522k|  if (i < n1) {
  ------------------
  |  Branch (821:7): [True: 499, False: 522k]
  ------------------
  822|    499|    return 1;
  823|    499|  }
  824|   522k|  if (*p2) {
  ------------------
  |  Branch (824:7): [True: 462k, False: 59.4k]
  ------------------
  825|   462k|    return -1;
  826|   462k|  }
  827|  59.4k|  return 0;
  828|   522k|}
_ZN7GString4cmpNEPKci:
  830|     26|int GString::cmpN(const char *sA, int n) {
  831|     26|  int n1, i, x;
  832|     26|  const char *p1, *p2;
  833|       |
  834|     26|  n1 = length;
  835|     55|  for (i = 0, p1 = s, p2 = sA; i < n1 && *p2 && i < n; ++i, ++p1, ++p2) {
  ------------------
  |  Branch (835:32): [True: 42, False: 13]
  |  Branch (835:42): [True: 42, False: 0]
  |  Branch (835:49): [True: 42, False: 0]
  ------------------
  836|     42|    x = (*p1 & 0xff) - (*p2 & 0xff);
  837|     42|    if (x != 0) {
  ------------------
  |  Branch (837:9): [True: 13, False: 29]
  ------------------
  838|     13|      return x;
  839|     13|    }
  840|     42|  }
  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|  21.5M|inline void GString::resize(int length1) {
  109|  21.5M|  char *s1;
  110|       |
  111|  21.5M|  if (length1 < 0) {
  ------------------
  |  Branch (111:7): [True: 0, False: 21.5M]
  ------------------
  112|      0|    gMemError("GString::resize() with negative length");
  113|      0|  }
  114|  21.5M|  if (!s) {
  ------------------
  |  Branch (114:7): [True: 6.96M, False: 14.5M]
  ------------------
  115|  6.96M|    s = new char[size(length1)];
  116|  14.5M|  } else if (size(length1) != size(length)) {
  ------------------
  |  Branch (116:14): [True: 1.43M, False: 13.1M]
  ------------------
  117|  1.43M|    s1 = new char[size(length1)];
  118|  1.43M|    if (length1 < length) {
  ------------------
  |  Branch (118:9): [True: 0, False: 1.43M]
  ------------------
  119|      0|      memcpy(s1, s, length1);
  120|      0|      s1[length1] = '\0';
  121|  1.43M|    } else {
  122|  1.43M|      memcpy(s1, s, length + 1);
  123|  1.43M|    }
  124|  1.43M|    delete[] s;
  125|  1.43M|    s = s1;
  126|  1.43M|  }
  127|  21.5M|}
GString.cc:_ZL4sizei:
   98|  37.5M|static inline int size(int len) {
   99|  37.5M|  int delta;
  100|   242M|  for (delta = 8; delta < len && delta < 0x100000; delta <<= 1) ;
  ------------------
  |  Branch (100:19): [True: 209M, False: 33.5M]
  |  Branch (100:34): [True: 205M, False: 3.92M]
  ------------------
  101|  37.5M|  if (len > INT_MAX - delta) {
  ------------------
  |  Branch (101:7): [True: 0, False: 37.5M]
  ------------------
  102|      0|    gMemError("Integer overflow in GString::size()");
  103|      0|  }
  104|       |  // this is ((len + 1) + (delta - 1)) & ~(delta - 1)
  105|  37.5M|  return (len + delta) & ~(delta - 1);
  106|  37.5M|}

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

_Z10getHomeDirv:
   49|  40.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|  40.8k|  char *s;
   83|  40.8k|  struct passwd *pw;
   84|  40.8k|  GString *ret;
   85|       |
   86|  40.8k|  if ((s = getenv("HOME"))) {
  ------------------
  |  Branch (86:7): [True: 40.8k, False: 0]
  ------------------
   87|  40.8k|    ret = new GString(s);
   88|  40.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|  40.8k|  return ret;
   99|  40.8k|#endif
  100|  40.8k|}
_Z12appendToPathP7GStringPKc:
  118|   806k|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|   806k|  int i;
  234|       |
  235|       |  // appending "." does nothing
  236|   806k|  if (!strcmp(fileName, "."))
  ------------------
  |  Branch (236:7): [True: 0, False: 806k]
  ------------------
  237|      0|    return path;
  238|       |
  239|       |  // appending ".." goes up one directory
  240|   806k|  if (!strcmp(fileName, "..")) {
  ------------------
  |  Branch (240:7): [True: 0, False: 806k]
  ------------------
  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|   806k|  if (path->getLength() > 0 &&
  ------------------
  |  Branch (259:7): [True: 806k, False: 0]
  ------------------
  260|   806k|      path->getChar(path->getLength() - 1) != '/')
  ------------------
  |  Branch (260:7): [True: 806k, False: 0]
  ------------------
  261|   806k|    path->append('/');
  262|   806k|  path->append(fileName);
  263|   806k|  return path;
  264|   806k|#endif
  265|   806k|}
_Z9createDirPci:
  559|  20.4k|GBool createDir(char *path, int mode) {
  560|       |#ifdef _WIN32
  561|       |  return !_mkdir(path);
  562|       |#else
  563|  20.4k|  return !mkdir(path, mode);
  564|  20.4k|#endif
  565|  20.4k|}

_Z7gmalloci:
  139|   180M|void *gmalloc(int size) GMEM_EXCEP {
  140|   180M|  void *p;
  141|       |
  142|   180M|  if (size < 0) {
  ------------------
  |  Branch (142:7): [True: 54, False: 180M]
  ------------------
  143|     54|    gMemError("Invalid memory allocation size");
  144|     54|  }
  145|   180M|  if (size == 0) {
  ------------------
  |  Branch (145:7): [True: 0, False: 180M]
  ------------------
  146|      0|    return NULL;
  147|      0|  }
  148|   180M|  if (!(p = malloc(size))) {
  ------------------
  |  Branch (148:7): [True: 0, False: 180M]
  ------------------
  149|      0|    gMemError("Out of memory");
  150|      0|  }
  151|   180M|  return p;
  152|   180M|}
_Z8greallocPvi:
  155|  11.8M|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|  11.8M|  void *q;
  182|       |
  183|  11.8M|  if (size < 0) {
  ------------------
  |  Branch (183:7): [True: 0, False: 11.8M]
  ------------------
  184|      0|    gMemError("Invalid memory allocation size");
  185|      0|  }
  186|  11.8M|  if (size == 0) {
  ------------------
  |  Branch (186:7): [True: 0, False: 11.8M]
  ------------------
  187|      0|    if (p) {
  ------------------
  |  Branch (187:9): [True: 0, False: 0]
  ------------------
  188|      0|      free(p);
  189|      0|    }
  190|      0|    return NULL;
  191|      0|  }
  192|  11.8M|  if (p) {
  ------------------
  |  Branch (192:7): [True: 1.99M, False: 9.87M]
  ------------------
  193|  1.99M|    q = realloc(p, size);
  194|  9.87M|  } else {
  195|  9.87M|    q = malloc(size);
  196|  9.87M|  }
  197|  11.8M|  if (!q) {
  ------------------
  |  Branch (197:7): [True: 0, False: 11.8M]
  ------------------
  198|      0|    gMemError("Out of memory");
  199|      0|  }
  200|  11.8M|  return q;
  201|  11.8M|#endif
  202|  11.8M|}
_Z8gmallocnii:
  204|  32.1M|void *gmallocn(int nObjs, int objSize) GMEM_EXCEP {
  205|  32.1M|  int n;
  206|       |
  207|  32.1M|  if (nObjs == 0) {
  ------------------
  |  Branch (207:7): [True: 1.32M, False: 30.8M]
  ------------------
  208|  1.32M|    return NULL;
  209|  1.32M|  }
  210|  30.8M|  if (objSize <= 0 || nObjs < 0 || nObjs >= INT_MAX / objSize) {
  ------------------
  |  Branch (210:7): [True: 0, False: 30.8M]
  |  Branch (210:23): [True: 11, False: 30.8M]
  |  Branch (210:36): [True: 33, False: 30.8M]
  ------------------
  211|     44|    gMemError("Bogus memory allocation size");
  212|     44|  }
  213|  30.8M|  n = nObjs * objSize;
  214|  30.8M|  return gmalloc(n);
  215|  32.1M|}
_Z9greallocnPvii:
  291|  11.8M|void *greallocn(void *p, int nObjs, int objSize) GMEM_EXCEP {
  292|  11.8M|  int n;
  293|       |
  294|  11.8M|  if (nObjs == 0) {
  ------------------
  |  Branch (294:7): [True: 26, False: 11.8M]
  ------------------
  295|     26|    if (p) {
  ------------------
  |  Branch (295:9): [True: 0, False: 26]
  ------------------
  296|      0|      gfree(p);
  297|      0|    }
  298|     26|    return NULL;
  299|     26|  }
  300|  11.8M|  if (objSize <= 0 || nObjs < 0 || nObjs >= INT_MAX / objSize) {
  ------------------
  |  Branch (300:7): [True: 0, False: 11.8M]
  |  Branch (300:23): [True: 0, False: 11.8M]
  |  Branch (300:36): [True: 0, False: 11.8M]
  ------------------
  301|      0|    gMemError("Bogus memory allocation size");
  302|      0|  }
  303|  11.8M|  n = nObjs * objSize;
  304|  11.8M|  return grealloc(p, n);
  305|  11.8M|}
_Z5gfreePv:
  307|   262M|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|   262M|  if (p) {
  ------------------
  |  Branch (348:7): [True: 187M, False: 74.5M]
  ------------------
  349|   187M|    free(p);
  350|   187M|  }
  351|   262M|#endif
  352|   262M|}
_Z9gMemErrorPKc:
  354|     98|void gMemError(const char *msg) GMEM_EXCEP {
  355|     98|#if USE_EXCEPTIONS
  356|     98|  throw GMemException();
  357|       |#else
  358|       |  fprintf(stderr, "%s\n", msg);
  359|       |  exit(1);
  360|       |#endif
  361|     98|}
_Z10copyStringPKc:
  390|   105M|char *copyString(const char *s) {
  391|   105M|  char *s1;
  392|       |
  393|   105M|  s1 = (char *)gmalloc((int)strlen(s) + 1);
  394|   105M|  strcpy(s1, s);
  395|   105M|  return s1;
  396|   105M|}

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

_ZN8AcroForm4loadEP6PDFDocP7CatalogP6Object:
  337|  2.56k|AcroForm *AcroForm::load(PDFDoc *docA, Catalog *catalog, Object *acroFormObjA) {
  338|  2.56k|  Object acroFormObj2;
  339|  2.56k|  AcroForm *acroForm;
  340|  2.56k|  AcroFormField *field;
  341|  2.56k|  Object xfaObj, fieldsObj, annotsObj, annotRef, annotObj, obj1, obj2;
  342|  2.56k|  char *touchedObjs;
  343|  2.56k|  int pageNum, i, j;
  344|       |
  345|  2.56k|  touchedObjs = (char *)gmalloc(docA->getXRef()->getNumObjects());
  346|  2.56k|  memset(touchedObjs, 0, docA->getXRef()->getNumObjects());
  347|       |
  348|       |  // this is the normal case: acroFormObj is a dictionary, as expected
  349|  2.56k|  if (acroFormObjA->isDict()) {
  ------------------
  |  Branch (349:7): [True: 1.31k, False: 1.25k]
  ------------------
  350|  1.31k|    acroForm = new AcroForm(docA, acroFormObjA);
  351|       |
  352|  1.31k|    if (globalParams->getEnableXFA()) {
  ------------------
  |  Branch (352:9): [True: 1.31k, False: 0]
  ------------------
  353|  1.31k|      if (!acroFormObjA->dictLookup("XFA", &xfaObj)->isNull()) {
  ------------------
  |  Branch (353:11): [True: 1.08k, False: 232]
  ------------------
  354|  1.08k|	acroForm->xfaScanner = XFAScanner::load(&xfaObj);
  355|  1.08k|	if (!catalog->getNeedsRendering()) {
  ------------------
  |  Branch (355:6): [True: 1.07k, False: 9]
  ------------------
  356|  1.07k|	  acroForm->isStaticXFA = gTrue;
  ------------------
  |  |   17|  1.07k|#define gTrue 1
  ------------------
  357|  1.07k|	}
  358|  1.08k|      }
  359|  1.31k|      xfaObj.free();
  360|  1.31k|    }
  361|       |
  362|  1.31k|    if (acroFormObjA->dictLookup("NeedAppearances", &obj1)->isBool()) {
  ------------------
  |  Branch (362:9): [True: 30, False: 1.28k]
  ------------------
  363|     30|      acroForm->needAppearances = obj1.getBool();
  364|     30|    }
  365|  1.31k|    obj1.free();
  366|       |
  367|  1.31k|    acroForm->buildAnnotPageList(catalog);
  368|       |
  369|  1.31k|    if (!acroFormObjA->dictLookup("Fields", &obj1)->isArray()) {
  ------------------
  |  Branch (369:9): [True: 8, False: 1.31k]
  ------------------
  370|      8|      if (!obj1.isNull()) {
  ------------------
  |  Branch (370:11): [True: 2, False: 6]
  ------------------
  371|      2|	error(errSyntaxError, -1, "AcroForm Fields entry is wrong type");
  372|      2|      }
  373|      8|      obj1.free();
  374|      8|      delete acroForm;
  375|      8|      gfree(touchedObjs);
  376|      8|      return NULL;
  377|      8|    }
  378|  33.0k|    for (i = 0; i < obj1.arrayGetLength(); ++i) {
  ------------------
  |  Branch (378:17): [True: 31.7k, False: 1.31k]
  ------------------
  379|  31.7k|      obj1.arrayGetNF(i, &obj2);
  380|  31.7k|      acroForm->scanField(&obj2, touchedObjs);
  381|  31.7k|      obj2.free();
  382|  31.7k|    }
  383|  1.31k|    obj1.free();
  384|       |
  385|       |    // scan the annotations, looking for Widget-type annots that are
  386|       |    // not attached to the AcroForm object
  387|  94.5k|    for (pageNum = 1; pageNum <= catalog->getNumPages(); ++pageNum) {
  ------------------
  |  Branch (387:23): [True: 93.2k, False: 1.31k]
  ------------------
  388|  93.2k|      if (catalog->getPage(pageNum)->getAnnots(&annotsObj)->isArray()) {
  ------------------
  |  Branch (388:11): [True: 78.8k, False: 14.3k]
  ------------------
  389|  3.31M|	for (i = 0; i < annotsObj.arrayGetLength(); ++i) {
  ------------------
  |  Branch (389:14): [True: 3.23M, False: 78.8k]
  ------------------
  390|  3.23M|	  if (annotsObj.arrayGetNF(i, &annotRef)->isRef()) {
  ------------------
  |  Branch (390:8): [True: 751k, False: 2.48M]
  ------------------
  391|  1.09M|	    for (j = 0; j < acroForm->fields->getLength(); ++j) {
  ------------------
  |  Branch (391:18): [True: 421k, False: 673k]
  ------------------
  392|   421k|	      field = (AcroFormField *)acroForm->fields->get(j);
  393|   421k|	      if (field->fieldRef.isRef()) {
  ------------------
  |  Branch (393:12): [True: 366k, False: 55.2k]
  ------------------
  394|   366k|		if (field->fieldRef.getRefNum() == annotRef.getRefNum() &&
  ------------------
  |  Branch (394:7): [True: 111k, False: 255k]
  ------------------
  395|   111k|		    field->fieldRef.getRefGen() == annotRef.getRefGen()) {
  ------------------
  |  Branch (395:7): [True: 77.8k, False: 33.3k]
  ------------------
  396|  77.8k|		  break;
  397|  77.8k|		}
  398|   366k|	      }
  399|   421k|	    }
  400|   751k|	    if (j == acroForm->fields->getLength()) {
  ------------------
  |  Branch (400:10): [True: 673k, False: 77.8k]
  ------------------
  401|   673k|	      annotRef.fetch(acroForm->doc->getXRef(), &annotObj);
  402|   673k|	      if (annotObj.isDict()) {
  ------------------
  |  Branch (402:12): [True: 90.0k, False: 583k]
  ------------------
  403|  90.0k|		if (annotObj.dictLookup("Subtype", &obj1)->isName("Widget")) {
  ------------------
  |  Branch (403:7): [True: 710, False: 89.3k]
  ------------------
  404|    710|		  acroForm->scanField(&annotRef, touchedObjs);
  405|    710|		}
  406|  90.0k|		obj1.free();
  407|  90.0k|	      }
  408|   673k|	      annotObj.free();
  409|   673k|	    }
  410|   751k|	  }
  411|  3.23M|	  annotRef.free();
  412|  3.23M|	}
  413|  78.8k|      }
  414|  93.2k|      annotsObj.free();
  415|  93.2k|    }
  416|       |
  417|       |  // if acroFormObjA is a null object, but there are Widget-type
  418|       |  // annots, we still create an AcroForm
  419|  1.31k|  } else {
  420|       |    // create an empty dict for acroFormObj
  421|  1.25k|    acroFormObj2.initDict(docA->getXRef());
  422|  1.25k|    acroForm = new AcroForm(docA, &acroFormObj2);
  423|  1.25k|    acroFormObj2.free();
  424|       |
  425|  1.25k|    acroForm->buildAnnotPageList(catalog);
  426|       |
  427|       |    // scan the annotations, looking for any Widget-type annots
  428|  62.1k|    for (pageNum = 1; pageNum <= catalog->getNumPages(); ++pageNum) {
  ------------------
  |  Branch (428:23): [True: 60.9k, False: 1.25k]
  ------------------
  429|  60.9k|      if (catalog->getPage(pageNum)->getAnnots(&annotsObj)->isArray()) {
  ------------------
  |  Branch (429:11): [True: 22.7k, False: 38.1k]
  ------------------
  430|   629k|	for (i = 0; i < annotsObj.arrayGetLength(); ++i) {
  ------------------
  |  Branch (430:14): [True: 606k, False: 22.7k]
  ------------------
  431|   606k|	  if (annotsObj.arrayGetNF(i, &annotRef)->isRef()) {
  ------------------
  |  Branch (431:8): [True: 147k, False: 458k]
  ------------------
  432|   147k|	    annotRef.fetch(acroForm->doc->getXRef(), &annotObj);
  433|   147k|	    if (annotObj.isDict()) {
  ------------------
  |  Branch (433:10): [True: 67.9k, False: 79.8k]
  ------------------
  434|  67.9k|	      if (annotObj.dictLookup("Subtype", &obj1)->isName("Widget")) {
  ------------------
  |  Branch (434:12): [True: 44.4k, False: 23.5k]
  ------------------
  435|  44.4k|		acroForm->scanField(&annotRef, touchedObjs);
  436|  44.4k|	      }
  437|  67.9k|	      obj1.free();
  438|  67.9k|	    }
  439|   147k|	    annotObj.free();
  440|   147k|	  }
  441|   606k|	  annotRef.free();
  442|   606k|	}
  443|  22.7k|      }
  444|  60.9k|      annotsObj.free();
  445|  60.9k|    }
  446|       |
  447|  1.25k|    if (acroForm->fields->getLength() == 0) {
  ------------------
  |  Branch (447:9): [True: 1.23k, False: 16]
  ------------------
  448|  1.23k|      delete acroForm;
  449|  1.23k|      acroForm = NULL;
  450|  1.23k|    }
  451|  1.25k|  }
  452|       |
  453|  2.56k|  gfree(touchedObjs);
  454|       |
  455|  2.56k|  return acroForm;
  456|  2.56k|}
_ZN8AcroFormC2EP6PDFDocP6Object:
  458|  2.56k|AcroForm::AcroForm(PDFDoc *docA, Object *acroFormObjA) {
  459|  2.56k|  doc = docA;
  460|  2.56k|  acroFormObjA->copy(&acroFormObj);
  461|  2.56k|  needAppearances = gFalse;
  ------------------
  |  |   18|  2.56k|#define gFalse 0
  ------------------
  462|  2.56k|  annotPages = new GList();
  463|  2.56k|  fields = new GList();
  464|  2.56k|  xfaScanner = NULL;
  465|  2.56k|  isStaticXFA = gFalse;
  ------------------
  |  |   18|  2.56k|#define gFalse 0
  ------------------
  466|  2.56k|}
_ZN8AcroFormD2Ev:
  468|  2.56k|AcroForm::~AcroForm() {
  469|  2.56k|  acroFormObj.free();
  470|  2.56k|  deleteGList(annotPages, AcroFormAnnotPage);
  ------------------
  |  |   94|  2.56k|  do {                                              \
  |  |   95|  2.56k|    GList *_list = (list);                          \
  |  |   96|  2.56k|    {                                               \
  |  |   97|  2.56k|      int _i;                                       \
  |  |   98|   902k|      for (_i = 0; _i < _list->getLength(); ++_i) { \
  |  |  ------------------
  |  |  |  Branch (98:20): [True: 899k, False: 2.56k]
  |  |  ------------------
  |  |   99|   899k|        delete (T*)_list->get(_i);                  \
  |  |  100|   899k|      }                                             \
  |  |  101|  2.56k|      delete _list;                                 \
  |  |  102|  2.56k|    }                                               \
  |  |  103|  2.56k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (103:12): [Folded, False: 2.56k]
  |  |  ------------------
  ------------------
  471|  2.56k|  deleteGList(fields, AcroFormField);
  ------------------
  |  |   94|  2.56k|  do {                                              \
  |  |   95|  2.56k|    GList *_list = (list);                          \
  |  |   96|  2.56k|    {                                               \
  |  |   97|  2.56k|      int _i;                                       \
  |  |   98|  5.31k|      for (_i = 0; _i < _list->getLength(); ++_i) { \
  |  |  ------------------
  |  |  |  Branch (98:20): [True: 2.74k, False: 2.56k]
  |  |  ------------------
  |  |   99|  2.74k|        delete (T*)_list->get(_i);                  \
  |  |  100|  2.74k|      }                                             \
  |  |  101|  2.56k|      delete _list;                                 \
  |  |  102|  2.56k|    }                                               \
  |  |  103|  2.56k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (103:12): [Folded, False: 2.56k]
  |  |  ------------------
  ------------------
  472|  2.56k|  delete xfaScanner;
  473|  2.56k|}
_ZN8AcroForm18buildAnnotPageListEP7Catalog:
  479|  2.56k|void AcroForm::buildAnnotPageList(Catalog *catalog) {
  480|  2.56k|  Object annotsObj, annotObj;
  481|  2.56k|  int pageNum, i;
  482|       |
  483|   156k|  for (pageNum = 1; pageNum <= catalog->getNumPages(); ++pageNum) {
  ------------------
  |  Branch (483:21): [True: 154k, False: 2.56k]
  ------------------
  484|   154k|    if (catalog->getPage(pageNum)->getAnnots(&annotsObj)->isArray()) {
  ------------------
  |  Branch (484:9): [True: 101k, False: 52.5k]
  ------------------
  485|  3.94M|      for (i = 0; i < annotsObj.arrayGetLength(); ++i) {
  ------------------
  |  Branch (485:19): [True: 3.84M, False: 101k]
  ------------------
  486|  3.84M|	if (annotsObj.arrayGetNF(i, &annotObj)->isRef()) {
  ------------------
  |  Branch (486:6): [True: 899k, False: 2.94M]
  ------------------
  487|   899k|	  annotPages->append(new AcroFormAnnotPage(annotObj.getRefNum(),
  488|   899k|						   annotObj.getRefGen(),
  489|   899k|						   pageNum));
  490|   899k|	}
  491|  3.84M|	annotObj.free();
  492|  3.84M|      }
  493|   101k|    }
  494|   154k|    annotsObj.free();
  495|   154k|  }
  496|       |  //~ sort the list
  497|  2.56k|}
_ZN8AcroForm9scanFieldEP6ObjectPc:
  518|  80.3k|void AcroForm::scanField(Object *fieldRef, char *touchedObjs) {
  519|  80.3k|  AcroFormField *field;
  520|  80.3k|  Object fieldObj, kidsRef, kidsObj, kidRef, kidObj, subtypeObj;
  521|  80.3k|  GBool isTerminal;
  522|  80.3k|  int i;
  523|       |
  524|       |  // check for an object loop
  525|  80.3k|  if (fieldRef->isRef()) {
  ------------------
  |  Branch (525:7): [True: 50.5k, False: 29.8k]
  ------------------
  526|  50.5k|    if (fieldRef->getRefNum() < 0 ||
  ------------------
  |  Branch (526:9): [True: 0, False: 50.5k]
  ------------------
  527|  50.5k|	fieldRef->getRefNum() >= doc->getXRef()->getNumObjects() ||
  ------------------
  |  Branch (527:2): [True: 560, False: 49.9k]
  ------------------
  528|  49.9k|	touchedObjs[fieldRef->getRefNum()]) {
  ------------------
  |  Branch (528:2): [True: 44.9k, False: 4.99k]
  ------------------
  529|  45.5k|      return;
  530|  45.5k|    }
  531|  4.99k|    touchedObjs[fieldRef->getRefNum()] = 1;
  532|  4.99k|  }
  533|       |
  534|  34.8k|  fieldRef->fetch(doc->getXRef(), &fieldObj);
  535|  34.8k|  if (!fieldObj.isDict()) {
  ------------------
  |  Branch (535:7): [True: 30.3k, False: 4.47k]
  ------------------
  536|  30.3k|    error(errSyntaxError, -1, "AcroForm field object is wrong type");
  537|  30.3k|    fieldObj.free();
  538|  30.3k|    return;
  539|  30.3k|  }
  540|       |
  541|       |  // look for a Kids entry, and check for an object loop there
  542|  4.47k|  if (fieldObj.dictLookupNF("Kids", &kidsRef)->isRef()) {
  ------------------
  |  Branch (542:7): [True: 100, False: 4.37k]
  ------------------
  543|    100|    if (kidsRef.getRefNum() < 0 ||
  ------------------
  |  Branch (543:9): [True: 0, False: 100]
  ------------------
  544|    100|	kidsRef.getRefNum() >= doc->getXRef()->getNumObjects() ||
  ------------------
  |  Branch (544:2): [True: 44, False: 56]
  ------------------
  545|     84|	touchedObjs[kidsRef.getRefNum()]) {
  ------------------
  |  Branch (545:2): [True: 40, False: 16]
  ------------------
  546|     84|      kidsRef.free();
  547|     84|      fieldObj.free();
  548|     84|      return;
  549|     84|    }
  550|     16|    touchedObjs[kidsRef.getRefNum()] = 1;
  551|     16|    kidsRef.fetch(doc->getXRef(), &kidsObj);
  552|  4.37k|  } else {
  553|  4.37k|    kidsRef.copy(&kidsObj);
  554|  4.37k|  }
  555|  4.39k|  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|  4.39k|  isTerminal = gTrue;
  ------------------
  |  |   17|  4.39k|#define gTrue 1
  ------------------
  562|  4.39k|  if (kidsObj.isArray()) {
  ------------------
  |  Branch (562:7): [True: 299, False: 4.09k]
  ------------------
  563|    299|    isTerminal = gFalse;
  ------------------
  |  |   18|    299|#define gFalse 0
  ------------------
  564|  6.06k|    for (i = 0; !isTerminal && i < kidsObj.arrayGetLength(); ++i) {
  ------------------
  |  Branch (564:17): [True: 5.97k, False: 88]
  |  Branch (564:32): [True: 5.76k, False: 211]
  ------------------
  565|  5.76k|      kidsObj.arrayGet(i, &kidObj);
  566|  5.76k|      if (kidObj.isDict()) {
  ------------------
  |  Branch (566:11): [True: 608, False: 5.15k]
  ------------------
  567|    608|	if (kidObj.dictLookup("Parent", &subtypeObj)->isNull()) {
  ------------------
  |  Branch (567:6): [True: 88, False: 520]
  ------------------
  568|     88|	  isTerminal = gTrue;
  ------------------
  |  |   17|     88|#define gTrue 1
  ------------------
  569|     88|	}
  570|    608|	subtypeObj.free();
  571|    608|      }
  572|  5.76k|      kidObj.free();
  573|  5.76k|    }
  574|    299|    if (!isTerminal) {
  ------------------
  |  Branch (574:9): [True: 211, False: 88]
  ------------------
  575|  3.64k|      for (i = 0; !isTerminal && i < kidsObj.arrayGetLength(); ++i) {
  ------------------
  |  Branch (575:19): [True: 3.64k, False: 0]
  |  Branch (575:34): [True: 3.43k, False: 211]
  ------------------
  576|  3.43k|	kidsObj.arrayGetNF(i, &kidRef);
  577|  3.43k|	scanField(&kidRef, touchedObjs);
  578|  3.43k|	kidRef.free();
  579|  3.43k|      }
  580|    211|    }
  581|    299|  }
  582|  4.39k|  kidsObj.free();
  583|       |
  584|  4.39k|  if (isTerminal) {
  ------------------
  |  Branch (584:7): [True: 4.18k, False: 211]
  ------------------
  585|  4.18k|    if ((field = AcroFormField::load(this, fieldRef))) {
  ------------------
  |  Branch (585:9): [True: 2.74k, False: 1.43k]
  ------------------
  586|  2.74k|      fields->append(field);
  587|  2.74k|    }
  588|  4.18k|  }
  589|       |
  590|  4.39k|  fieldObj.free();
  591|  4.39k|}
_ZN13AcroFormField4loadEP8AcroFormP6Object:
  647|  4.18k|AcroFormField *AcroFormField::load(AcroForm *acroFormA, Object *fieldRefA) {
  648|  4.18k|  GString *typeStr;
  649|  4.18k|  TextString *nameA;
  650|  4.18k|  GString *xfaName;
  651|  4.18k|  Guint flagsA;
  652|  4.18k|  GBool haveFlags, typeFromParentA;
  653|  4.18k|  Object fieldObjA, parentObj, parentObj2, obj1, obj2;
  654|  4.18k|  AcroFormFieldType typeA;
  655|  4.18k|  XFAField *xfaFieldA;
  656|  4.18k|  AcroFormField *field;
  657|  4.18k|  int depth, i0, i1;
  658|       |
  659|  4.18k|  fieldRefA->fetch(acroFormA->doc->getXRef(), &fieldObjA);
  660|       |
  661|       |  //----- get field info
  662|       |
  663|  4.18k|  if (fieldObjA.dictLookup("T", &obj1)->isString()) {
  ------------------
  |  Branch (663:7): [True: 2.63k, False: 1.54k]
  ------------------
  664|  2.63k|    nameA = new TextString(obj1.getString());
  665|  2.63k|  } else {
  666|  1.54k|    nameA = new TextString();
  667|  1.54k|  }
  668|  4.18k|  obj1.free();
  669|       |
  670|  4.18k|  if (fieldObjA.dictLookup("FT", &obj1)->isName()) {
  ------------------
  |  Branch (670:7): [True: 2.52k, False: 1.65k]
  ------------------
  671|  2.52k|    typeStr = new GString(obj1.getName());
  672|  2.52k|    typeFromParentA = gFalse;
  ------------------
  |  |   18|  2.52k|#define gFalse 0
  ------------------
  673|  2.52k|  } else {
  674|  1.65k|    typeStr = NULL;
  675|  1.65k|    typeFromParentA = gTrue;
  ------------------
  |  |   17|  1.65k|#define gTrue 1
  ------------------
  676|  1.65k|  }
  677|  4.18k|  obj1.free();
  678|       |
  679|  4.18k|  if (fieldObjA.dictLookup("Ff", &obj1)->isInt()) {
  ------------------
  |  Branch (679:7): [True: 1.84k, False: 2.34k]
  ------------------
  680|  1.84k|    flagsA = (Guint)obj1.getInt();
  681|  1.84k|    haveFlags = gTrue;
  ------------------
  |  |   17|  1.84k|#define gTrue 1
  ------------------
  682|  2.34k|  } else {
  683|  2.34k|    flagsA = 0;
  684|  2.34k|    haveFlags = gFalse;
  ------------------
  |  |   18|  2.34k|#define gFalse 0
  ------------------
  685|  2.34k|  }
  686|  4.18k|  obj1.free();
  687|       |
  688|       |  //----- get info from parent non-terminal fields
  689|       |
  690|  4.18k|  fieldObjA.dictLookup("Parent", &parentObj);
  691|  4.18k|  depth = 0;
  692|  37.2k|  while (parentObj.isDict() && depth < maxFieldObjectDepth) {
  ------------------
  |  |   72|  33.7k|#define maxFieldObjectDepth 50
  ------------------
  |  Branch (692:10): [True: 33.7k, False: 3.55k]
  |  Branch (692:32): [True: 33.0k, False: 624]
  ------------------
  693|       |
  694|  33.0k|    if (parentObj.dictLookup("T", &obj1)->isString()) {
  ------------------
  |  Branch (694:9): [True: 32.3k, False: 759]
  ------------------
  695|  32.3k|      if (nameA->getLength()) {
  ------------------
  |  Branch (695:11): [True: 31.7k, False: 539]
  ------------------
  696|  31.7k|	nameA->insert(0, (Unicode)'.');
  697|  31.7k|      }
  698|  32.3k|      nameA->insert(0, obj1.getString());
  699|  32.3k|    }
  700|  33.0k|    obj1.free();
  701|       |
  702|  33.0k|    if (!typeStr) {
  ------------------
  |  Branch (702:9): [True: 2.31k, False: 30.7k]
  ------------------
  703|  2.31k|      if (parentObj.dictLookup("FT", &obj1)->isName()) {
  ------------------
  |  Branch (703:11): [True: 325, False: 1.99k]
  ------------------
  704|    325|	typeStr = new GString(obj1.getName());
  705|    325|      }
  706|  2.31k|      obj1.free();
  707|  2.31k|    }
  708|       |
  709|  33.0k|    if (!haveFlags) {
  ------------------
  |  Branch (709:9): [True: 4.21k, False: 28.8k]
  ------------------
  710|  4.21k|      if (parentObj.dictLookup("Ff", &obj1)->isInt()) {
  ------------------
  |  Branch (710:11): [True: 440, False: 3.77k]
  ------------------
  711|    440|	flagsA = (Guint)obj1.getInt();
  712|    440|	haveFlags = gTrue;
  ------------------
  |  |   17|    440|#define gTrue 1
  ------------------
  713|    440|      }
  714|  4.21k|      obj1.free();
  715|  4.21k|    }
  716|       |
  717|  33.0k|    parentObj.dictLookup("Parent", &parentObj2);
  718|  33.0k|    parentObj.free();
  719|  33.0k|    parentObj = parentObj2;
  720|       |
  721|  33.0k|    ++depth;
  722|  33.0k|  }
  723|  4.18k|  parentObj.free();
  724|       |
  725|  4.18k|  if (!typeStr) {
  ------------------
  |  Branch (725:7): [True: 1.32k, False: 2.85k]
  ------------------
  726|  1.32k|    error(errSyntaxError, -1, "Missing type in AcroForm field");
  727|  1.32k|    goto err1;
  728|  1.32k|  }
  729|       |
  730|       |  //----- get static XFA info
  731|       |
  732|  2.85k|  xfaFieldA = NULL;
  733|  2.85k|  if (acroFormA->xfaScanner) {
  ------------------
  |  Branch (733:7): [True: 129, False: 2.72k]
  ------------------
  734|       |    // convert field name to UTF-8, and remove segments that start
  735|       |    // with '#' -- to match the XFA field name
  736|    129|    xfaName = nameA->toUTF8();
  737|    129|    i0 = 0;
  738|  1.11k|    while (i0 < xfaName->getLength()) {
  ------------------
  |  Branch (738:12): [True: 984, False: 129]
  ------------------
  739|    984|      i1 = i0;
  740|  61.7k|      while (i1 < xfaName->getLength()) {
  ------------------
  |  Branch (740:14): [True: 61.7k, False: 91]
  ------------------
  741|  61.7k|	if (xfaName->getChar(i1) == '.') {
  ------------------
  |  Branch (741:6): [True: 893, False: 60.8k]
  ------------------
  742|    893|	  ++i1;
  743|    893|	  break;
  744|    893|	}
  745|  60.8k|	++i1;
  746|  60.8k|      }
  747|    984|      if (xfaName->getChar(i0) == '#') {
  ------------------
  |  Branch (747:11): [True: 382, False: 602]
  ------------------
  748|    382|	xfaName->del(i0, i1 - i0);
  749|    602|      } else {
  750|    602|	i0 = i1;
  751|    602|      }
  752|    984|    }
  753|    129|    xfaFieldA = acroFormA->xfaScanner->findField(xfaName);
  754|    129|    delete xfaName;
  755|    129|  }
  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|  2.85k|  if (typeFromParentA && !typeStr->cmp("Btn") && !haveFlags) {
  ------------------
  |  Branch (761:7): [True: 325, False: 2.52k]
  |  Branch (761:26): [True: 140, False: 185]
  |  Branch (761:50): [True: 28, False: 112]
  ------------------
  762|     28|    flagsA = acroFormFlagRadio;
  ------------------
  |  |   40|     28|#define acroFormFlagRadio              (1 << 15)  // button
  ------------------
  763|     28|  }
  764|       |
  765|       |  //----- determine field type
  766|       |
  767|  2.85k|  if (!typeStr->cmp("Btn")) {
  ------------------
  |  Branch (767:7): [True: 687, False: 2.16k]
  ------------------
  768|    687|    if (flagsA & acroFormFlagPushbutton) {
  ------------------
  |  |   41|    687|#define acroFormFlagPushbutton         (1 << 16)  // button
  ------------------
  |  Branch (768:9): [True: 51, False: 636]
  ------------------
  769|     51|      typeA = acroFormFieldPushbutton;
  770|    636|    } else if (flagsA & acroFormFlagRadio) {
  ------------------
  |  |   40|    636|#define acroFormFlagRadio              (1 << 15)  // button
  ------------------
  |  Branch (770:16): [True: 180, False: 456]
  ------------------
  771|    180|      typeA = acroFormFieldRadioButton;
  772|    456|    } else {
  773|    456|      typeA = acroFormFieldCheckbox;
  774|    456|    }
  775|  2.16k|  } else if (!typeStr->cmp("Tx")) {
  ------------------
  |  Branch (775:14): [True: 2.03k, False: 131]
  ------------------
  776|  2.03k|    if (xfaFieldA && xfaFieldA->getBarcodeInfo()) {
  ------------------
  |  Branch (776:9): [True: 0, False: 2.03k]
  |  Branch (776:22): [True: 0, False: 0]
  ------------------
  777|      0|      typeA = acroFormFieldBarcode;
  778|  2.03k|    } else if (flagsA & acroFormFlagFileSelect) {
  ------------------
  |  |   45|  2.03k|#define acroFormFlagFileSelect         (1 << 20)  // text
  ------------------
  |  Branch (778:16): [True: 50, False: 1.98k]
  ------------------
  779|     50|      typeA = acroFormFieldFileSelect;
  780|  1.98k|    } else if (flagsA & acroFormFlagMultiline) {
  ------------------
  |  |   37|  1.98k|#define acroFormFlagMultiline          (1 << 12)  // text
  ------------------
  |  Branch (780:16): [True: 178, False: 1.80k]
  ------------------
  781|    178|      typeA = acroFormFieldMultilineText;
  782|  1.80k|    } else {
  783|  1.80k|      typeA = acroFormFieldText;
  784|  1.80k|    }
  785|  2.03k|  } else if (!typeStr->cmp("Ch")) {
  ------------------
  |  Branch (785:14): [True: 24, False: 107]
  ------------------
  786|     24|    if (flagsA & acroFormFlagCombo) {
  ------------------
  |  |   42|     24|#define acroFormFlagCombo              (1 << 17)  // choice
  ------------------
  |  Branch (786:9): [True: 10, False: 14]
  ------------------
  787|     10|      typeA = acroFormFieldComboBox;
  788|     14|    } else {
  789|     14|      typeA = acroFormFieldListBox;
  790|     14|    }
  791|    107|  } else if (!typeStr->cmp("Sig")) {
  ------------------
  |  Branch (791:14): [True: 0, False: 107]
  ------------------
  792|      0|    typeA = acroFormFieldSignature;
  793|    107|  } else {
  794|    107|    error(errSyntaxError, -1, "Invalid type in AcroForm field");
  795|    107|    goto err1;
  796|    107|  }
  797|  2.74k|  delete typeStr;
  798|       |
  799|  2.74k|  field = new AcroFormField(acroFormA, fieldRefA, &fieldObjA,
  800|  2.74k|			    typeA, nameA, flagsA, typeFromParentA, xfaFieldA);
  801|  2.74k|  fieldObjA.free();
  802|  2.74k|  return field;
  803|       |
  804|  1.43k| err1:
  805|  1.43k|  delete typeStr;
  806|  1.43k|  delete nameA;
  807|  1.43k|  fieldObjA.free();
  808|       |  return NULL;
  809|  2.85k|}
_ZN13AcroFormFieldC2EP8AcroFormP6ObjectS3_17AcroFormFieldTypeP10TextStringjiP8XFAField:
  815|  2.74k|			     XFAField *xfaFieldA) {
  816|  2.74k|  acroForm = acroFormA;
  817|  2.74k|  fieldRefA->copy(&fieldRef);
  818|  2.74k|  fieldObjA->copy(&fieldObj);
  819|  2.74k|  type = typeA;
  820|  2.74k|  name = nameA;
  821|  2.74k|  flags = flagsA;
  822|  2.74k|  typeFromParent = typeFromParentA;
  823|  2.74k|  xfaField = xfaFieldA;
  824|  2.74k|}
_ZN13AcroFormFieldD2Ev:
  826|  2.74k|AcroFormField::~AcroFormField() {
  827|  2.74k|  fieldRef.free();
  828|  2.74k|  fieldObj.free();
  829|  2.74k|  delete name;
  830|  2.74k|}
_ZN17AcroFormAnnotPageC2Eiii:
  327|   899k|    { annotNum = annotNumA; annotGen = annotGenA; pageNum = pageNumA; }

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

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

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

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

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

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

_ZN12PageTreeNodeC2E3RefiPS_:
   48|  34.7k|PageTreeNode::PageTreeNode(Ref refA, int countA, PageTreeNode *parentA) {
   49|  34.7k|  ref = refA;
   50|  34.7k|  count = countA;
   51|  34.7k|  parent = parentA;
   52|  34.7k|  kids = NULL;
   53|       |  attrs = NULL;
   54|  34.7k|}
_ZN12PageTreeNodeD2Ev:
   56|  34.7k|PageTreeNode::~PageTreeNode() {
   57|  34.7k|  delete attrs;
   58|  34.7k|  if (kids) {
  ------------------
  |  Branch (58:7): [True: 2.13k, False: 32.6k]
  ------------------
   59|  2.13k|    deleteGList(kids, PageTreeNode);
  ------------------
  |  |   94|  2.13k|  do {                                              \
  |  |   95|  2.13k|    GList *_list = (list);                          \
  |  |   96|  2.13k|    {                                               \
  |  |   97|  2.13k|      int _i;                                       \
  |  |   98|  34.2k|      for (_i = 0; _i < _list->getLength(); ++_i) { \
  |  |  ------------------
  |  |  |  Branch (98:20): [True: 32.1k, False: 2.13k]
  |  |  ------------------
  |  |   99|  32.1k|        delete (T*)_list->get(_i);                  \
  |  |  100|  32.1k|      }                                             \
  |  |  101|  2.13k|      delete _list;                                 \
  |  |  102|  2.13k|    }                                               \
  |  |  103|  2.13k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (103:12): [Folded, False: 2.13k]
  |  |  ------------------
  ------------------
   60|  2.13k|  }
   61|  34.7k|}
_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|    790|PageLabelNode::PageLabelNode(int firstPageA, Dict *dict) {
  106|    790|  Object prefixObj, styleObj, startObj;
  107|       |
  108|       |  // convert page index to page number
  109|    790|  firstPage = firstPageA + 1;
  110|       |
  111|       |  // lastPage will be filled in later
  112|    790|  lastPage = -1;
  113|       |
  114|    790|  if (dict->lookup("P", &prefixObj)->isString()) {
  ------------------
  |  Branch (114:7): [True: 347, False: 443]
  ------------------
  115|    347|    prefix = new TextString(prefixObj.getString());
  116|    443|  } else {
  117|    443|    prefix = new TextString();
  118|    443|  }
  119|    790|  prefixObj.free();
  120|       |
  121|    790|  style = '\0';
  122|    790|  if (dict->lookup("S", &styleObj)->isName()) {
  ------------------
  |  Branch (122:7): [True: 109, False: 681]
  ------------------
  123|    109|    if (strlen(styleObj.getName()) == 1) {
  ------------------
  |  Branch (123:9): [True: 82, False: 27]
  ------------------
  124|     82|      style = styleObj.getName()[0];
  125|     82|    }
  126|    109|  }
  127|    790|  styleObj.free();
  128|       |
  129|    790|  start = 1;
  130|    790|  if (dict->lookup("St", &startObj)->isInt()) {
  ------------------
  |  Branch (130:7): [True: 47, False: 743]
  ------------------
  131|     47|    start = startObj.getInt();
  132|     47|  }
  133|    790|  startObj.free();
  134|    790|}
_ZN13PageLabelNodeD2Ev:
  136|    790|PageLabelNode::~PageLabelNode() {
  137|    790|  delete prefix;
  138|    790|}
_ZN7CatalogC2EP6PDFDoc:
  144|  2.93k|Catalog::Catalog(PDFDoc *docA) {
  145|  2.93k|  Object catDict;
  146|  2.93k|  Object obj, obj2;
  147|       |
  148|  2.93k|  ok = gTrue;
  ------------------
  |  |   17|  2.93k|#define gTrue 1
  ------------------
  149|  2.93k|  doc = docA;
  150|  2.93k|  xref = doc->getXRef();
  151|  2.93k|  pageTree = NULL;
  152|  2.93k|  pages = NULL;
  153|  2.93k|  pageRefs = NULL;
  154|  2.93k|  numPages = 0;
  155|  2.93k|  baseURI = NULL;
  156|  2.93k|  form = NULL;
  157|  2.93k|  embeddedFiles = NULL;
  158|  2.93k|  pageLabels = NULL;
  159|  2.93k|#if MULTITHREADED
  160|  2.93k|  gInitMutex(&pageMutex);
  ------------------
  |  |   51|  2.93k|#define gInitMutex(m) pthread_mutex_init(m, NULL)
  ------------------
  161|  2.93k|#endif
  162|       |
  163|  2.93k|  xref->getCatalog(&catDict);
  164|  2.93k|  if (!catDict.isDict()) {
  ------------------
  |  Branch (164:7): [True: 168, False: 2.76k]
  ------------------
  165|    168|    error(errSyntaxError, -1, "Catalog object is wrong type ({0:s})",
  166|    168|	  catDict.getTypeName());
  167|    168|    goto err1;
  168|    168|  }
  169|       |
  170|       |  // read page tree
  171|  2.76k|  if (!readPageTree(&catDict)) {
  ------------------
  |  Branch (171:7): [True: 194, False: 2.56k]
  ------------------
  172|    194|    goto err1;
  173|    194|  }
  174|       |
  175|       |  // read named destination dictionary
  176|  2.56k|  catDict.dictLookup("Dests", &dests);
  177|       |
  178|       |  // read root of named destination tree
  179|  2.56k|  if (catDict.dictLookup("Names", &obj)->isDict())
  ------------------
  |  Branch (179:7): [True: 192, False: 2.37k]
  ------------------
  180|    192|    obj.dictLookup("Dests", &nameTree);
  181|  2.37k|  else
  182|  2.37k|    nameTree.initNull();
  183|  2.56k|  obj.free();
  184|       |
  185|       |  // read base URI
  186|  2.56k|  if (catDict.dictLookup("URI", &obj)->isDict()) {
  ------------------
  |  Branch (186:7): [True: 0, False: 2.56k]
  ------------------
  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.56k|  obj.free();
  193|  2.56k|  if (!baseURI || baseURI->getLength() == 0) {
  ------------------
  |  Branch (193:7): [True: 2.56k, False: 0]
  |  Branch (193:19): [True: 0, False: 0]
  ------------------
  194|  2.56k|    if (baseURI) {
  ------------------
  |  Branch (194:9): [True: 0, False: 2.56k]
  ------------------
  195|      0|      delete baseURI;
  196|      0|    }
  197|  2.56k|    if (doc->getFileName()) {
  ------------------
  |  Branch (197:9): [True: 0, False: 2.56k]
  ------------------
  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.56k|    } else {
  205|  2.56k|      baseURI = new GString("file://localhost/");
  206|  2.56k|    }
  207|  2.56k|  }
  208|       |
  209|       |  // get the metadata stream
  210|  2.56k|  catDict.dictLookup("Metadata", &metadata);
  211|       |
  212|       |  // get the structure tree root
  213|  2.56k|  catDict.dictLookup("StructTreeRoot", &structTreeRoot);
  214|       |
  215|       |  // get the outline dictionary
  216|  2.56k|  catDict.dictLookup("Outlines", &outline);
  217|       |
  218|       |  // get the AcroForm dictionary
  219|  2.56k|  catDict.dictLookup("AcroForm", &acroForm);
  220|       |
  221|       |  // get the NeedsRendering flag
  222|       |  // NB: AcroForm::load() uses this value
  223|  2.56k|  needsRendering = catDict.dictLookup("NeedsRendering", &obj)->isBool() &&
  ------------------
  |  Branch (223:20): [True: 10, False: 2.55k]
  ------------------
  224|     10|                   obj.getBool();
  ------------------
  |  Branch (224:20): [True: 10, False: 0]
  ------------------
  225|  2.56k|  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.56k|  form = AcroForm::load(doc, this, &acroForm);
  231|       |
  232|       |  // get the OCProperties dictionary
  233|  2.56k|  catDict.dictLookup("OCProperties", &ocProperties);
  234|       |
  235|       |  // get the list of embedded files
  236|  2.56k|  readEmbeddedFileList(catDict.getDict());
  237|       |
  238|       |  // get the ViewerPreferences object
  239|  2.56k|  catDict.dictLookupNF("ViewerPreferences", &viewerPrefs);
  240|       |
  241|  2.56k|  if (catDict.dictLookup("PageLabels", &obj)->isDict()) {
  ------------------
  |  Branch (241:7): [True: 177, False: 2.39k]
  ------------------
  242|    177|    readPageLabelTree(&obj);
  243|    177|  }
  244|  2.56k|  obj.free();
  245|       |
  246|  2.56k|  catDict.free();
  247|  2.56k|  return;
  248|       |
  249|    362| err1:
  250|    362|  catDict.free();
  251|    362|  dests.initNull();
  252|    362|  nameTree.initNull();
  253|    362|  ok = gFalse;
  ------------------
  |  |   18|    362|#define gFalse 0
  ------------------
  254|    362|}
_ZN7CatalogD2Ev:
  256|  2.92k|Catalog::~Catalog() {
  257|  2.92k|  int i;
  258|       |
  259|  2.92k|  if (pageTree) {
  ------------------
  |  Branch (259:7): [True: 2.56k, False: 362]
  ------------------
  260|  2.56k|    delete pageTree;
  261|  2.56k|  }
  262|  2.92k|  if (pages) {
  ------------------
  |  Branch (262:7): [True: 2.55k, False: 375]
  ------------------
  263|   156k|    for (i = 0; i < numPages; ++i) {
  ------------------
  |  Branch (263:17): [True: 154k, False: 2.55k]
  ------------------
  264|   154k|      if (pages[i]) {
  ------------------
  |  Branch (264:11): [True: 154k, False: 0]
  ------------------
  265|   154k|	delete pages[i];
  266|   154k|      }
  267|   154k|    }
  268|  2.55k|    gfree(pages);
  269|  2.55k|    gfree(pageRefs);
  270|  2.55k|  }
  271|  2.92k|#if MULTITHREADED
  272|  2.92k|  gDestroyMutex(&pageMutex);
  ------------------
  |  |   52|  2.92k|#define gDestroyMutex(m) pthread_mutex_destroy(m)
  ------------------
  273|  2.92k|#endif
  274|  2.92k|  dests.free();
  275|  2.92k|  nameTree.free();
  276|  2.92k|  if (baseURI) {
  ------------------
  |  Branch (276:7): [True: 2.56k, False: 362]
  ------------------
  277|  2.56k|    delete baseURI;
  278|  2.56k|  }
  279|  2.92k|  metadata.free();
  280|  2.92k|  structTreeRoot.free();
  281|  2.92k|  outline.free();
  282|  2.92k|  acroForm.free();
  283|  2.92k|  if (form) {
  ------------------
  |  Branch (283:7): [True: 1.32k, False: 1.60k]
  ------------------
  284|  1.32k|    delete form;
  285|  1.32k|  }
  286|  2.92k|  ocProperties.free();
  287|  2.92k|  if (embeddedFiles) {
  ------------------
  |  Branch (287:7): [True: 10, False: 2.91k]
  ------------------
  288|     10|    deleteGList(embeddedFiles, EmbeddedFile);
  ------------------
  |  |   94|     10|  do {                                              \
  |  |   95|     10|    GList *_list = (list);                          \
  |  |   96|     10|    {                                               \
  |  |   97|     10|      int _i;                                       \
  |  |   98|    125|      for (_i = 0; _i < _list->getLength(); ++_i) { \
  |  |  ------------------
  |  |  |  Branch (98:20): [True: 115, False: 10]
  |  |  ------------------
  |  |   99|    115|        delete (T*)_list->get(_i);                  \
  |  |  100|    115|      }                                             \
  |  |  101|     10|      delete _list;                                 \
  |  |  102|     10|    }                                               \
  |  |  103|     10|  } while (0)
  |  |  ------------------
  |  |  |  Branch (103:12): [Folded, False: 10]
  |  |  ------------------
  ------------------
  289|     10|  }
  290|  2.92k|  if (pageLabels) {
  ------------------
  |  Branch (290:7): [True: 88, False: 2.84k]
  ------------------
  291|     88|    deleteGList(pageLabels, PageLabelNode);
  ------------------
  |  |   94|     88|  do {                                              \
  |  |   95|     88|    GList *_list = (list);                          \
  |  |   96|     88|    {                                               \
  |  |   97|     88|      int _i;                                       \
  |  |   98|    878|      for (_i = 0; _i < _list->getLength(); ++_i) { \
  |  |  ------------------
  |  |  |  Branch (98:20): [True: 790, False: 88]
  |  |  ------------------
  |  |   99|    790|        delete (T*)_list->get(_i);                  \
  |  |  100|    790|      }                                             \
  |  |  101|     88|      delete _list;                                 \
  |  |  102|     88|    }                                               \
  |  |  103|     88|  } while (0)
  |  |  ------------------
  |  |  |  Branch (103:12): [Folded, False: 88]
  |  |  ------------------
  ------------------
  292|     88|  }
  293|  2.92k|  viewerPrefs.free();
  294|  2.92k|}
_ZN7Catalog7getPageEi:
  296|   308k|Page *Catalog::getPage(int i) {
  297|   308k|  Page *page;
  298|       |
  299|   308k|#if MULTITHREADED
  300|   308k|  gLockMutex(&pageMutex);
  ------------------
  |  |   53|   308k|#define gLockMutex(m) pthread_mutex_lock(m)
  ------------------
  301|   308k|#endif
  302|   308k|  if (!pages[i-1]) {
  ------------------
  |  Branch (302:7): [True: 154k, False: 154k]
  ------------------
  303|   154k|    loadPage(i);
  304|   154k|  }
  305|   308k|  page = pages[i-1];
  306|   308k|#if MULTITHREADED
  307|   308k|  gUnlockMutex(&pageMutex);
  ------------------
  |  |   54|   308k|#define gUnlockMutex(m) pthread_mutex_unlock(m)
  ------------------
  308|   308k|#endif
  309|   308k|  return page;
  310|   308k|}
_ZN7Catalog12readPageTreeEP6Object:
  525|  2.76k|GBool Catalog::readPageTree(Object *catDict) {
  526|  2.76k|  Object topPagesRef, topPagesObj, countObj;
  527|  2.76k|  int i;
  528|       |
  529|  2.76k|  if (!catDict->dictLookupNF("Pages", &topPagesRef)->isRef()) {
  ------------------
  |  Branch (529:7): [True: 107, False: 2.65k]
  ------------------
  530|    107|    error(errSyntaxError, -1, "Top-level pages reference is wrong type ({0:s})",
  531|    107|	  topPagesRef.getTypeName());
  532|    107|    topPagesRef.free();
  533|    107|    return gFalse;
  ------------------
  |  |   18|    107|#define gFalse 0
  ------------------
  534|    107|  }
  535|  2.65k|  if (!topPagesRef.fetch(xref, &topPagesObj)->isDict()) {
  ------------------
  |  Branch (535:7): [True: 85, False: 2.57k]
  ------------------
  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.57k|  if (topPagesObj.dictLookup("Count", &countObj)->isInt()) {
  ------------------
  |  Branch (542:7): [True: 900, False: 1.67k]
  ------------------
  543|    900|    numPages = countObj.getInt();
  544|    900|    if (numPages == 0 || numPages > 50000) {
  ------------------
  |  Branch (544:9): [True: 172, False: 728]
  |  Branch (544:26): [True: 3, False: 725]
  ------------------
  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|    175|      char *touchedObjs = (char *)gmalloc(xref->getNumObjects());
  552|    175|      memset(touchedObjs, 0, xref->getNumObjects());
  553|    175|      numPages = countPageTree(&topPagesRef, touchedObjs);
  554|    175|      gfree(touchedObjs);
  555|    175|    }
  556|  1.67k|  } else {
  557|       |    // assume we got a Page node instead of a Pages node
  558|  1.67k|    numPages = 1;
  559|  1.67k|  }
  560|  2.57k|  countObj.free();
  561|  2.57k|  if (numPages < 0) {
  ------------------
  |  Branch (561:7): [True: 2, False: 2.56k]
  ------------------
  562|      2|    error(errSyntaxError, -1, "Invalid page count");
  563|      2|    topPagesObj.free();
  564|      2|    topPagesRef.free();
  565|      2|    numPages = 0;
  566|      2|    return gFalse;
  ------------------
  |  |   18|      2|#define gFalse 0
  ------------------
  567|      2|  }
  568|  2.56k|  pageTree = new PageTreeNode(topPagesRef.getRef(), numPages, NULL);
  569|  2.56k|  topPagesObj.free();
  570|  2.56k|  topPagesRef.free();
  571|  2.56k|  pages = (Page **)greallocn(pages, numPages, sizeof(Page *));
  572|  2.56k|  pageRefs = (Ref *)greallocn(pageRefs, numPages, sizeof(Ref));
  573|   156k|  for (i = 0; i < numPages; ++i) {
  ------------------
  |  Branch (573:15): [True: 154k, False: 2.56k]
  ------------------
  574|   154k|    pages[i] = NULL;
  575|   154k|    pageRefs[i].num = -1;
  576|   154k|    pageRefs[i].gen = -1;
  577|   154k|  }
  578|  2.56k|  return gTrue;
  ------------------
  |  |   17|  2.56k|#define gTrue 1
  ------------------
  579|  2.57k|}
_ZN7Catalog13countPageTreeEP6ObjectPc:
  581|   113k|int Catalog::countPageTree(Object *pagesNodeRef, char *touchedObjs) {
  582|       |  // check for invalid reference
  583|   113k|  if (pagesNodeRef->isRef() &&
  ------------------
  |  Branch (583:7): [True: 17.8k, False: 96.1k]
  ------------------
  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: 1.35k, False: 16.4k]
  ------------------
  586|  1.35k|    return 0;
  587|  1.35k|  }
  588|       |
  589|       |  // check for a page tree loop; fetch the node object
  590|   112k|  Object pagesNode;
  591|   112k|  if (pagesNodeRef->isRef()) {
  ------------------
  |  Branch (591:7): [True: 16.4k, False: 96.1k]
  ------------------
  592|  16.4k|    if (touchedObjs[pagesNodeRef->getRefNum()]) {
  ------------------
  |  Branch (592:9): [True: 11.5k, False: 4.89k]
  ------------------
  593|  11.5k|      error(errSyntaxError, -1, "Loop in Pages tree");
  594|  11.5k|      return 0;
  595|  11.5k|    }
  596|  4.89k|    touchedObjs[pagesNodeRef->getRefNum()] = 1;
  597|  4.89k|    xref->fetch(pagesNodeRef->getRefNum(), pagesNodeRef->getRefGen(),
  598|  4.89k|		&pagesNode);
  599|  96.1k|  } else {
  600|  96.1k|    pagesNodeRef->copy(&pagesNode);
  601|  96.1k|  }
  602|       |
  603|       |  // count the subtree
  604|   101k|  int n = 0;
  605|   101k|  if (pagesNode.isDict()) {
  ------------------
  |  Branch (605:7): [True: 7.21k, False: 93.8k]
  ------------------
  606|  7.21k|    Object kidsRef, kids;
  607|  7.21k|    pagesNode.dictLookupNF("Kids", &kidsRef);
  608|  7.21k|    if (kidsRef.isRef() &&
  ------------------
  |  Branch (608:9): [True: 111, False: 7.10k]
  ------------------
  609|    111|	kidsRef.getRefNum() >= 0 &&
  ------------------
  |  Branch (609:2): [True: 111, False: 0]
  ------------------
  610|    111|	kidsRef.getRefNum() < xref->getNumObjects()) {
  ------------------
  |  Branch (610:2): [True: 99, False: 12]
  ------------------
  611|     99|      if (touchedObjs[kidsRef.getRefNum()]) {
  ------------------
  |  Branch (611:11): [True: 84, False: 15]
  ------------------
  612|     84|	error(errSyntaxError, -1, "Loop in Pages tree");
  613|     84|	kidsRef.free();
  614|     84|	pagesNode.free();
  615|     84|	return 0;
  616|     84|      }
  617|     15|      touchedObjs[kidsRef.getRefNum()] = 1;
  618|     15|      xref->fetch(kidsRef.getRefNum(), kidsRef.getRefGen(), &kids);
  619|  7.11k|    } else {
  620|  7.11k|      kidsRef.copy(&kids);
  621|  7.11k|    }
  622|  7.13k|    kidsRef.free();
  623|  7.13k|    if (kids.isArray()) {
  ------------------
  |  Branch (623:9): [True: 1.21k, False: 5.91k]
  ------------------
  624|   114k|      for (int i = 0; i < kids.arrayGetLength(); ++i) {
  ------------------
  |  Branch (624:23): [True: 113k, False: 1.21k]
  ------------------
  625|   113k|	Object kid;
  626|   113k|	kids.arrayGetNF(i, &kid);
  627|   113k|	int n2 = countPageTree(&kid, touchedObjs);
  628|   113k|	if (n2 < INT_MAX - n) {
  ------------------
  |  Branch (628:6): [True: 113k, False: 0]
  ------------------
  629|   113k|	  n += n2;
  630|   113k|	} else {
  631|      0|	  error(errSyntaxError, -1, "Page tree contains too many pages");
  632|      0|	  n = INT_MAX;
  633|      0|	}
  634|   113k|	kid.free();
  635|   113k|      }
  636|  5.91k|    } else {
  637|  5.91k|      n = 1;
  638|  5.91k|    }
  639|  7.13k|    kids.free();
  640|  7.13k|  }
  641|       |
  642|   100k|  pagesNode.free();
  643|       |
  644|   100k|  return n;
  645|   101k|}
_ZN7Catalog8loadPageEi:
  647|   154k|void Catalog::loadPage(int pg) {
  648|   154k|  loadPage2(pg, pg - 1, pageTree);
  649|   154k|}
_ZN7Catalog9loadPage2EiiP12PageTreeNode:
  651|   180k|void Catalog::loadPage2(int pg, int relPg, PageTreeNode *node) {
  652|   180k|  Object pageRefObj, pageObj, kidsObj, kidRefObj, kidObj, countObj;
  653|   180k|  PageTreeNode *kidNode, *p;
  654|   180k|  PageAttrs *attrs;
  655|   180k|  int count, i;
  656|       |
  657|   180k|  if (relPg >= node->count) {
  ------------------
  |  Branch (657:7): [True: 0, False: 180k]
  ------------------
  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|   180k|  if (!node->kids) {
  ------------------
  |  Branch (665:7): [True: 144k, False: 36.2k]
  ------------------
  666|       |
  667|       |    // check for a loop in the page tree
  668|   166k|    for (p = node->parent; p; p = p->parent) {
  ------------------
  |  Branch (668:28): [True: 24.8k, False: 142k]
  ------------------
  669|  24.8k|      if (node->ref.num == p->ref.num && node->ref.gen == p->ref.gen) {
  ------------------
  |  Branch (669:11): [True: 2.15k, False: 22.6k]
  |  Branch (669:42): [True: 2.12k, False: 25]
  ------------------
  670|  2.12k|	error(errSyntaxError, -1, "Loop in Pages tree");
  671|  2.12k|	pages[pg-1] = new Page(doc, pg);
  672|  2.12k|	return;
  673|  2.12k|      }
  674|  24.8k|    }
  675|       |
  676|       |    // fetch the Page/Pages object
  677|   142k|    pageRefObj.initRef(node->ref.num, node->ref.gen);
  678|   142k|    if (!pageRefObj.fetch(xref, &pageObj)->isDict()) {
  ------------------
  |  Branch (678:9): [True: 0, False: 142k]
  ------------------
  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|   142k|    attrs = new PageAttrs(node->parent ? node->parent->attrs
  ------------------
  |  Branch (688:27): [True: 22.2k, False: 119k]
  ------------------
  689|   142k|			               : (PageAttrs *)NULL,
  690|   142k|			  pageObj.getDict(), xref);
  691|       |
  692|       |    // if "Kids" exists, it's an internal node
  693|   142k|    if (pageObj.dictLookup("Kids", &kidsObj)->isArray()) {
  ------------------
  |  Branch (693:9): [True: 2.13k, False: 140k]
  ------------------
  694|       |
  695|       |      // save the PageAttrs
  696|  2.13k|      node->attrs = attrs;
  697|       |
  698|       |      // read the kids
  699|  2.13k|      node->kids = new GList();
  700|   666k|      for (i = 0; i < kidsObj.arrayGetLength(); ++i) {
  ------------------
  |  Branch (700:19): [True: 664k, False: 2.13k]
  ------------------
  701|   664k|	if (kidsObj.arrayGetNF(i, &kidRefObj)->isRef()) {
  ------------------
  |  Branch (701:6): [True: 154k, False: 509k]
  ------------------
  702|   154k|	  if (kidRefObj.fetch(xref, &kidObj)->isDict()) {
  ------------------
  |  Branch (702:8): [True: 32.1k, False: 122k]
  ------------------
  703|  32.1k|	    if (kidObj.dictLookup("Count", &countObj)->isInt()) {
  ------------------
  |  Branch (703:10): [True: 716, False: 31.4k]
  ------------------
  704|    716|	      count = countObj.getInt();
  705|  31.4k|	    } else {
  706|  31.4k|	      count = 1;
  707|  31.4k|	    }
  708|  32.1k|	    countObj.free();
  709|  32.1k|	    node->kids->append(new PageTreeNode(kidRefObj.getRef(), count,
  710|  32.1k|						node));
  711|   122k|	  } else {
  712|   122k|	    error(errSyntaxError, -1, "Page tree object is wrong type ({0:s})",
  713|   122k|		  kidObj.getTypeName());
  714|   122k|	  }
  715|   154k|	  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|   664k|	kidRefObj.free();
  722|   664k|      }
  723|       |
  724|   140k|    } else {
  725|       |      
  726|       |      // create the Page object
  727|   140k|      pageRefs[pg-1] = node->ref;
  728|   140k|      pages[pg-1] = new Page(doc, pg, pageObj.getDict(), attrs);
  729|   140k|      if (!pages[pg-1]->isOk()) {
  ------------------
  |  Branch (729:11): [True: 527, False: 139k]
  ------------------
  730|    527|	delete pages[pg-1];
  731|    527|	pages[pg-1] = new Page(doc, pg);
  732|    527|      }
  733|       |
  734|   140k|    }
  735|       |
  736|   142k|    kidsObj.free();
  737|   142k|    pageObj.free();
  738|   142k|    pageRefObj.free();
  739|   142k|  }
  740|       |
  741|       |  // recursively descend the tree
  742|   178k|  if (node->kids) {
  ------------------
  |  Branch (742:7): [True: 38.4k, False: 140k]
  ------------------
  743|   712k|    for (i = 0; i < node->kids->getLength(); ++i) {
  ------------------
  |  Branch (743:17): [True: 700k, False: 12.0k]
  ------------------
  744|   700k|      kidNode = (PageTreeNode *)node->kids->get(i);
  745|   700k|      if (relPg < kidNode->count) {
  ------------------
  |  Branch (745:11): [True: 26.3k, False: 674k]
  ------------------
  746|  26.3k|	loadPage2(pg, relPg, kidNode);
  747|  26.3k|	break;
  748|  26.3k|      }
  749|   674k|      relPg -= kidNode->count;
  750|   674k|    }
  751|       |
  752|       |    // this will only happen if the page tree is invalid
  753|       |    // (i.e., parent count > sum of children counts)
  754|  38.4k|    if (i == node->kids->getLength()) {
  ------------------
  |  Branch (754:9): [True: 12.0k, False: 26.3k]
  ------------------
  755|  12.0k|      error(errSyntaxError, -1, "Invalid page count in page tree");
  756|  12.0k|      pages[pg-1] = new Page(doc, pg);
  757|  12.0k|    }
  758|  38.4k|  }
  759|   178k|}
_ZN7Catalog20readEmbeddedFileListEP4Dict:
  801|  2.56k|void Catalog::readEmbeddedFileList(Dict *catDict) {
  802|  2.56k|  Object obj1, obj2;
  803|  2.56k|  char *touchedObjs;
  804|       |
  805|  2.56k|  touchedObjs = (char *)gmalloc(xref->getNumObjects());
  806|  2.56k|  memset(touchedObjs, 0, xref->getNumObjects());
  807|       |
  808|       |  // read the embedded file name tree
  809|  2.56k|  if (catDict->lookup("Names", &obj1)->isDict()) {
  ------------------
  |  Branch (809:7): [True: 192, False: 2.37k]
  ------------------
  810|    192|    obj1.dictLookupNF("EmbeddedFiles", &obj2);
  811|    192|    readEmbeddedFileTree(&obj2, touchedObjs);
  812|    192|    obj2.free();
  813|    192|  }
  814|  2.56k|  obj1.free();
  815|       |
  816|       |  // look for file attachment annotations
  817|  2.56k|  readFileAttachmentAnnots(catDict->lookupNF("Pages", &obj1), touchedObjs);
  818|  2.56k|  obj1.free();
  819|       |
  820|  2.56k|  gfree(touchedObjs);
  821|  2.56k|}
_ZN7Catalog20readEmbeddedFileTreeEP6ObjectPc:
  823|  42.2k|void Catalog::readEmbeddedFileTree(Object *nodeRef, char *touchedObjs) {
  824|  42.2k|  Object node, kidsObj, kidObj;
  825|  42.2k|  Object namesObj, nameObj, fileSpecObj;
  826|  42.2k|  int i;
  827|       |
  828|       |  // check for an object loop
  829|  42.2k|  if (nodeRef->isRef()) {
  ------------------
  |  Branch (829:7): [True: 7.86k, False: 34.4k]
  ------------------
  830|  7.86k|    if (nodeRef->getRefNum() < 0 ||
  ------------------
  |  Branch (830:9): [True: 0, False: 7.86k]
  ------------------
  831|  7.86k|	nodeRef->getRefNum() >= xref->getNumObjects() ||
  ------------------
  |  Branch (831:2): [True: 4.05k, False: 3.81k]
  ------------------
  832|  7.28k|	touchedObjs[nodeRef->getRefNum()]) {
  ------------------
  |  Branch (832:2): [True: 3.23k, False: 581]
  ------------------
  833|  7.28k|      return;
  834|  7.28k|    }
  835|    581|    touchedObjs[nodeRef->getRefNum()] = 1;
  836|    581|    xref->fetch(nodeRef->getRefNum(), nodeRef->getRefGen(), &node);
  837|  34.4k|  } else {
  838|  34.4k|    nodeRef->copy(&node);
  839|  34.4k|  }
  840|       |
  841|  35.0k|  if (!node.isDict()) {
  ------------------
  |  Branch (841:7): [True: 32.8k, False: 2.16k]
  ------------------
  842|  32.8k|    node.free();
  843|  32.8k|    return;
  844|  32.8k|  }
  845|       |
  846|  2.16k|  if (checkDictLookup(&node, "Kids", &kidsObj, touchedObjs)->isArray()) {
  ------------------
  |  Branch (846:7): [True: 1.01k, False: 1.15k]
  ------------------
  847|  43.1k|    for (i = 0; i < kidsObj.arrayGetLength(); ++i) {
  ------------------
  |  Branch (847:17): [True: 42.1k, False: 1.01k]
  ------------------
  848|  42.1k|      kidsObj.arrayGetNF(i, &kidObj);
  849|  42.1k|      readEmbeddedFileTree(&kidObj, touchedObjs);
  850|  42.1k|      kidObj.free();
  851|  42.1k|    }
  852|  1.15k|  } else {
  853|  1.15k|    if (checkDictLookup(&node, "Names", &namesObj, touchedObjs)->isArray()) {
  ------------------
  |  Branch (853:9): [True: 125, False: 1.02k]
  ------------------
  854|  8.61k|      for (i = 0; i+1 < namesObj.arrayGetLength(); ++i) {
  ------------------
  |  Branch (854:19): [True: 8.48k, False: 125]
  ------------------
  855|  8.48k|	namesObj.arrayGet(i, &nameObj);
  856|  8.48k|	namesObj.arrayGet(i+1, &fileSpecObj);
  857|  8.48k|	readEmbeddedFile(&fileSpecObj, &nameObj);
  858|  8.48k|	nameObj.free();
  859|  8.48k|	fileSpecObj.free();
  860|  8.48k|      }
  861|    125|    }
  862|  1.15k|    namesObj.free();
  863|  1.15k|  }
  864|  2.16k|  kidsObj.free();
  865|       |
  866|  2.16k|  node.free();
  867|  2.16k|}
_ZN7Catalog24readFileAttachmentAnnotsEP6ObjectPc:
  870|   171k|				       char *touchedObjs) {
  871|   171k|  Object pageNode, kids, kid, annots, annot, subtype, fileSpec, contents;
  872|   171k|  int i;
  873|       |
  874|       |  // check for an invalid object reference (e.g., in a damaged PDF file)
  875|   171k|  if (pageNodeRef->isRef() &&
  ------------------
  |  Branch (875:7): [True: 24.5k, False: 146k]
  ------------------
  876|  24.5k|      (pageNodeRef->getRefNum() < 0 ||
  ------------------
  |  Branch (876:8): [True: 0, False: 24.5k]
  ------------------
  877|  24.5k|       pageNodeRef->getRefNum() >= xref->getNumObjects())) {
  ------------------
  |  Branch (877:8): [True: 1.85k, False: 22.7k]
  ------------------
  878|  1.85k|    return;
  879|  1.85k|  }
  880|       |
  881|       |  // check for a page tree loop
  882|   169k|  if (pageNodeRef->isRef()) {
  ------------------
  |  Branch (882:7): [True: 22.7k, False: 146k]
  ------------------
  883|  22.7k|    if (touchedObjs[pageNodeRef->getRefNum()]) {
  ------------------
  |  Branch (883:9): [True: 14.2k, False: 8.46k]
  ------------------
  884|  14.2k|      return;
  885|  14.2k|    }
  886|  8.46k|    touchedObjs[pageNodeRef->getRefNum()] = 1;
  887|  8.46k|    xref->fetch(pageNodeRef->getRefNum(), pageNodeRef->getRefGen(), &pageNode);
  888|   146k|  } else {
  889|   146k|    pageNodeRef->copy(&pageNode);
  890|   146k|  }
  891|       |
  892|   155k|  if (pageNode.isDict()) {
  ------------------
  |  Branch (892:7): [True: 12.6k, False: 142k]
  ------------------
  893|  12.6k|    if (checkDictLookup(&pageNode, "Kids", &kids, touchedObjs)->isArray()) {
  ------------------
  |  Branch (893:9): [True: 3.00k, False: 9.63k]
  ------------------
  894|   171k|      for (i = 0; i < kids.arrayGetLength(); ++i) {
  ------------------
  |  Branch (894:19): [True: 168k, False: 3.00k]
  ------------------
  895|   168k|	readFileAttachmentAnnots(kids.arrayGetNF(i, &kid), touchedObjs);
  896|   168k|	kid.free();
  897|   168k|      }
  898|  9.63k|    } else {
  899|  9.63k|      if (checkDictLookup(&pageNode, "Annots",
  ------------------
  |  Branch (899:11): [True: 257, False: 9.37k]
  ------------------
  900|  9.63k|			  &annots, touchedObjs)->isArray()) {
  901|  15.9k|	for (i = 0; i < annots.arrayGetLength(); ++i) {
  ------------------
  |  Branch (901:14): [True: 15.6k, False: 257]
  ------------------
  902|  15.6k|	  if (checkArrayGet(&annots, i, &annot, touchedObjs)->isDict()) {
  ------------------
  |  Branch (902:8): [True: 1.48k, False: 14.2k]
  ------------------
  903|  1.48k|	    if (checkDictLookup(&annot, "Subtype", &subtype, touchedObjs)
  ------------------
  |  Branch (903:10): [True: 0, False: 1.48k]
  ------------------
  904|  1.48k|		  ->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.48k|	    subtype.free();
  914|  1.48k|	  }
  915|  15.6k|	  annot.free();
  916|  15.6k|	}
  917|    257|      }
  918|  9.63k|      annots.free();
  919|  9.63k|    }
  920|  12.6k|    kids.free();
  921|  12.6k|  }
  922|       |
  923|   155k|  pageNode.free();
  924|   155k|}
_ZN7Catalog16readEmbeddedFileEP6ObjectS1_:
  926|  8.48k|void Catalog::readEmbeddedFile(Object *fileSpec, Object *name1) {
  927|  8.48k|  Object name2, efObj, streamObj;
  928|  8.48k|  GString *s;
  929|  8.48k|  TextString *name;
  930|       |
  931|  8.48k|  if (fileSpec->isDict()) {
  ------------------
  |  Branch (931:7): [True: 417, False: 8.06k]
  ------------------
  932|    417|    if (fileSpec->dictLookup("UF", &name2)->isString()) {
  ------------------
  |  Branch (932:9): [True: 10, False: 407]
  ------------------
  933|     10|      name = new TextString(name2.getString());
  934|    407|    } else {
  935|    407|      name2.free();
  936|    407|      if (fileSpec->dictLookup("F", &name2)->isString()) {
  ------------------
  |  Branch (936:11): [True: 86, False: 321]
  ------------------
  937|     86|	name = new TextString(name2.getString());
  938|    321|      } else if (name1 && name1->isString()) {
  ------------------
  |  Branch (938:18): [True: 321, False: 0]
  |  Branch (938:27): [True: 18, False: 303]
  ------------------
  939|     18|	name = new TextString(name1->getString());
  940|    303|      } else {
  941|    303|	s = new GString("?");
  942|    303|	name = new TextString(s);
  943|    303|	delete s;
  944|    303|      }
  945|    407|    }
  946|    417|    name2.free();
  947|    417|    if (fileSpec->dictLookup("EF", &efObj)->isDict()) {
  ------------------
  |  Branch (947:9): [True: 201, False: 216]
  ------------------
  948|    201|      if (efObj.dictLookupNF("F", &streamObj)->isRef()) {
  ------------------
  |  Branch (948:11): [True: 115, False: 86]
  ------------------
  949|    115|	if (!embeddedFiles) {
  ------------------
  |  Branch (949:6): [True: 10, False: 105]
  ------------------
  950|     10|	  embeddedFiles = new GList();
  951|     10|	}
  952|    115|	embeddedFiles->append(new EmbeddedFile(name, &streamObj));
  953|    115|      } else {
  954|     86|	delete name;
  955|     86|      }
  956|    201|      streamObj.free();
  957|    216|    } else {
  958|    216|      delete name;
  959|    216|    }
  960|    417|    efObj.free();
  961|    417|  }
  962|  8.48k|}
_ZN7Catalog17readPageLabelTreeEP6Object:
  989|    177|void Catalog::readPageLabelTree(Object *root) {
  990|    177|  PageLabelNode *label0, *label1;
  991|    177|  char *touchedObjs;
  992|    177|  int i;
  993|       |
  994|    177|  touchedObjs = (char *)gmalloc(xref->getNumObjects());
  995|    177|  memset(touchedObjs, 0, xref->getNumObjects());
  996|    177|  pageLabels = new GList();
  997|    177|  readPageLabelTree2(root, touchedObjs);
  998|    177|  gfree(touchedObjs);
  999|       |
 1000|    177|  if (pageLabels->getLength() == 0) {
  ------------------
  |  Branch (1000:7): [True: 89, False: 88]
  ------------------
 1001|     89|    deleteGList(pageLabels, PageLabelNode);
  ------------------
  |  |   94|     89|  do {                                              \
  |  |   95|     89|    GList *_list = (list);                          \
  |  |   96|     89|    {                                               \
  |  |   97|     89|      int _i;                                       \
  |  |   98|     89|      for (_i = 0; _i < _list->getLength(); ++_i) { \
  |  |  ------------------
  |  |  |  Branch (98:20): [True: 0, False: 89]
  |  |  ------------------
  |  |   99|      0|        delete (T*)_list->get(_i);                  \
  |  |  100|      0|      }                                             \
  |  |  101|     89|      delete _list;                                 \
  |  |  102|     89|    }                                               \
  |  |  103|     89|  } while (0)
  |  |  ------------------
  |  |  |  Branch (103:12): [Folded, False: 89]
  |  |  ------------------
  ------------------
 1002|     89|    pageLabels = NULL;
 1003|     89|    return;
 1004|     89|  }
 1005|       |
 1006|       |  // set lastPage in each node
 1007|     88|  label0 = (PageLabelNode *)pageLabels->get(0);
 1008|    790|  for (i = 1; i < pageLabels->getLength(); ++i) {
  ------------------
  |  Branch (1008:15): [True: 702, False: 88]
  ------------------
 1009|    702|    label1 = (PageLabelNode *)pageLabels->get(i);
 1010|    702|    label0->lastPage = label1->firstPage - 1;
 1011|    702|    label0 = label1;
 1012|    702|  }
 1013|     88|  label0->lastPage = numPages;
 1014|     88|}
_ZN7Catalog18readPageLabelTree2EP6ObjectPc:
 1016|  35.2k|void Catalog::readPageLabelTree2(Object *nodeRef, char *touchedObjs) {
 1017|  35.2k|  Object node, nums, num, labelObj, kidsRef, kids, kid;
 1018|  35.2k|  int i;
 1019|       |
 1020|       |  // check for an object loop
 1021|  35.2k|  if (nodeRef->isRef()) {
  ------------------
  |  Branch (1021:7): [True: 2.17k, False: 33.0k]
  ------------------
 1022|  2.17k|    if (nodeRef->getRefNum() < 0 ||
  ------------------
  |  Branch (1022:9): [True: 0, False: 2.17k]
  ------------------
 1023|  2.17k|	nodeRef->getRefNum() >= xref->getNumObjects() ||
  ------------------
  |  Branch (1023:2): [True: 469, False: 1.70k]
  ------------------
 1024|  1.99k|	touchedObjs[nodeRef->getRefNum()]) {
  ------------------
  |  Branch (1024:2): [True: 1.52k, False: 182]
  ------------------
 1025|  1.99k|      return;
 1026|  1.99k|    }
 1027|    182|    touchedObjs[nodeRef->getRefNum()] = 1;
 1028|    182|    xref->fetch(nodeRef->getRefNum(), nodeRef->getRefGen(), &node);
 1029|  33.0k|  } else {
 1030|  33.0k|    nodeRef->copy(&node);
 1031|  33.0k|  }
 1032|       |
 1033|  33.2k|  if (!node.isDict()) {
  ------------------
  |  Branch (1033:7): [True: 30.9k, False: 2.29k]
  ------------------
 1034|  30.9k|    node.free();
 1035|  30.9k|    return;
 1036|  30.9k|  }
 1037|       |
 1038|  2.29k|  if (node.dictLookup("Nums", &nums)->isArray()) {
  ------------------
  |  Branch (1038:7): [True: 126, False: 2.17k]
  ------------------
 1039|  3.68k|    for (i = 0; i < nums.arrayGetLength() - 1; i += 2) {
  ------------------
  |  Branch (1039:17): [True: 3.55k, False: 126]
  ------------------
 1040|  3.55k|      if (nums.arrayGet(i, &num)->isInt()) {
  ------------------
  |  Branch (1040:11): [True: 1.73k, False: 1.82k]
  ------------------
 1041|  1.73k|	if (nums.arrayGet(i+1, &labelObj)->isDict()) {
  ------------------
  |  Branch (1041:6): [True: 790, False: 943]
  ------------------
 1042|    790|	  pageLabels->append(new PageLabelNode(num.getInt(),
 1043|    790|					       labelObj.getDict()));
 1044|    790|	}
 1045|  1.73k|	labelObj.free();
 1046|  1.73k|      }
 1047|  3.55k|      num.free();
 1048|  3.55k|    }
 1049|    126|  }
 1050|  2.29k|  nums.free();
 1051|       |
 1052|       |  // check for an object loop in the Kids entry
 1053|  2.29k|  if (node.dictLookupNF("Kids", &kidsRef)->isRef()) {
  ------------------
  |  Branch (1053:7): [True: 190, False: 2.10k]
  ------------------
 1054|    190|    if (kidsRef.getRefNum() < 0 ||
  ------------------
  |  Branch (1054:9): [True: 0, False: 190]
  ------------------
 1055|    190|	kidsRef.getRefNum() >= doc->getXRef()->getNumObjects() ||
  ------------------
  |  Branch (1055:2): [True: 98, False: 92]
  ------------------
 1056|    181|	touchedObjs[kidsRef.getRefNum()]) {
  ------------------
  |  Branch (1056:2): [True: 83, False: 9]
  ------------------
 1057|    181|      kidsRef.free();
 1058|    181|      node.free();
 1059|    181|      return;
 1060|    181|    }
 1061|      9|    touchedObjs[kidsRef.getRefNum()] = 1;
 1062|      9|    kidsRef.fetch(doc->getXRef(), &kids);
 1063|  2.10k|  } else {
 1064|  2.10k|    kidsRef.copy(&kids);
 1065|  2.10k|  }
 1066|  2.11k|  kidsRef.free();
 1067|       |
 1068|  2.11k|  if (kids.isArray()) {
  ------------------
  |  Branch (1068:7): [True: 1.21k, False: 905]
  ------------------
 1069|  36.2k|    for (i = 0; i < kids.arrayGetLength(); ++i) {
  ------------------
  |  Branch (1069:17): [True: 35.0k, False: 1.21k]
  ------------------
 1070|  35.0k|      kids.arrayGetNF(i, &kid);
 1071|  35.0k|      readPageLabelTree2(&kid, touchedObjs);
 1072|  35.0k|      kid.free();
 1073|  35.0k|    }
 1074|  1.21k|  }
 1075|  2.11k|  kids.free();
 1076|       |
 1077|  2.11k|  node.free();
 1078|  2.11k|}
_ZN7Catalog15checkDictLookupEP6ObjectPKcS1_Pc:
 1451|  27.0k|				 Object *element, char *touchedObjs) {
 1452|  27.0k|  Object refObj;
 1453|  27.0k|  dictObj->dictLookupNF(key, &refObj);
 1454|  27.0k|  if (refObj.isRef()) {
  ------------------
  |  Branch (1454:7): [True: 595, False: 26.4k]
  ------------------
 1455|    595|    int num = refObj.getRefNum();
 1456|    595|    if (num >= 0 && num < xref->getNumObjects() && !touchedObjs[num]) {
  ------------------
  |  Branch (1456:9): [True: 595, False: 0]
  |  Branch (1456:21): [True: 460, False: 135]
  |  Branch (1456:52): [True: 213, False: 247]
  ------------------
 1457|    213|      touchedObjs[num] = 1;
 1458|    213|      xref->fetch(num, refObj.getRefGen(), element);
 1459|    382|    } else {
 1460|    382|      element->initNull();
 1461|    382|    }
 1462|    595|    refObj.free();
 1463|  26.4k|  } else {
 1464|  26.4k|    *element = refObj;
 1465|  26.4k|  }
 1466|  27.0k|  return element;
 1467|  27.0k|}
_ZN7Catalog13checkArrayGetEP6ObjectiS1_Pc:
 1470|  15.6k|			       Object *element, char *touchedObjs) {
 1471|  15.6k|  Object refObj;
 1472|  15.6k|  arrayObj->arrayGetNF(i, &refObj);
 1473|  15.6k|  if (refObj.isRef()) {
  ------------------
  |  Branch (1473:7): [True: 7.42k, False: 8.26k]
  ------------------
 1474|  7.42k|    int num = refObj.getRefNum();
 1475|  7.42k|    if (num >= 0 && num < xref->getNumObjects() && !touchedObjs[num]) {
  ------------------
  |  Branch (1475:9): [True: 7.42k, False: 0]
  |  Branch (1475:21): [True: 7.01k, False: 409]
  |  Branch (1475:52): [True: 5.95k, False: 1.05k]
  ------------------
 1476|  5.95k|      touchedObjs[num] = 1;
 1477|  5.95k|      xref->fetch(num, refObj.getRefGen(), element);
 1478|  5.95k|    } else {
 1479|  1.46k|      element->initNull();
 1480|  1.46k|    }
 1481|  7.42k|    refObj.free();
 1482|  8.26k|  } else {
 1483|  8.26k|    *element = refObj;
 1484|  8.26k|  }
 1485|  15.6k|  return element;
 1486|  15.6k|}

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

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

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

_ZN4DictC2EP4XRef:
   31|   576k|Dict::Dict(XRef *xrefA) {
   32|   576k|  xref = xrefA;
   33|   576k|  size = 8;
   34|   576k|  length = 0;
   35|   576k|  entries = (DictEntry *)gmallocn(size, sizeof(DictEntry));
   36|   576k|  hashTab = (DictEntry **)gmallocn(2 * size - 1, sizeof(DictEntry *));
   37|   576k|  memset(hashTab, 0, (2 * size - 1) * sizeof(DictEntry *));
   38|   576k|  ref = 1;
   39|   576k|}
_ZN4DictD2Ev:
   41|   465k|Dict::~Dict() {
   42|   465k|  int i;
   43|       |
   44|  1.98M|  for (i = 0; i < length; ++i) {
  ------------------
  |  Branch (44:15): [True: 1.51M, False: 465k]
  ------------------
   45|  1.51M|    gfree(entries[i].key);
   46|  1.51M|    entries[i].val.free();
   47|  1.51M|  }
   48|   465k|  gfree(entries);
   49|   465k|  gfree(hashTab);
   50|   465k|}
_ZN4Dict3addEPcP6Object:
   52|  2.49M|void Dict::add(char *key, Object *val) {
   53|  2.49M|  DictEntry *e;
   54|  2.49M|  int h;
   55|       |
   56|  2.49M|  if ((e = find(key))) {
  ------------------
  |  Branch (56:7): [True: 557k, False: 1.94M]
  ------------------
   57|   557k|    e->val.free();
   58|   557k|    e->val = *val;
   59|   557k|    gfree(key);
   60|  1.94M|  } else {
   61|  1.94M|    if (length == size) {
  ------------------
  |  Branch (61:9): [True: 62.7k, False: 1.87M]
  ------------------
   62|  62.7k|      expand();
   63|  62.7k|    }
   64|  1.94M|    h = hash(key);
   65|  1.94M|    entries[length].key = key;
   66|  1.94M|    entries[length].val = *val;
   67|  1.94M|    entries[length].next = hashTab[h];
   68|  1.94M|    hashTab[h] = &entries[length];
   69|  1.94M|    ++length;
   70|  1.94M|  }
   71|  2.49M|}
_ZN4Dict6expandEv:
   73|  62.7k|void Dict::expand() {
   74|  62.7k|  int h, i;
   75|       |
   76|  62.7k|  size *= 2;
   77|  62.7k|  entries = (DictEntry *)greallocn(entries, size, sizeof(DictEntry));
   78|  62.7k|  hashTab = (DictEntry **)greallocn(hashTab, 2 * size - 1,
   79|  62.7k|				    sizeof(DictEntry *));
   80|  62.7k|  memset(hashTab, 0, (2 * size - 1) * sizeof(DictEntry *));
   81|   597k|  for (i = 0; i < length; ++i) {
  ------------------
  |  Branch (81:15): [True: 534k, False: 62.7k]
  ------------------
   82|   534k|    h = hash(entries[i].key);
   83|   534k|    entries[i].next = hashTab[h];
   84|   534k|    hashTab[h] = &entries[i];
   85|   534k|  }
   86|  62.7k|}
_ZN4Dict4hashEPKc:
  101|  8.98M|int Dict::hash(const char *key) {
  102|  8.98M|  const char *p;
  103|  8.98M|  unsigned int h;
  104|       |
  105|  8.98M|  h = 0;
  106|  58.0M|  for (p = key; *p; ++p) {
  ------------------
  |  Branch (106:17): [True: 49.0M, False: 8.98M]
  ------------------
  107|  49.0M|    h = 17 * h + (int)(*p & 0xff);
  108|  49.0M|  }
  109|  8.98M|  return (int)(h % (2 * size - 1));
  110|  8.98M|}
_ZN4Dict6lookupEPKcP6Objecti:
  118|  3.51M|Object *Dict::lookup(const char *key, Object *obj, int recursion) {
  119|  3.51M|  DictEntry *e;
  120|       |
  121|  3.51M|  return (e = find(key)) ? e->val.fetch(xref, obj, recursion)
  ------------------
  |  Branch (121:10): [True: 979k, False: 2.53M]
  ------------------
  122|  3.51M|                         : obj->initNull();
  123|  3.51M|}
_ZN4Dict8lookupNFEPKcP6Object:
  125|   493k|Object *Dict::lookupNF(const char *key, Object *obj) {
  126|   493k|  DictEntry *e;
  127|       |
  128|   493k|  return (e = find(key)) ? e->val.copy(obj) : obj->initNull();
  ------------------
  |  Branch (128:10): [True: 128k, False: 365k]
  ------------------
  129|   493k|}
_ZN4Dict6getKeyEi:
  131|   233k|char *Dict::getKey(int i) {
  132|   233k|  return entries[i].key;
  133|   233k|}
_ZN4Dict6getValEiP6Object:
  135|   140k|Object *Dict::getVal(int i, Object *obj) {
  136|   140k|  return entries[i].val.fetch(xref, obj);
  137|   140k|}
_ZN4Dict8getValNFEiP6Object:
  139|  92.6k|Object *Dict::getValNF(int i, Object *obj) {
  140|  92.6k|  return entries[i].val.copy(obj);
  141|  92.6k|}
_ZN4Dict4findEPKc:
   88|  6.50M|inline DictEntry *Dict::find(const char *key) {
   89|  6.50M|  DictEntry *e;
   90|  6.50M|  int h;
   91|       |
   92|  6.50M|  h = hash(key);
   93|  8.28M|  for (e = hashTab[h]; e; e = e->next) {
  ------------------
  |  Branch (93:24): [True: 3.44M, False: 4.84M]
  ------------------
   94|  3.44M|    if (!strcmp(key, e->key)) {
  ------------------
  |  Branch (94:9): [True: 1.66M, False: 1.78M]
  ------------------
   95|  1.66M|      return e;
   96|  1.66M|    }
   97|  3.44M|  }
   98|  4.84M|  return NULL;
   99|  6.50M|}

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

_Z5error13ErrorCategorylPKcz:
   46|  57.5M|		 const char *msg, ...) {
   47|  57.5M|  va_list args;
   48|  57.5M|  GString *s, *sanitized;
   49|  57.5M|  char c;
   50|  57.5M|  int i;
   51|       |
   52|       |  // NB: this can be called before the globalParams object is created
   53|  57.5M|  if (!errorCbk && globalParams && globalParams->getErrQuiet()) {
  ------------------
  |  Branch (53:7): [True: 57.5M, False: 0]
  |  Branch (53:20): [True: 57.5M, False: 0]
  |  Branch (53:36): [True: 57.5M, False: 0]
  ------------------
   54|  57.5M|    return;
   55|  57.5M|  }
   56|  57.5M|  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|  10.2k|SysFontList::SysFontList() {
  460|  10.2k|  fonts = new GList();
  461|  10.2k|}
_ZN11SysFontListD2Ev:
  463|  10.2k|SysFontList::~SysFontList() {
  464|  10.2k|  deleteGList(fonts, SysFontInfo);
  ------------------
  |  |   94|  10.2k|  do {                                              \
  |  |   95|  10.2k|    GList *_list = (list);                          \
  |  |   96|  10.2k|    {                                               \
  |  |   97|  10.2k|      int _i;                                       \
  |  |   98|  10.2k|      for (_i = 0; _i < _list->getLength(); ++_i) { \
  |  |  ------------------
  |  |  |  Branch (98:20): [True: 0, False: 10.2k]
  |  |  ------------------
  |  |   99|      0|        delete (T*)_list->get(_i);                  \
  |  |  100|      0|      }                                             \
  |  |  101|  10.2k|      delete _list;                                 \
  |  |  102|  10.2k|    }                                               \
  |  |  103|  10.2k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (103:12): [Folded, False: 10.2k]
  |  |  ------------------
  ------------------
  465|  10.2k|}
_ZN10KeyBindingC2EiiiPKc:
  645|   622k|KeyBinding::KeyBinding(int codeA, int modsA, int contextA, const char *cmd0) {
  646|   622k|  code = codeA;
  647|   622k|  mods = modsA;
  648|   622k|  context = contextA;
  649|   622k|  cmds = new GList();
  650|   622k|  cmds->append(new GString(cmd0));
  651|   622k|}
_ZN10KeyBindingD2Ev:
  670|   622k|KeyBinding::~KeyBinding() {
  671|   622k|  deleteGList(cmds, GString);
  ------------------
  |  |   94|   622k|  do {                                              \
  |  |   95|   622k|    GList *_list = (list);                          \
  |  |   96|   622k|    {                                               \
  |  |   97|   622k|      int _i;                                       \
  |  |   98|  1.24M|      for (_i = 0; _i < _list->getLength(); ++_i) { \
  |  |  ------------------
  |  |  |  Branch (98:20): [True: 622k, False: 622k]
  |  |  ------------------
  |  |   99|   622k|        delete (T*)_list->get(_i);                  \
  |  |  100|   622k|      }                                             \
  |  |  101|   622k|      delete _list;                                 \
  |  |  102|   622k|    }                                               \
  |  |  103|   622k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (103:12): [Folded, False: 622k]
  |  |  ------------------
  ------------------
  672|   622k|}
_ZN12GlobalParamsC2EPKc:
  692|  10.2k|GlobalParams::GlobalParams(const char *cfgFileName) {
  693|  10.2k|  UnicodeMap *map;
  694|  10.2k|  GString *fileName;
  695|  10.2k|  FILE *f;
  696|  10.2k|  int i;
  697|       |
  698|  10.2k|#if MULTITHREADED
  699|  10.2k|  gInitMutex(&mutex);
  ------------------
  |  |   51|  10.2k|#define gInitMutex(m) pthread_mutex_init(m, NULL)
  ------------------
  700|  10.2k|  gInitMutex(&unicodeMapCacheMutex);
  ------------------
  |  |   51|  10.2k|#define gInitMutex(m) pthread_mutex_init(m, NULL)
  ------------------
  701|  10.2k|  gInitMutex(&cMapCacheMutex);
  ------------------
  |  |   51|  10.2k|#define gInitMutex(m) pthread_mutex_init(m, NULL)
  ------------------
  702|  10.2k|#endif
  703|       |
  704|       |#ifdef _WIN32
  705|       |  tlsWin32ErrorInfo = TlsAlloc();
  706|       |#endif
  707|       |
  708|  10.2k|  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|  10.2k|  macRomanReverseMap = new NameToCharCode();
  713|  2.62M|  for (i = 255; i >= 0; --i) {
  ------------------
  |  Branch (713:17): [True: 2.61M, False: 10.2k]
  ------------------
  714|  2.61M|    if (macRomanEncoding[i]) {
  ------------------
  |  Branch (714:9): [True: 2.27M, False: 336k]
  ------------------
  715|  2.27M|      macRomanReverseMap->add(macRomanEncoding[i], (CharCode)i);
  716|  2.27M|    }
  717|  2.61M|  }
  718|       |
  719|       |#ifdef _WIN32
  720|       |  // baseDir will be set by a call to setBaseDir
  721|       |  baseDir = new GString();
  722|       |#else
  723|  10.2k|  baseDir = appendToPath(getHomeDir(), ".xpdf");
  724|  10.2k|#endif
  725|  10.2k|  configFileVars = new GHash(gTrue);
  ------------------
  |  |   17|  10.2k|#define gTrue 1
  ------------------
  726|  10.2k|  setDataDirVar();
  727|  10.2k|  nameToUnicode = new NameToCharCode();
  728|  10.2k|  cidToUnicodes = new GHash(gTrue);
  ------------------
  |  |   17|  10.2k|#define gTrue 1
  ------------------
  729|  10.2k|  unicodeToUnicodes = new GHash(gTrue);
  ------------------
  |  |   17|  10.2k|#define gTrue 1
  ------------------
  730|  10.2k|  residentUnicodeMaps = new GHash();
  731|  10.2k|  unicodeMaps = new GHash(gTrue);
  ------------------
  |  |   17|  10.2k|#define gTrue 1
  ------------------
  732|  10.2k|  cMapDirs = new GHash(gTrue);
  ------------------
  |  |   17|  10.2k|#define gTrue 1
  ------------------
  733|  10.2k|  toUnicodeDirs = new GList();
  734|  10.2k|  unicodeRemapping = new UnicodeRemapping();
  735|  10.2k|  fontFiles = new GHash(gTrue);
  ------------------
  |  |   17|  10.2k|#define gTrue 1
  ------------------
  736|  10.2k|  fontDirs = new GList();
  737|  10.2k|  ccFontFiles = new GHash(gTrue);
  ------------------
  |  |   17|  10.2k|#define gTrue 1
  ------------------
  738|  10.2k|  base14SysFonts = new GHash(gTrue);
  ------------------
  |  |   17|  10.2k|#define gTrue 1
  ------------------
  739|  10.2k|  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|  10.2k|  psPaperWidth = defPaperWidth;
  ------------------
  |  |   46|  10.2k|#define defPaperWidth  612    // American letter (8.5x11")
  ------------------
  756|  10.2k|  psPaperHeight = defPaperHeight;
  ------------------
  |  |   47|  10.2k|#define defPaperHeight 792
  ------------------
  757|  10.2k|#endif
  758|  10.2k|  psImageableLLX = psImageableLLY = 0;
  759|  10.2k|  psImageableURX = psPaperWidth;
  760|  10.2k|  psImageableURY = psPaperHeight;
  761|  10.2k|  psCrop = gTrue;
  ------------------
  |  |   17|  10.2k|#define gTrue 1
  ------------------
  762|  10.2k|  psUseCropBoxAsPage = gFalse;
  ------------------
  |  |   18|  10.2k|#define gFalse 0
  ------------------
  763|  10.2k|  psExpandSmaller = gFalse;
  ------------------
  |  |   18|  10.2k|#define gFalse 0
  ------------------
  764|  10.2k|  psShrinkLarger = gTrue;
  ------------------
  |  |   17|  10.2k|#define gTrue 1
  ------------------
  765|  10.2k|  psCenter = gTrue;
  ------------------
  |  |   17|  10.2k|#define gTrue 1
  ------------------
  766|  10.2k|  psDuplex = gFalse;
  ------------------
  |  |   18|  10.2k|#define gFalse 0
  ------------------
  767|  10.2k|  psLevel = psLevel3;
  768|  10.2k|  psResidentFonts = new GHash(gTrue);
  ------------------
  |  |   17|  10.2k|#define gTrue 1
  ------------------
  769|  10.2k|  psResidentFonts16 = new GList();
  770|  10.2k|  psResidentFontsCC = new GList();
  771|  10.2k|  psEmbedType1 = gTrue;
  ------------------
  |  |   17|  10.2k|#define gTrue 1
  ------------------
  772|  10.2k|  psEmbedTrueType = gTrue;
  ------------------
  |  |   17|  10.2k|#define gTrue 1
  ------------------
  773|  10.2k|  psEmbedCIDPostScript = gTrue;
  ------------------
  |  |   17|  10.2k|#define gTrue 1
  ------------------
  774|  10.2k|  psEmbedCIDTrueType = gTrue;
  ------------------
  |  |   17|  10.2k|#define gTrue 1
  ------------------
  775|  10.2k|  psFontPassthrough = gFalse;
  ------------------
  |  |   18|  10.2k|#define gFalse 0
  ------------------
  776|  10.2k|  psPreload = gFalse;
  ------------------
  |  |   18|  10.2k|#define gFalse 0
  ------------------
  777|  10.2k|  psOPI = gFalse;
  ------------------
  |  |   18|  10.2k|#define gFalse 0
  ------------------
  778|  10.2k|  psASCIIHex = gFalse;
  ------------------
  |  |   18|  10.2k|#define gFalse 0
  ------------------
  779|  10.2k|  psLZW = gTrue;
  ------------------
  |  |   17|  10.2k|#define gTrue 1
  ------------------
  780|  10.2k|  psUncompressPreloadedImages = gFalse;
  ------------------
  |  |   18|  10.2k|#define gFalse 0
  ------------------
  781|  10.2k|  psMinLineWidth = 0;
  782|  10.2k|  psRasterResolution = 300;
  783|  10.2k|  psRasterMono = gFalse;
  ------------------
  |  |   18|  10.2k|#define gFalse 0
  ------------------
  784|  10.2k|  psRasterSliceSize = 20000000;
  785|  10.2k|  psAlwaysRasterize = gFalse;
  ------------------
  |  |   18|  10.2k|#define gFalse 0
  ------------------
  786|  10.2k|  psNeverRasterize = gFalse;
  ------------------
  |  |   18|  10.2k|#define gFalse 0
  ------------------
  787|  10.2k|  textEncoding = new GString(defaultTextEncoding);
  788|       |#if defined(_WIN32)
  789|       |  textEOL = eolDOS;
  790|       |#else
  791|  10.2k|  textEOL = eolUnix;
  792|  10.2k|#endif
  793|  10.2k|  textPageBreaks = gTrue;
  ------------------
  |  |   17|  10.2k|#define gTrue 1
  ------------------
  794|  10.2k|  textKeepTinyChars = gTrue;
  ------------------
  |  |   17|  10.2k|#define gTrue 1
  ------------------
  795|  10.2k|  initialZoom = new GString("125");
  796|  10.2k|  defaultFitZoom = 0;
  797|  10.2k|  zoomScaleFactor = 1;
  798|  10.2k|  zoomValues = new GList();
  799|  10.2k|  zoomValues->append(new GString("25"));
  800|  10.2k|  zoomValues->append(new GString("50"));
  801|  10.2k|  zoomValues->append(new GString("75"));
  802|  10.2k|  zoomValues->append(new GString("100"));
  803|  10.2k|  zoomValues->append(new GString("110"));
  804|  10.2k|  zoomValues->append(new GString("125"));
  805|  10.2k|  zoomValues->append(new GString("150"));
  806|  10.2k|  zoomValues->append(new GString("175"));
  807|  10.2k|  zoomValues->append(new GString("200"));
  808|  10.2k|  zoomValues->append(new GString("300"));
  809|  10.2k|  zoomValues->append(new GString("400"));
  810|  10.2k|  zoomValues->append(new GString("600"));
  811|  10.2k|  zoomValues->append(new GString("800"));
  812|  10.2k|  initialDisplayMode = new GString("continuous");
  813|  10.2k|  initialToolbarState = gTrue;
  ------------------
  |  |   17|  10.2k|#define gTrue 1
  ------------------
  814|  10.2k|  initialSidebarState = gTrue;
  ------------------
  |  |   17|  10.2k|#define gTrue 1
  ------------------
  815|  10.2k|  initialSidebarWidth = 0;
  816|  10.2k|  initialSelectMode = new GString("linear");
  817|  10.2k|  initialMaximized = gFalse;
  ------------------
  |  |   18|  10.2k|#define gFalse 0
  ------------------
  818|  10.2k|  maxTileWidth = 1500;
  819|  10.2k|  maxTileHeight = 1500;
  820|  10.2k|  tileCacheSize = 10;
  821|  10.2k|  workerThreads = 1;
  822|  10.2k|  enableFreeType = gTrue;
  ------------------
  |  |   17|  10.2k|#define gTrue 1
  ------------------
  823|  10.2k|  disableFreeTypeHinting = gFalse;
  ------------------
  |  |   18|  10.2k|#define gFalse 0
  ------------------
  824|  10.2k|  antialias = gTrue;
  ------------------
  |  |   17|  10.2k|#define gTrue 1
  ------------------
  825|  10.2k|  vectorAntialias = gTrue;
  ------------------
  |  |   17|  10.2k|#define gTrue 1
  ------------------
  826|  10.2k|  imageMaskAntialias = gTrue;
  ------------------
  |  |   17|  10.2k|#define gTrue 1
  ------------------
  827|  10.2k|  antialiasPrinting = gFalse;
  ------------------
  |  |   18|  10.2k|#define gFalse 0
  ------------------
  828|  10.2k|  strokeAdjust = strokeAdjustNormal;
  829|  10.2k|  screenType = screenUnset;
  830|  10.2k|  screenSize = -1;
  831|  10.2k|  screenDotRadius = -1;
  832|  10.2k|  screenGamma = 1.0;
  833|  10.2k|  screenBlackThreshold = 0.0;
  834|  10.2k|  screenWhiteThreshold = 1.0;
  835|  10.2k|  minLineWidth = 0.0;
  836|  10.2k|  enablePathSimplification = gFalse;
  ------------------
  |  |   18|  10.2k|#define gFalse 0
  ------------------
  837|  10.2k|  drawAnnotations = gTrue;
  ------------------
  |  |   17|  10.2k|#define gTrue 1
  ------------------
  838|  10.2k|  drawFormFields = gTrue;
  ------------------
  |  |   17|  10.2k|#define gTrue 1
  ------------------
  839|  10.2k|  enableXFA = gTrue;
  ------------------
  |  |   17|  10.2k|#define gTrue 1
  ------------------
  840|  10.2k|  preferXFAFieldValues = gTrue;
  ------------------
  |  |   17|  10.2k|#define gTrue 1
  ------------------
  841|  10.2k|  overprintPreview = gFalse;
  ------------------
  |  |   18|  10.2k|#define gFalse 0
  ------------------
  842|  10.2k|  paperColor = new GString("#ffffff");
  843|  10.2k|  matteColor = new GString("#808080");
  844|  10.2k|  fullScreenMatteColor = new GString("#000000");
  845|  10.2k|  selectionColor = new GString("#8080ff");
  846|  10.2k|  reverseVideoInvertImages = gFalse;
  ------------------
  |  |   18|  10.2k|#define gFalse 0
  ------------------
  847|  10.2k|  allowLinksToChangeZoom = gTrue;
  ------------------
  |  |   17|  10.2k|#define gTrue 1
  ------------------
  848|  10.2k|  launchCommand = NULL;
  849|  10.2k|  movieCommand = NULL;
  850|  10.2k|  defaultPrinter = NULL;
  851|  10.2k|  mapNumericCharNames = gTrue;
  ------------------
  |  |   17|  10.2k|#define gTrue 1
  ------------------
  852|  10.2k|  mapUnknownCharNames = gFalse;
  ------------------
  |  |   18|  10.2k|#define gFalse 0
  ------------------
  853|  10.2k|  mapExtTrueTypeFontsViaUnicode = gTrue;
  ------------------
  |  |   17|  10.2k|#define gTrue 1
  ------------------
  854|  10.2k|  useTrueTypeUnicodeMapping = gFalse;
  ------------------
  |  |   18|  10.2k|#define gFalse 0
  ------------------
  855|  10.2k|  ignoreWrongSizeToUnicode = gFalse;
  ------------------
  |  |   18|  10.2k|#define gFalse 0
  ------------------
  856|  10.2k|  droppedFonts = new GHash(gTrue);
  ------------------
  |  |   17|  10.2k|#define gTrue 1
  ------------------
  857|  10.2k|  separateRotatedText = gFalse;
  ------------------
  |  |   18|  10.2k|#define gFalse 0
  ------------------
  858|  10.2k|  discardCoveredText = gFalse;
  ------------------
  |  |   18|  10.2k|#define gFalse 0
  ------------------
  859|  10.2k|  createDefaultKeyBindings();
  860|  10.2k|  popupMenuCmds = new GList();
  861|  10.2k|  initStateFilePaths();
  862|  10.2k|  saveSessionOnQuit = gTrue;
  ------------------
  |  |   17|  10.2k|#define gTrue 1
  ------------------
  863|  10.2k|  savePageNumbers = gTrue;
  ------------------
  |  |   17|  10.2k|#define gTrue 1
  ------------------
  864|  10.2k|  printCommands = gFalse;
  ------------------
  |  |   18|  10.2k|#define gFalse 0
  ------------------
  865|  10.2k|  printStatusInfo = gFalse;
  ------------------
  |  |   18|  10.2k|#define gFalse 0
  ------------------
  866|  10.2k|  errQuiet = gFalse;
  ------------------
  |  |   18|  10.2k|#define gFalse 0
  ------------------
  867|  10.2k|  debugLogFile = NULL;
  868|       |
  869|  10.2k|  cidToUnicodeCache = new CharCodeToUnicodeCache(cidToUnicodeCacheSize);
  ------------------
  |  |   71|  10.2k|#define cidToUnicodeCacheSize     4
  ------------------
  870|  10.2k|  unicodeToUnicodeCache =
  871|  10.2k|      new CharCodeToUnicodeCache(unicodeToUnicodeCacheSize);
  ------------------
  |  |   72|  10.2k|#define unicodeToUnicodeCacheSize 4
  ------------------
  872|  10.2k|  unicodeMapCache = new UnicodeMapCache();
  873|  10.2k|  cMapCache = new CMapCache();
  874|       |
  875|       |  // set up the initial nameToUnicode table
  876|  43.3M|  for (i = 0; nameToUnicodeTab[i].name; ++i) {
  ------------------
  |  Branch (876:15): [True: 43.2M, False: 10.2k]
  ------------------
  877|  43.2M|    nameToUnicode->add(nameToUnicodeTab[i].name, nameToUnicodeTab[i].u);
  878|  43.2M|  }
  879|       |
  880|       |  // set up the residentUnicodeMaps table
  881|  10.2k|  map = new UnicodeMap("Latin1", gFalse,
  ------------------
  |  |   18|  10.2k|#define gFalse 0
  ------------------
  882|  10.2k|		       latin1UnicodeMapRanges, latin1UnicodeMapLen);
  ------------------
  |  |   71|  10.2k|#define latin1UnicodeMapLen (sizeof(latin1UnicodeMapRanges) / sizeof(UnicodeMapRange))
  ------------------
  883|  10.2k|  residentUnicodeMaps->add(map->getEncodingName(), map);
  884|  10.2k|  map = new UnicodeMap("ASCII7", gFalse,
  ------------------
  |  |   18|  10.2k|#define gFalse 0
  ------------------
  885|  10.2k|		       ascii7UnicodeMapRanges, ascii7UnicodeMapLen);
  ------------------
  |  |  207|  10.2k|#define ascii7UnicodeMapLen (sizeof(ascii7UnicodeMapRanges) / sizeof(UnicodeMapRange))
  ------------------
  886|  10.2k|  residentUnicodeMaps->add(map->getEncodingName(), map);
  887|  10.2k|  map = new UnicodeMap("Symbol", gFalse,
  ------------------
  |  |   18|  10.2k|#define gFalse 0
  ------------------
  888|  10.2k|		       symbolUnicodeMapRanges, symbolUnicodeMapLen);
  ------------------
  |  |  332|  10.2k|#define symbolUnicodeMapLen (sizeof(symbolUnicodeMapRanges) / sizeof(UnicodeMapRange))
  ------------------
  889|  10.2k|  residentUnicodeMaps->add(map->getEncodingName(), map);
  890|  10.2k|  map = new UnicodeMap("ZapfDingbats", gFalse, zapfDingbatsUnicodeMapRanges,
  ------------------
  |  |   18|  10.2k|#define gFalse 0
  ------------------
  891|  10.2k|		       zapfDingbatsUnicodeMapLen);
  ------------------
  |  |  366|  10.2k|#define zapfDingbatsUnicodeMapLen (sizeof(zapfDingbatsUnicodeMapRanges) / sizeof(UnicodeMapRange))
  ------------------
  892|  10.2k|  residentUnicodeMaps->add(map->getEncodingName(), map);
  893|  10.2k|  map = new UnicodeMap("UTF-8", gTrue, &mapUTF8);
  ------------------
  |  |   17|  10.2k|#define gTrue 1
  ------------------
  894|  10.2k|  residentUnicodeMaps->add(map->getEncodingName(), map);
  895|  10.2k|  map = new UnicodeMap("UCS-2", gTrue, &mapUCS2);
  ------------------
  |  |   17|  10.2k|#define gTrue 1
  ------------------
  896|  10.2k|  residentUnicodeMaps->add(map->getEncodingName(), map);
  897|       |
  898|       |  // read the config file
  899|  10.2k|  f = openConfigFile(cfgFileName, &fileName);
  900|  10.2k|  if (f) {
  ------------------
  |  Branch (900:7): [True: 0, False: 10.2k]
  ------------------
  901|      0|    parseFile(fileName, f);
  902|      0|    delete fileName;
  903|      0|    fclose(f);
  904|      0|  }
  905|  10.2k|}
_ZN12GlobalParams13setDataDirVarEv:
  907|  10.2k|void GlobalParams::setDataDirVar() {
  908|  10.2k|  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|  10.2k|  dir = new GString("./data");
  927|  10.2k|#endif
  928|       |
  929|  10.2k|  configFileVars->add(new GString("DATADIR"), dir);
  930|  10.2k|}
_ZN12GlobalParams24createDefaultKeyBindingsEv:
  932|  10.2k|void GlobalParams::createDefaultKeyBindings() {
  933|  10.2k|  keyBindings = new GList();
  934|       |
  935|       |  //----- mouse buttons
  936|  10.2k|  keyBindings->append(new KeyBinding(xpdfKeyCodeMousePress1, xpdfKeyModNone,
  ------------------
  |  |  147|  10.2k|#define xpdfKeyCodeMousePress1        0x2001
  ------------------
                keyBindings->append(new KeyBinding(xpdfKeyCodeMousePress1, xpdfKeyModNone,
  ------------------
  |  |  192|  10.2k|#define xpdfKeyModNone            0
  ------------------
  937|  10.2k|				     xpdfKeyContextAny, "startSelection"));
  ------------------
  |  |  196|  10.2k|#define xpdfKeyContextAny         0
  ------------------
  938|  10.2k|  keyBindings->append(new KeyBinding(xpdfKeyCodeMousePress1, xpdfKeyModShift,
  ------------------
  |  |  147|  10.2k|#define xpdfKeyCodeMousePress1        0x2001
  ------------------
                keyBindings->append(new KeyBinding(xpdfKeyCodeMousePress1, xpdfKeyModShift,
  ------------------
  |  |  193|  10.2k|#define xpdfKeyModShift           (1 << 0)
  ------------------
  939|  10.2k|				     xpdfKeyContextAny,
  ------------------
  |  |  196|  10.2k|#define xpdfKeyContextAny         0
  ------------------
  940|  10.2k|				     "startExtendedSelection"));
  941|  10.2k|  keyBindings->append(new KeyBinding(xpdfKeyCodeMouseRelease1, xpdfKeyModNone,
  ------------------
  |  |  156|  10.2k|#define xpdfKeyCodeMouseRelease1      0x2101
  ------------------
                keyBindings->append(new KeyBinding(xpdfKeyCodeMouseRelease1, xpdfKeyModNone,
  ------------------
  |  |  192|  10.2k|#define xpdfKeyModNone            0
  ------------------
  942|  10.2k|				     xpdfKeyContextAny, "endSelection"));
  ------------------
  |  |  196|  10.2k|#define xpdfKeyContextAny         0
  ------------------
  943|  10.2k|  keyBindings->append(new KeyBinding(xpdfKeyCodeMouseRelease1, xpdfKeyModShift,
  ------------------
  |  |  156|  10.2k|#define xpdfKeyCodeMouseRelease1      0x2101
  ------------------
                keyBindings->append(new KeyBinding(xpdfKeyCodeMouseRelease1, xpdfKeyModShift,
  ------------------
  |  |  193|  10.2k|#define xpdfKeyModShift           (1 << 0)
  ------------------
  944|  10.2k|				     xpdfKeyContextAny,
  ------------------
  |  |  196|  10.2k|#define xpdfKeyContextAny         0
  ------------------
  945|  10.2k|				     "endSelection"));
  946|  10.2k|  keyBindings->append(new KeyBinding(xpdfKeyCodeMouseDoubleClick1,
  ------------------
  |  |  174|  10.2k|#define xpdfKeyCodeMouseDoubleClick1  0x2301
  ------------------
  947|  10.2k|				     xpdfKeyModNone, xpdfKeyContextAny,
  ------------------
  |  |  192|  10.2k|#define xpdfKeyModNone            0
  ------------------
              				     xpdfKeyModNone, xpdfKeyContextAny,
  ------------------
  |  |  196|  10.2k|#define xpdfKeyContextAny         0
  ------------------
  948|  10.2k|				     "selectWord"));
  949|  10.2k|  keyBindings->append(new KeyBinding(xpdfKeyCodeMouseTripleClick1,
  ------------------
  |  |  183|  10.2k|#define xpdfKeyCodeMouseTripleClick1  0x2401
  ------------------
  950|  10.2k|				     xpdfKeyModNone, xpdfKeyContextAny,
  ------------------
  |  |  192|  10.2k|#define xpdfKeyModNone            0
  ------------------
              				     xpdfKeyModNone, xpdfKeyContextAny,
  ------------------
  |  |  196|  10.2k|#define xpdfKeyContextAny         0
  ------------------
  951|  10.2k|				     "selectLine"));
  952|  10.2k|  keyBindings->append(new KeyBinding(xpdfKeyCodeMouseClick1, xpdfKeyModNone,
  ------------------
  |  |  165|  10.2k|#define xpdfKeyCodeMouseClick1        0x2201
  ------------------
                keyBindings->append(new KeyBinding(xpdfKeyCodeMouseClick1, xpdfKeyModNone,
  ------------------
  |  |  192|  10.2k|#define xpdfKeyModNone            0
  ------------------
  953|  10.2k|				     xpdfKeyContextAny, "followLinkNoSel"));
  ------------------
  |  |  196|  10.2k|#define xpdfKeyContextAny         0
  ------------------
  954|  10.2k|  keyBindings->append(new KeyBinding(xpdfKeyCodeMouseClick2, xpdfKeyModNone,
  ------------------
  |  |  166|  10.2k|#define xpdfKeyCodeMouseClick2        0x2202
  ------------------
                keyBindings->append(new KeyBinding(xpdfKeyCodeMouseClick2, xpdfKeyModNone,
  ------------------
  |  |  192|  10.2k|#define xpdfKeyModNone            0
  ------------------
  955|  10.2k|				     xpdfKeyContextOverLink,
  ------------------
  |  |  201|  10.2k|#define xpdfKeyContextOverLink    (1 << 4)
  ------------------
  956|  10.2k|				     "followLinkInNewTab"));
  957|  10.2k|  keyBindings->append(new KeyBinding(xpdfKeyCodeMousePress2, xpdfKeyModNone,
  ------------------
  |  |  148|  10.2k|#define xpdfKeyCodeMousePress2        0x2002
  ------------------
                keyBindings->append(new KeyBinding(xpdfKeyCodeMousePress2, xpdfKeyModNone,
  ------------------
  |  |  192|  10.2k|#define xpdfKeyModNone            0
  ------------------
  958|  10.2k|				     xpdfKeyContextAny, "startPan"));
  ------------------
  |  |  196|  10.2k|#define xpdfKeyContextAny         0
  ------------------
  959|  10.2k|  keyBindings->append(new KeyBinding(xpdfKeyCodeMouseRelease2, xpdfKeyModNone,
  ------------------
  |  |  157|  10.2k|#define xpdfKeyCodeMouseRelease2      0x2102
  ------------------
                keyBindings->append(new KeyBinding(xpdfKeyCodeMouseRelease2, xpdfKeyModNone,
  ------------------
  |  |  192|  10.2k|#define xpdfKeyModNone            0
  ------------------
  960|  10.2k|				     xpdfKeyContextAny, "endPan"));
  ------------------
  |  |  196|  10.2k|#define xpdfKeyContextAny         0
  ------------------
  961|  10.2k|  keyBindings->append(new KeyBinding(xpdfKeyCodeMousePress3, xpdfKeyModNone,
  ------------------
  |  |  149|  10.2k|#define xpdfKeyCodeMousePress3        0x2003
  ------------------
                keyBindings->append(new KeyBinding(xpdfKeyCodeMousePress3, xpdfKeyModNone,
  ------------------
  |  |  192|  10.2k|#define xpdfKeyModNone            0
  ------------------
  962|  10.2k|				     xpdfKeyContextAny, "postPopupMenu"));
  ------------------
  |  |  196|  10.2k|#define xpdfKeyContextAny         0
  ------------------
  963|  10.2k|  keyBindings->append(new KeyBinding(xpdfKeyCodeMousePress4, xpdfKeyModNone,
  ------------------
  |  |  150|  10.2k|#define xpdfKeyCodeMousePress4        0x2004
  ------------------
                keyBindings->append(new KeyBinding(xpdfKeyCodeMousePress4, xpdfKeyModNone,
  ------------------
  |  |  192|  10.2k|#define xpdfKeyModNone            0
  ------------------
  964|  10.2k|				     xpdfKeyContextAny,
  ------------------
  |  |  196|  10.2k|#define xpdfKeyContextAny         0
  ------------------
  965|  10.2k|				     "scrollUpPrevPage(16)"));
  966|  10.2k|  keyBindings->append(new KeyBinding(xpdfKeyCodeMousePress5, xpdfKeyModNone,
  ------------------
  |  |  151|  10.2k|#define xpdfKeyCodeMousePress5        0x2005
  ------------------
                keyBindings->append(new KeyBinding(xpdfKeyCodeMousePress5, xpdfKeyModNone,
  ------------------
  |  |  192|  10.2k|#define xpdfKeyModNone            0
  ------------------
  967|  10.2k|				     xpdfKeyContextAny,
  ------------------
  |  |  196|  10.2k|#define xpdfKeyContextAny         0
  ------------------
  968|  10.2k|				     "scrollDownNextPage(16)"));
  969|  10.2k|  keyBindings->append(new KeyBinding(xpdfKeyCodeMousePress6, xpdfKeyModNone,
  ------------------
  |  |  152|  10.2k|#define xpdfKeyCodeMousePress6        0x2006
  ------------------
                keyBindings->append(new KeyBinding(xpdfKeyCodeMousePress6, xpdfKeyModNone,
  ------------------
  |  |  192|  10.2k|#define xpdfKeyModNone            0
  ------------------
  970|  10.2k|				     xpdfKeyContextAny, "scrollLeft(16)"));
  ------------------
  |  |  196|  10.2k|#define xpdfKeyContextAny         0
  ------------------
  971|  10.2k|  keyBindings->append(new KeyBinding(xpdfKeyCodeMousePress7, xpdfKeyModNone,
  ------------------
  |  |  153|  10.2k|#define xpdfKeyCodeMousePress7        0x2007
  ------------------
                keyBindings->append(new KeyBinding(xpdfKeyCodeMousePress7, xpdfKeyModNone,
  ------------------
  |  |  192|  10.2k|#define xpdfKeyModNone            0
  ------------------
  972|  10.2k|				     xpdfKeyContextAny, "scrollRight(16)"));
  ------------------
  |  |  196|  10.2k|#define xpdfKeyContextAny         0
  ------------------
  973|  10.2k|  keyBindings->append(new KeyBinding(xpdfKeyCodeMousePress4, xpdfKeyModCtrl,
  ------------------
  |  |  150|  10.2k|#define xpdfKeyCodeMousePress4        0x2004
  ------------------
                keyBindings->append(new KeyBinding(xpdfKeyCodeMousePress4, xpdfKeyModCtrl,
  ------------------
  |  |  194|  10.2k|#define xpdfKeyModCtrl            (1 << 1)
  ------------------
  974|  10.2k|				     xpdfKeyContextAny, "zoomIn"));
  ------------------
  |  |  196|  10.2k|#define xpdfKeyContextAny         0
  ------------------
  975|  10.2k|  keyBindings->append(new KeyBinding(xpdfKeyCodeMousePress5, xpdfKeyModCtrl,
  ------------------
  |  |  151|  10.2k|#define xpdfKeyCodeMousePress5        0x2005
  ------------------
                keyBindings->append(new KeyBinding(xpdfKeyCodeMousePress5, xpdfKeyModCtrl,
  ------------------
  |  |  194|  10.2k|#define xpdfKeyModCtrl            (1 << 1)
  ------------------
  976|  10.2k|				     xpdfKeyContextAny, "zoomOut"));
  ------------------
  |  |  196|  10.2k|#define xpdfKeyContextAny         0
  ------------------
  977|       |
  978|       |  //----- control keys
  979|  10.2k|  keyBindings->append(new KeyBinding('o', xpdfKeyModCtrl,
  ------------------
  |  |  194|  10.2k|#define xpdfKeyModCtrl            (1 << 1)
  ------------------
  980|  10.2k|				     xpdfKeyContextAny, "open"));
  ------------------
  |  |  196|  10.2k|#define xpdfKeyContextAny         0
  ------------------
  981|  10.2k|  keyBindings->append(new KeyBinding('r', xpdfKeyModCtrl,
  ------------------
  |  |  194|  10.2k|#define xpdfKeyModCtrl            (1 << 1)
  ------------------
  982|  10.2k|				     xpdfKeyContextAny, "reload"));
  ------------------
  |  |  196|  10.2k|#define xpdfKeyContextAny         0
  ------------------
  983|  10.2k|  keyBindings->append(new KeyBinding('f', xpdfKeyModCtrl,
  ------------------
  |  |  194|  10.2k|#define xpdfKeyModCtrl            (1 << 1)
  ------------------
  984|  10.2k|				     xpdfKeyContextAny, "find"));
  ------------------
  |  |  196|  10.2k|#define xpdfKeyContextAny         0
  ------------------
  985|  10.2k|  keyBindings->append(new KeyBinding('g', xpdfKeyModCtrl,
  ------------------
  |  |  194|  10.2k|#define xpdfKeyModCtrl            (1 << 1)
  ------------------
  986|  10.2k|				     xpdfKeyContextAny, "findNext"));
  ------------------
  |  |  196|  10.2k|#define xpdfKeyContextAny         0
  ------------------
  987|  10.2k|  keyBindings->append(new KeyBinding('c', xpdfKeyModCtrl,
  ------------------
  |  |  194|  10.2k|#define xpdfKeyModCtrl            (1 << 1)
  ------------------
  988|  10.2k|				     xpdfKeyContextAny, "copy"));
  ------------------
  |  |  196|  10.2k|#define xpdfKeyContextAny         0
  ------------------
  989|  10.2k|  keyBindings->append(new KeyBinding('p', xpdfKeyModCtrl,
  ------------------
  |  |  194|  10.2k|#define xpdfKeyModCtrl            (1 << 1)
  ------------------
  990|  10.2k|				     xpdfKeyContextAny, "print"));
  ------------------
  |  |  196|  10.2k|#define xpdfKeyContextAny         0
  ------------------
  991|  10.2k|  keyBindings->append(new KeyBinding('0', xpdfKeyModCtrl,
  ------------------
  |  |  194|  10.2k|#define xpdfKeyModCtrl            (1 << 1)
  ------------------
  992|  10.2k|				     xpdfKeyContextAny, "zoomPercent(125)"));
  ------------------
  |  |  196|  10.2k|#define xpdfKeyContextAny         0
  ------------------
  993|  10.2k|  keyBindings->append(new KeyBinding('+', xpdfKeyModCtrl,
  ------------------
  |  |  194|  10.2k|#define xpdfKeyModCtrl            (1 << 1)
  ------------------
  994|  10.2k|				     xpdfKeyContextAny, "zoomIn"));
  ------------------
  |  |  196|  10.2k|#define xpdfKeyContextAny         0
  ------------------
  995|  10.2k|  keyBindings->append(new KeyBinding('=', xpdfKeyModCtrl,
  ------------------
  |  |  194|  10.2k|#define xpdfKeyModCtrl            (1 << 1)
  ------------------
  996|  10.2k|				     xpdfKeyContextAny, "zoomIn"));
  ------------------
  |  |  196|  10.2k|#define xpdfKeyContextAny         0
  ------------------
  997|  10.2k|  keyBindings->append(new KeyBinding('-', xpdfKeyModCtrl,
  ------------------
  |  |  194|  10.2k|#define xpdfKeyModCtrl            (1 << 1)
  ------------------
  998|  10.2k|				     xpdfKeyContextAny, "zoomOut"));
  ------------------
  |  |  196|  10.2k|#define xpdfKeyContextAny         0
  ------------------
  999|  10.2k|  keyBindings->append(new KeyBinding('s', xpdfKeyModCtrl,
  ------------------
  |  |  194|  10.2k|#define xpdfKeyModCtrl            (1 << 1)
  ------------------
 1000|  10.2k|				     xpdfKeyContextAny, "saveAs"));
  ------------------
  |  |  196|  10.2k|#define xpdfKeyContextAny         0
  ------------------
 1001|  10.2k|  keyBindings->append(new KeyBinding('t', xpdfKeyModCtrl,
  ------------------
  |  |  194|  10.2k|#define xpdfKeyModCtrl            (1 << 1)
  ------------------
 1002|  10.2k|				     xpdfKeyContextAny, "newTab"));
  ------------------
  |  |  196|  10.2k|#define xpdfKeyContextAny         0
  ------------------
 1003|  10.2k|  keyBindings->append(new KeyBinding('n', xpdfKeyModCtrl,
  ------------------
  |  |  194|  10.2k|#define xpdfKeyModCtrl            (1 << 1)
  ------------------
 1004|  10.2k|				     xpdfKeyContextAny, "newWindow"));
  ------------------
  |  |  196|  10.2k|#define xpdfKeyContextAny         0
  ------------------
 1005|  10.2k|  keyBindings->append(new KeyBinding('w', xpdfKeyModCtrl,
  ------------------
  |  |  194|  10.2k|#define xpdfKeyModCtrl            (1 << 1)
  ------------------
 1006|  10.2k|				     xpdfKeyContextAny, "closeTabOrQuit"));
  ------------------
  |  |  196|  10.2k|#define xpdfKeyContextAny         0
  ------------------
 1007|  10.2k|  keyBindings->append(new KeyBinding('l', xpdfKeyModCtrl,
  ------------------
  |  |  194|  10.2k|#define xpdfKeyModCtrl            (1 << 1)
  ------------------
 1008|  10.2k|				     xpdfKeyContextAny,
  ------------------
  |  |  196|  10.2k|#define xpdfKeyContextAny         0
  ------------------
 1009|  10.2k|				     "toggleFullScreenMode"));
 1010|  10.2k|  keyBindings->append(new KeyBinding('q', xpdfKeyModCtrl,
  ------------------
  |  |  194|  10.2k|#define xpdfKeyModCtrl            (1 << 1)
  ------------------
 1011|  10.2k|				     xpdfKeyContextAny, "quit"));
  ------------------
  |  |  196|  10.2k|#define xpdfKeyContextAny         0
  ------------------
 1012|  10.2k|  keyBindings->append(new KeyBinding(xpdfKeyCodeTab, xpdfKeyModCtrl,
  ------------------
  |  |  130|  10.2k|#define xpdfKeyCodeTab                0x1000
  ------------------
                keyBindings->append(new KeyBinding(xpdfKeyCodeTab, xpdfKeyModCtrl,
  ------------------
  |  |  194|  10.2k|#define xpdfKeyModCtrl            (1 << 1)
  ------------------
 1013|  10.2k|				     xpdfKeyContextAny, "nextTab"));
  ------------------
  |  |  196|  10.2k|#define xpdfKeyContextAny         0
  ------------------
 1014|  10.2k|  keyBindings->append(new KeyBinding(xpdfKeyCodeTab,
  ------------------
  |  |  130|  10.2k|#define xpdfKeyCodeTab                0x1000
  ------------------
 1015|  10.2k|				     xpdfKeyModShift | xpdfKeyModCtrl,
  ------------------
  |  |  193|  10.2k|#define xpdfKeyModShift           (1 << 0)
  ------------------
              				     xpdfKeyModShift | xpdfKeyModCtrl,
  ------------------
  |  |  194|  10.2k|#define xpdfKeyModCtrl            (1 << 1)
  ------------------
 1016|  10.2k|				     xpdfKeyContextAny, "prevTab"));
  ------------------
  |  |  196|  10.2k|#define xpdfKeyContextAny         0
  ------------------
 1017|  10.2k|  keyBindings->append(new KeyBinding('?', xpdfKeyModCtrl,
  ------------------
  |  |  194|  10.2k|#define xpdfKeyModCtrl            (1 << 1)
  ------------------
 1018|  10.2k|				     xpdfKeyContextAny, "help"));
  ------------------
  |  |  196|  10.2k|#define xpdfKeyContextAny         0
  ------------------
 1019|       |
 1020|       |  //----- alt keys
 1021|  10.2k|  keyBindings->append(new KeyBinding(xpdfKeyCodeLeft, xpdfKeyModAlt,
  ------------------
  |  |  141|  10.2k|#define xpdfKeyCodeLeft               0x100b
  ------------------
                keyBindings->append(new KeyBinding(xpdfKeyCodeLeft, xpdfKeyModAlt,
  ------------------
  |  |  195|  10.2k|#define xpdfKeyModAlt             (1 << 2)
  ------------------
 1022|  10.2k|				     xpdfKeyContextAny, "goBackward"));
  ------------------
  |  |  196|  10.2k|#define xpdfKeyContextAny         0
  ------------------
 1023|  10.2k|  keyBindings->append(new KeyBinding(xpdfKeyCodeRight, xpdfKeyModAlt,
  ------------------
  |  |  142|  10.2k|#define xpdfKeyCodeRight              0x100c
  ------------------
                keyBindings->append(new KeyBinding(xpdfKeyCodeRight, xpdfKeyModAlt,
  ------------------
  |  |  195|  10.2k|#define xpdfKeyModAlt             (1 << 2)
  ------------------
 1024|  10.2k|				     xpdfKeyContextAny, "goForward"));
  ------------------
  |  |  196|  10.2k|#define xpdfKeyContextAny         0
  ------------------
 1025|       |
 1026|       |  //----- home/end keys
 1027|  10.2k|  keyBindings->append(new KeyBinding(xpdfKeyCodeHome, xpdfKeyModCtrl,
  ------------------
  |  |  137|  10.2k|#define xpdfKeyCodeHome               0x1007
  ------------------
                keyBindings->append(new KeyBinding(xpdfKeyCodeHome, xpdfKeyModCtrl,
  ------------------
  |  |  194|  10.2k|#define xpdfKeyModCtrl            (1 << 1)
  ------------------
 1028|  10.2k|				     xpdfKeyContextAny, "gotoPage(1)"));
  ------------------
  |  |  196|  10.2k|#define xpdfKeyContextAny         0
  ------------------
 1029|  10.2k|  keyBindings->append(new KeyBinding(xpdfKeyCodeHome, xpdfKeyModNone,
  ------------------
  |  |  137|  10.2k|#define xpdfKeyCodeHome               0x1007
  ------------------
                keyBindings->append(new KeyBinding(xpdfKeyCodeHome, xpdfKeyModNone,
  ------------------
  |  |  192|  10.2k|#define xpdfKeyModNone            0
  ------------------
 1030|  10.2k|				     xpdfKeyContextAny, "scrollToTopLeft"));
  ------------------
  |  |  196|  10.2k|#define xpdfKeyContextAny         0
  ------------------
 1031|  10.2k|  keyBindings->append(new KeyBinding(xpdfKeyCodeEnd, xpdfKeyModCtrl,
  ------------------
  |  |  138|  10.2k|#define xpdfKeyCodeEnd                0x1008
  ------------------
                keyBindings->append(new KeyBinding(xpdfKeyCodeEnd, xpdfKeyModCtrl,
  ------------------
  |  |  194|  10.2k|#define xpdfKeyModCtrl            (1 << 1)
  ------------------
 1032|  10.2k|				     xpdfKeyContextAny, "gotoLastPage"));
  ------------------
  |  |  196|  10.2k|#define xpdfKeyContextAny         0
  ------------------
 1033|  10.2k|  keyBindings->append(new KeyBinding(xpdfKeyCodeEnd, xpdfKeyModNone,
  ------------------
  |  |  138|  10.2k|#define xpdfKeyCodeEnd                0x1008
  ------------------
                keyBindings->append(new KeyBinding(xpdfKeyCodeEnd, xpdfKeyModNone,
  ------------------
  |  |  192|  10.2k|#define xpdfKeyModNone            0
  ------------------
 1034|  10.2k|				     xpdfKeyContextAny,
  ------------------
  |  |  196|  10.2k|#define xpdfKeyContextAny         0
  ------------------
 1035|  10.2k|				     "scrollToBottomRight"));
 1036|       |
 1037|       |  //----- pgup/pgdn keys
 1038|  10.2k|  keyBindings->append(new KeyBinding(xpdfKeyCodePgUp, xpdfKeyModNone,
  ------------------
  |  |  139|  10.2k|#define xpdfKeyCodePgUp               0x1009
  ------------------
                keyBindings->append(new KeyBinding(xpdfKeyCodePgUp, xpdfKeyModNone,
  ------------------
  |  |  192|  10.2k|#define xpdfKeyModNone            0
  ------------------
 1039|  10.2k|				     xpdfKeyContextAny, "pageUp"));
  ------------------
  |  |  196|  10.2k|#define xpdfKeyContextAny         0
  ------------------
 1040|  10.2k|  keyBindings->append(new KeyBinding(xpdfKeyCodePgDn, xpdfKeyModNone,
  ------------------
  |  |  140|  10.2k|#define xpdfKeyCodePgDn               0x100a
  ------------------
                keyBindings->append(new KeyBinding(xpdfKeyCodePgDn, xpdfKeyModNone,
  ------------------
  |  |  192|  10.2k|#define xpdfKeyModNone            0
  ------------------
 1041|  10.2k|				     xpdfKeyContextAny, "pageDown"));
  ------------------
  |  |  196|  10.2k|#define xpdfKeyContextAny         0
  ------------------
 1042|  10.2k|  keyBindings->append(new KeyBinding(xpdfKeyCodePgUp, xpdfKeyModCtrl,
  ------------------
  |  |  139|  10.2k|#define xpdfKeyCodePgUp               0x1009
  ------------------
                keyBindings->append(new KeyBinding(xpdfKeyCodePgUp, xpdfKeyModCtrl,
  ------------------
  |  |  194|  10.2k|#define xpdfKeyModCtrl            (1 << 1)
  ------------------
 1043|  10.2k|				     xpdfKeyContextAny, "prevPage"));
  ------------------
  |  |  196|  10.2k|#define xpdfKeyContextAny         0
  ------------------
 1044|  10.2k|  keyBindings->append(new KeyBinding(xpdfKeyCodePgDn, xpdfKeyModCtrl,
  ------------------
  |  |  140|  10.2k|#define xpdfKeyCodePgDn               0x100a
  ------------------
                keyBindings->append(new KeyBinding(xpdfKeyCodePgDn, xpdfKeyModCtrl,
  ------------------
  |  |  194|  10.2k|#define xpdfKeyModCtrl            (1 << 1)
  ------------------
 1045|  10.2k|				     xpdfKeyContextAny, "nextPage"));
  ------------------
  |  |  196|  10.2k|#define xpdfKeyContextAny         0
  ------------------
 1046|  10.2k|  keyBindings->append(new KeyBinding(xpdfKeyCodePgUp, xpdfKeyModCtrl,
  ------------------
  |  |  139|  10.2k|#define xpdfKeyCodePgUp               0x1009
  ------------------
                keyBindings->append(new KeyBinding(xpdfKeyCodePgUp, xpdfKeyModCtrl,
  ------------------
  |  |  194|  10.2k|#define xpdfKeyModCtrl            (1 << 1)
  ------------------
 1047|  10.2k|				     xpdfKeyContextScrLockOn,
  ------------------
  |  |  205|  10.2k|#define xpdfKeyContextScrLockOn   (1 << 8)
  ------------------
 1048|  10.2k|				     "prevPageNoScroll"));
 1049|  10.2k|  keyBindings->append(new KeyBinding(xpdfKeyCodePgDn, xpdfKeyModCtrl,
  ------------------
  |  |  140|  10.2k|#define xpdfKeyCodePgDn               0x100a
  ------------------
                keyBindings->append(new KeyBinding(xpdfKeyCodePgDn, xpdfKeyModCtrl,
  ------------------
  |  |  194|  10.2k|#define xpdfKeyModCtrl            (1 << 1)
  ------------------
 1050|  10.2k|				     xpdfKeyContextScrLockOn,
  ------------------
  |  |  205|  10.2k|#define xpdfKeyContextScrLockOn   (1 << 8)
  ------------------
 1051|  10.2k|				     "nextPageNoScroll"));
 1052|       |
 1053|       |  //----- esc key
 1054|  10.2k|  keyBindings->append(new KeyBinding(xpdfKeyCodeEsc, xpdfKeyModNone,
  ------------------
  |  |  134|  10.2k|#define xpdfKeyCodeEsc                0x1004
  ------------------
                keyBindings->append(new KeyBinding(xpdfKeyCodeEsc, xpdfKeyModNone,
  ------------------
  |  |  192|  10.2k|#define xpdfKeyModNone            0
  ------------------
 1055|  10.2k|				     xpdfKeyContextFullScreen,
  ------------------
  |  |  197|  10.2k|#define xpdfKeyContextFullScreen  (1 << 0)
  ------------------
 1056|  10.2k|				     "windowMode"));
 1057|       |
 1058|       |  //----- arrow keys
 1059|  10.2k|  keyBindings->append(new KeyBinding(xpdfKeyCodeLeft, xpdfKeyModNone,
  ------------------
  |  |  141|  10.2k|#define xpdfKeyCodeLeft               0x100b
  ------------------
                keyBindings->append(new KeyBinding(xpdfKeyCodeLeft, xpdfKeyModNone,
  ------------------
  |  |  192|  10.2k|#define xpdfKeyModNone            0
  ------------------
 1060|  10.2k|				     xpdfKeyContextAny, "scrollLeft(16)"));
  ------------------
  |  |  196|  10.2k|#define xpdfKeyContextAny         0
  ------------------
 1061|  10.2k|  keyBindings->append(new KeyBinding(xpdfKeyCodeRight, xpdfKeyModNone,
  ------------------
  |  |  142|  10.2k|#define xpdfKeyCodeRight              0x100c
  ------------------
                keyBindings->append(new KeyBinding(xpdfKeyCodeRight, xpdfKeyModNone,
  ------------------
  |  |  192|  10.2k|#define xpdfKeyModNone            0
  ------------------
 1062|  10.2k|				     xpdfKeyContextAny, "scrollRight(16)"));
  ------------------
  |  |  196|  10.2k|#define xpdfKeyContextAny         0
  ------------------
 1063|  10.2k|  keyBindings->append(new KeyBinding(xpdfKeyCodeUp, xpdfKeyModNone,
  ------------------
  |  |  143|  10.2k|#define xpdfKeyCodeUp                 0x100d
  ------------------
                keyBindings->append(new KeyBinding(xpdfKeyCodeUp, xpdfKeyModNone,
  ------------------
  |  |  192|  10.2k|#define xpdfKeyModNone            0
  ------------------
 1064|  10.2k|				     xpdfKeyContextAny, "scrollUp(16)"));
  ------------------
  |  |  196|  10.2k|#define xpdfKeyContextAny         0
  ------------------
 1065|  10.2k|  keyBindings->append(new KeyBinding(xpdfKeyCodeDown, xpdfKeyModNone,
  ------------------
  |  |  144|  10.2k|#define xpdfKeyCodeDown               0x100e
  ------------------
                keyBindings->append(new KeyBinding(xpdfKeyCodeDown, xpdfKeyModNone,
  ------------------
  |  |  192|  10.2k|#define xpdfKeyModNone            0
  ------------------
 1066|  10.2k|				     xpdfKeyContextAny, "scrollDown(16)"));
  ------------------
  |  |  196|  10.2k|#define xpdfKeyContextAny         0
  ------------------
 1067|  10.2k|  keyBindings->append(new KeyBinding(xpdfKeyCodeUp, xpdfKeyModCtrl,
  ------------------
  |  |  143|  10.2k|#define xpdfKeyCodeUp                 0x100d
  ------------------
                keyBindings->append(new KeyBinding(xpdfKeyCodeUp, xpdfKeyModCtrl,
  ------------------
  |  |  194|  10.2k|#define xpdfKeyModCtrl            (1 << 1)
  ------------------
 1068|  10.2k|				     xpdfKeyContextAny, "prevPage"));
  ------------------
  |  |  196|  10.2k|#define xpdfKeyContextAny         0
  ------------------
 1069|  10.2k|  keyBindings->append(new KeyBinding(xpdfKeyCodeDown, xpdfKeyModCtrl,
  ------------------
  |  |  144|  10.2k|#define xpdfKeyCodeDown               0x100e
  ------------------
                keyBindings->append(new KeyBinding(xpdfKeyCodeDown, xpdfKeyModCtrl,
  ------------------
  |  |  194|  10.2k|#define xpdfKeyModCtrl            (1 << 1)
  ------------------
 1070|  10.2k|				     xpdfKeyContextAny, "nextPage"));
  ------------------
  |  |  196|  10.2k|#define xpdfKeyContextAny         0
  ------------------
 1071|  10.2k|  keyBindings->append(new KeyBinding(xpdfKeyCodeUp, xpdfKeyModCtrl,
  ------------------
  |  |  143|  10.2k|#define xpdfKeyCodeUp                 0x100d
  ------------------
                keyBindings->append(new KeyBinding(xpdfKeyCodeUp, xpdfKeyModCtrl,
  ------------------
  |  |  194|  10.2k|#define xpdfKeyModCtrl            (1 << 1)
  ------------------
 1072|  10.2k|				     xpdfKeyContextScrLockOn,
  ------------------
  |  |  205|  10.2k|#define xpdfKeyContextScrLockOn   (1 << 8)
  ------------------
 1073|  10.2k|				     "prevPageNoScroll"));
 1074|  10.2k|  keyBindings->append(new KeyBinding(xpdfKeyCodeDown, xpdfKeyModCtrl,
  ------------------
  |  |  144|  10.2k|#define xpdfKeyCodeDown               0x100e
  ------------------
                keyBindings->append(new KeyBinding(xpdfKeyCodeDown, xpdfKeyModCtrl,
  ------------------
  |  |  194|  10.2k|#define xpdfKeyModCtrl            (1 << 1)
  ------------------
 1075|  10.2k|				     xpdfKeyContextScrLockOn,
  ------------------
  |  |  205|  10.2k|#define xpdfKeyContextScrLockOn   (1 << 8)
  ------------------
 1076|  10.2k|				     "nextPageNoScroll"));
 1077|       |
 1078|       |  //----- letter keys
 1079|  10.2k|  keyBindings->append(new KeyBinding(' ', xpdfKeyModNone,
  ------------------
  |  |  192|  10.2k|#define xpdfKeyModNone            0
  ------------------
 1080|  10.2k|				     xpdfKeyContextAny, "pageDown"));
  ------------------
  |  |  196|  10.2k|#define xpdfKeyContextAny         0
  ------------------
 1081|  10.2k|  keyBindings->append(new KeyBinding('g', xpdfKeyModNone,
  ------------------
  |  |  192|  10.2k|#define xpdfKeyModNone            0
  ------------------
 1082|  10.2k|				     xpdfKeyContextAny, "focusToPageNum"));
  ------------------
  |  |  196|  10.2k|#define xpdfKeyContextAny         0
  ------------------
 1083|  10.2k|  keyBindings->append(new KeyBinding('z', xpdfKeyModNone,
  ------------------
  |  |  192|  10.2k|#define xpdfKeyModNone            0
  ------------------
 1084|  10.2k|				     xpdfKeyContextAny, "zoomFitPage"));
  ------------------
  |  |  196|  10.2k|#define xpdfKeyContextAny         0
  ------------------
 1085|  10.2k|  keyBindings->append(new KeyBinding('w', xpdfKeyModNone,
  ------------------
  |  |  192|  10.2k|#define xpdfKeyModNone            0
  ------------------
 1086|  10.2k|				     xpdfKeyContextAny, "zoomFitWidth"));
  ------------------
  |  |  196|  10.2k|#define xpdfKeyContextAny         0
  ------------------
 1087|  10.2k|}
_ZN12GlobalParams18initStateFilePathsEv:
 1089|  10.2k|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|  10.2k|  char *path = getenv("XDG_STATE_HOME");
 1105|  10.2k|  GString *stateDir;
 1106|  10.2k|  if (path) {
  ------------------
  |  Branch (1106:7): [True: 0, False: 10.2k]
  ------------------
 1107|      0|    stateDir = new GString(path);
 1108|  10.2k|  } else {
 1109|  10.2k|    stateDir = appendToPath(getHomeDir(), ".local/state");
 1110|  10.2k|  }
 1111|  10.2k|  createDir(stateDir->getCString(), 0700);
 1112|  10.2k|  appendToPath(stateDir, "xpdf");
 1113|  10.2k|  createDir(stateDir->getCString(), 0700);
 1114|  10.2k|  pagesFile = appendToPath(stateDir->copy(), "pages");
 1115|  10.2k|  tabStateFile = appendToPath(stateDir->copy(), "tab-state");
 1116|  10.2k|  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|  10.2k|}
_ZN12GlobalParams14openConfigFileEPKcPP7GString:
 1128|  10.2k|				   GString **fileName) {
 1129|  10.2k|  FILE *f = NULL;
 1130|  10.2k|  GString *actualName = NULL;
 1131|       |
 1132|       |  //--- try the path specified on the command line
 1133|  10.2k|  if (cfgFileName && cfgFileName[0]) {
  ------------------
  |  Branch (1133:7): [True: 0, False: 10.2k]
  |  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|  10.2k|#if USE_XDG
 1142|  10.2k|  if (!f) {
  ------------------
  |  Branch (1142:7): [True: 10.2k, False: 0]
  ------------------
 1143|  10.2k|    char *path = getenv("XDG_CONFIG_HOME");
 1144|  10.2k|    if (path) {
  ------------------
  |  Branch (1144:9): [True: 0, False: 10.2k]
  ------------------
 1145|      0|      actualName = new GString(path);
 1146|  10.2k|    } else {
 1147|  10.2k|      actualName = appendToPath(getHomeDir(), ".config");
 1148|  10.2k|    }
 1149|  10.2k|    appendToPath(actualName, "xpdf/xpdfrc");
 1150|  10.2k|    if (!(f = fopen(actualName->getCString(), "r"))) {
  ------------------
  |  Branch (1150:9): [True: 10.2k, False: 0]
  ------------------
 1151|  10.2k|      delete actualName;
 1152|  10.2k|    }
 1153|  10.2k|  }
 1154|  10.2k|#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|  10.2k|  if (!f) {
  ------------------
  |  Branch (1171:7): [True: 10.2k, False: 0]
  ------------------
 1172|  10.2k|    actualName = appendToPath(getHomeDir(), ".xpdfrc");
 1173|  10.2k|    if (!(f = fopen(actualName->getCString(), "r"))) {
  ------------------
  |  Branch (1173:9): [True: 10.2k, False: 0]
  ------------------
 1174|  10.2k|      delete actualName;
 1175|  10.2k|    }
 1176|  10.2k|  }
 1177|  10.2k|#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|  10.2k|  if (!f) {
  ------------------
  |  Branch (1197:7): [True: 10.2k, False: 0]
  ------------------
 1198|  10.2k|    actualName = new GString(xpdfSysConfigFile);
  ------------------
  |  |   58|  10.2k|#define xpdfSysConfigFile "/etc/xpdfrc"
  ------------------
 1199|  10.2k|    if (!(f = fopen(actualName->getCString(), "r"))) {
  ------------------
  |  Branch (1199:9): [True: 10.2k, False: 0]
  ------------------
 1200|  10.2k|      delete actualName;
 1201|  10.2k|    }
 1202|  10.2k|  }
 1203|  10.2k|#endif
 1204|       |
 1205|  10.2k|  if (f) {
  ------------------
  |  Branch (1205:7): [True: 0, False: 10.2k]
  ------------------
 1206|      0|    *fileName = actualName;
 1207|  10.2k|  } else {
 1208|       |    *fileName = NULL;
 1209|  10.2k|  }
 1210|  10.2k|  return f;
 1211|  10.2k|}
_ZN12GlobalParams11parseYesNo2EPcPi:
 2264|  10.2k|GBool GlobalParams::parseYesNo2(char *token, GBool *flag) {
 2265|  10.2k|  if (!strcmp(token, "yes")) {
  ------------------
  |  Branch (2265:7): [True: 10.2k, False: 0]
  ------------------
 2266|  10.2k|    *flag = gTrue;
  ------------------
  |  |   17|  10.2k|#define gTrue 1
  ------------------
 2267|  10.2k|  } 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|  10.2k|  return gTrue;
  ------------------
  |  |   17|  10.2k|#define gTrue 1
  ------------------
 2273|  10.2k|}
_ZN12GlobalParamsD2Ev:
 2351|  10.2k|GlobalParams::~GlobalParams() {
 2352|  10.2k|  GHashIter *iter;
 2353|  10.2k|  GString *key;
 2354|  10.2k|  GList *list;
 2355|       |
 2356|  10.2k|  freeBuiltinFontTables();
 2357|       |
 2358|  10.2k|  delete macRomanReverseMap;
 2359|       |
 2360|  10.2k|  delete baseDir;
 2361|  10.2k|  deleteGHash(configFileVars, GString);
  ------------------
  |  |   60|  10.2k|  do {                                             \
  |  |   61|  10.2k|    GHash *_hash = (hash);                         \
  |  |   62|  10.2k|    {                                              \
  |  |   63|  10.2k|      GHashIter *_iter;                            \
  |  |   64|  10.2k|      GString *_key;                               \
  |  |   65|  10.2k|      void *_p;                                    \
  |  |   66|  10.2k|      _hash->startIter(&_iter);                    \
  |  |   67|  20.4k|      while (_hash->getNext(&_iter, &_key, &_p)) { \
  |  |  ------------------
  |  |  |  Branch (67:14): [True: 10.2k, False: 10.2k]
  |  |  ------------------
  |  |   68|  10.2k|        delete (T*)_p;                             \
  |  |   69|  10.2k|      }                                            \
  |  |   70|  10.2k|      delete _hash;                                \
  |  |   71|  10.2k|    }                                              \
  |  |   72|  10.2k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (72:11): [Folded, False: 10.2k]
  |  |  ------------------
  ------------------
 2362|  10.2k|  delete nameToUnicode;
 2363|  10.2k|  deleteGHash(cidToUnicodes, GString);
  ------------------
  |  |   60|  10.2k|  do {                                             \
  |  |   61|  10.2k|    GHash *_hash = (hash);                         \
  |  |   62|  10.2k|    {                                              \
  |  |   63|  10.2k|      GHashIter *_iter;                            \
  |  |   64|  10.2k|      GString *_key;                               \
  |  |   65|  10.2k|      void *_p;                                    \
  |  |   66|  10.2k|      _hash->startIter(&_iter);                    \
  |  |   67|  10.2k|      while (_hash->getNext(&_iter, &_key, &_p)) { \
  |  |  ------------------
  |  |  |  Branch (67:14): [True: 0, False: 10.2k]
  |  |  ------------------
  |  |   68|      0|        delete (T*)_p;                             \
  |  |   69|      0|      }                                            \
  |  |   70|  10.2k|      delete _hash;                                \
  |  |   71|  10.2k|    }                                              \
  |  |   72|  10.2k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (72:11): [Folded, False: 10.2k]
  |  |  ------------------
  ------------------
 2364|  10.2k|  deleteGHash(unicodeToUnicodes, GString);
  ------------------
  |  |   60|  10.2k|  do {                                             \
  |  |   61|  10.2k|    GHash *_hash = (hash);                         \
  |  |   62|  10.2k|    {                                              \
  |  |   63|  10.2k|      GHashIter *_iter;                            \
  |  |   64|  10.2k|      GString *_key;                               \
  |  |   65|  10.2k|      void *_p;                                    \
  |  |   66|  10.2k|      _hash->startIter(&_iter);                    \
  |  |   67|  10.2k|      while (_hash->getNext(&_iter, &_key, &_p)) { \
  |  |  ------------------
  |  |  |  Branch (67:14): [True: 0, False: 10.2k]
  |  |  ------------------
  |  |   68|      0|        delete (T*)_p;                             \
  |  |   69|      0|      }                                            \
  |  |   70|  10.2k|      delete _hash;                                \
  |  |   71|  10.2k|    }                                              \
  |  |   72|  10.2k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (72:11): [Folded, False: 10.2k]
  |  |  ------------------
  ------------------
 2365|  10.2k|  deleteGHash(residentUnicodeMaps, UnicodeMap);
  ------------------
  |  |   60|  10.2k|  do {                                             \
  |  |   61|  10.2k|    GHash *_hash = (hash);                         \
  |  |   62|  10.2k|    {                                              \
  |  |   63|  10.2k|      GHashIter *_iter;                            \
  |  |   64|  10.2k|      GString *_key;                               \
  |  |   65|  10.2k|      void *_p;                                    \
  |  |   66|  10.2k|      _hash->startIter(&_iter);                    \
  |  |   67|  71.4k|      while (_hash->getNext(&_iter, &_key, &_p)) { \
  |  |  ------------------
  |  |  |  Branch (67:14): [True: 61.2k, False: 10.2k]
  |  |  ------------------
  |  |   68|  61.2k|        delete (T*)_p;                             \
  |  |   69|  61.2k|      }                                            \
  |  |   70|  10.2k|      delete _hash;                                \
  |  |   71|  10.2k|    }                                              \
  |  |   72|  10.2k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (72:11): [Folded, False: 10.2k]
  |  |  ------------------
  ------------------
 2366|  10.2k|  deleteGHash(unicodeMaps, GString);
  ------------------
  |  |   60|  10.2k|  do {                                             \
  |  |   61|  10.2k|    GHash *_hash = (hash);                         \
  |  |   62|  10.2k|    {                                              \
  |  |   63|  10.2k|      GHashIter *_iter;                            \
  |  |   64|  10.2k|      GString *_key;                               \
  |  |   65|  10.2k|      void *_p;                                    \
  |  |   66|  10.2k|      _hash->startIter(&_iter);                    \
  |  |   67|  10.2k|      while (_hash->getNext(&_iter, &_key, &_p)) { \
  |  |  ------------------
  |  |  |  Branch (67:14): [True: 0, False: 10.2k]
  |  |  ------------------
  |  |   68|      0|        delete (T*)_p;                             \
  |  |   69|      0|      }                                            \
  |  |   70|  10.2k|      delete _hash;                                \
  |  |   71|  10.2k|    }                                              \
  |  |   72|  10.2k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (72:11): [Folded, False: 10.2k]
  |  |  ------------------
  ------------------
 2367|  10.2k|  deleteGList(toUnicodeDirs, GString);
  ------------------
  |  |   94|  10.2k|  do {                                              \
  |  |   95|  10.2k|    GList *_list = (list);                          \
  |  |   96|  10.2k|    {                                               \
  |  |   97|  10.2k|      int _i;                                       \
  |  |   98|  10.2k|      for (_i = 0; _i < _list->getLength(); ++_i) { \
  |  |  ------------------
  |  |  |  Branch (98:20): [True: 0, False: 10.2k]
  |  |  ------------------
  |  |   99|      0|        delete (T*)_list->get(_i);                  \
  |  |  100|      0|      }                                             \
  |  |  101|  10.2k|      delete _list;                                 \
  |  |  102|  10.2k|    }                                               \
  |  |  103|  10.2k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (103:12): [Folded, False: 10.2k]
  |  |  ------------------
  ------------------
 2368|  10.2k|  delete unicodeRemapping;
 2369|  10.2k|  deleteGHash(fontFiles, GString);
  ------------------
  |  |   60|  10.2k|  do {                                             \
  |  |   61|  10.2k|    GHash *_hash = (hash);                         \
  |  |   62|  10.2k|    {                                              \
  |  |   63|  10.2k|      GHashIter *_iter;                            \
  |  |   64|  10.2k|      GString *_key;                               \
  |  |   65|  10.2k|      void *_p;                                    \
  |  |   66|  10.2k|      _hash->startIter(&_iter);                    \
  |  |   67|  10.2k|      while (_hash->getNext(&_iter, &_key, &_p)) { \
  |  |  ------------------
  |  |  |  Branch (67:14): [True: 0, False: 10.2k]
  |  |  ------------------
  |  |   68|      0|        delete (T*)_p;                             \
  |  |   69|      0|      }                                            \
  |  |   70|  10.2k|      delete _hash;                                \
  |  |   71|  10.2k|    }                                              \
  |  |   72|  10.2k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (72:11): [Folded, False: 10.2k]
  |  |  ------------------
  ------------------
 2370|  10.2k|  deleteGList(fontDirs, GString);
  ------------------
  |  |   94|  10.2k|  do {                                              \
  |  |   95|  10.2k|    GList *_list = (list);                          \
  |  |   96|  10.2k|    {                                               \
  |  |   97|  10.2k|      int _i;                                       \
  |  |   98|  10.2k|      for (_i = 0; _i < _list->getLength(); ++_i) { \
  |  |  ------------------
  |  |  |  Branch (98:20): [True: 0, False: 10.2k]
  |  |  ------------------
  |  |   99|      0|        delete (T*)_list->get(_i);                  \
  |  |  100|      0|      }                                             \
  |  |  101|  10.2k|      delete _list;                                 \
  |  |  102|  10.2k|    }                                               \
  |  |  103|  10.2k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (103:12): [Folded, False: 10.2k]
  |  |  ------------------
  ------------------
 2371|  10.2k|  deleteGHash(ccFontFiles, GString);
  ------------------
  |  |   60|  10.2k|  do {                                             \
  |  |   61|  10.2k|    GHash *_hash = (hash);                         \
  |  |   62|  10.2k|    {                                              \
  |  |   63|  10.2k|      GHashIter *_iter;                            \
  |  |   64|  10.2k|      GString *_key;                               \
  |  |   65|  10.2k|      void *_p;                                    \
  |  |   66|  10.2k|      _hash->startIter(&_iter);                    \
  |  |   67|  10.2k|      while (_hash->getNext(&_iter, &_key, &_p)) { \
  |  |  ------------------
  |  |  |  Branch (67:14): [True: 0, False: 10.2k]
  |  |  ------------------
  |  |   68|      0|        delete (T*)_p;                             \
  |  |   69|      0|      }                                            \
  |  |   70|  10.2k|      delete _hash;                                \
  |  |   71|  10.2k|    }                                              \
  |  |   72|  10.2k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (72:11): [Folded, False: 10.2k]
  |  |  ------------------
  ------------------
 2372|  10.2k|  deleteGHash(base14SysFonts, Base14FontInfo);
  ------------------
  |  |   60|  10.2k|  do {                                             \
  |  |   61|  10.2k|    GHash *_hash = (hash);                         \
  |  |   62|  10.2k|    {                                              \
  |  |   63|  10.2k|      GHashIter *_iter;                            \
  |  |   64|  10.2k|      GString *_key;                               \
  |  |   65|  10.2k|      void *_p;                                    \
  |  |   66|  10.2k|      _hash->startIter(&_iter);                    \
  |  |   67|  10.2k|      while (_hash->getNext(&_iter, &_key, &_p)) { \
  |  |  ------------------
  |  |  |  Branch (67:14): [True: 0, False: 10.2k]
  |  |  ------------------
  |  |   68|      0|        delete (T*)_p;                             \
  |  |   69|      0|      }                                            \
  |  |   70|  10.2k|      delete _hash;                                \
  |  |   71|  10.2k|    }                                              \
  |  |   72|  10.2k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (72:11): [Folded, False: 10.2k]
  |  |  ------------------
  ------------------
 2373|  10.2k|  delete sysFonts;
 2374|  10.2k|  deleteGHash(psResidentFonts, GString);
  ------------------
  |  |   60|  10.2k|  do {                                             \
  |  |   61|  10.2k|    GHash *_hash = (hash);                         \
  |  |   62|  10.2k|    {                                              \
  |  |   63|  10.2k|      GHashIter *_iter;                            \
  |  |   64|  10.2k|      GString *_key;                               \
  |  |   65|  10.2k|      void *_p;                                    \
  |  |   66|  10.2k|      _hash->startIter(&_iter);                    \
  |  |   67|  10.2k|      while (_hash->getNext(&_iter, &_key, &_p)) { \
  |  |  ------------------
  |  |  |  Branch (67:14): [True: 0, False: 10.2k]
  |  |  ------------------
  |  |   68|      0|        delete (T*)_p;                             \
  |  |   69|      0|      }                                            \
  |  |   70|  10.2k|      delete _hash;                                \
  |  |   71|  10.2k|    }                                              \
  |  |   72|  10.2k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (72:11): [Folded, False: 10.2k]
  |  |  ------------------
  ------------------
 2375|  10.2k|  deleteGList(psResidentFonts16, PSFontParam16);
  ------------------
  |  |   94|  10.2k|  do {                                              \
  |  |   95|  10.2k|    GList *_list = (list);                          \
  |  |   96|  10.2k|    {                                               \
  |  |   97|  10.2k|      int _i;                                       \
  |  |   98|  10.2k|      for (_i = 0; _i < _list->getLength(); ++_i) { \
  |  |  ------------------
  |  |  |  Branch (98:20): [True: 0, False: 10.2k]
  |  |  ------------------
  |  |   99|      0|        delete (T*)_list->get(_i);                  \
  |  |  100|      0|      }                                             \
  |  |  101|  10.2k|      delete _list;                                 \
  |  |  102|  10.2k|    }                                               \
  |  |  103|  10.2k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (103:12): [Folded, False: 10.2k]
  |  |  ------------------
  ------------------
 2376|  10.2k|  deleteGList(psResidentFontsCC, PSFontParam16);
  ------------------
  |  |   94|  10.2k|  do {                                              \
  |  |   95|  10.2k|    GList *_list = (list);                          \
  |  |   96|  10.2k|    {                                               \
  |  |   97|  10.2k|      int _i;                                       \
  |  |   98|  10.2k|      for (_i = 0; _i < _list->getLength(); ++_i) { \
  |  |  ------------------
  |  |  |  Branch (98:20): [True: 0, False: 10.2k]
  |  |  ------------------
  |  |   99|      0|        delete (T*)_list->get(_i);                  \
  |  |  100|      0|      }                                             \
  |  |  101|  10.2k|      delete _list;                                 \
  |  |  102|  10.2k|    }                                               \
  |  |  103|  10.2k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (103:12): [Folded, False: 10.2k]
  |  |  ------------------
  ------------------
 2377|  10.2k|  delete textEncoding;
 2378|  10.2k|  delete initialZoom;
 2379|  10.2k|  deleteGList(zoomValues, GString);
  ------------------
  |  |   94|  10.2k|  do {                                              \
  |  |   95|  10.2k|    GList *_list = (list);                          \
  |  |   96|  10.2k|    {                                               \
  |  |   97|  10.2k|      int _i;                                       \
  |  |   98|   142k|      for (_i = 0; _i < _list->getLength(); ++_i) { \
  |  |  ------------------
  |  |  |  Branch (98:20): [True: 132k, False: 10.2k]
  |  |  ------------------
  |  |   99|   132k|        delete (T*)_list->get(_i);                  \
  |  |  100|   132k|      }                                             \
  |  |  101|  10.2k|      delete _list;                                 \
  |  |  102|  10.2k|    }                                               \
  |  |  103|  10.2k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (103:12): [Folded, False: 10.2k]
  |  |  ------------------
  ------------------
 2380|  10.2k|  delete initialDisplayMode;
 2381|  10.2k|  delete initialSelectMode;
 2382|  10.2k|  if (paperColor) {
  ------------------
  |  Branch (2382:7): [True: 10.2k, False: 0]
  ------------------
 2383|  10.2k|    delete paperColor;
 2384|  10.2k|  }
 2385|  10.2k|  if (matteColor) {
  ------------------
  |  Branch (2385:7): [True: 10.2k, False: 0]
  ------------------
 2386|  10.2k|    delete matteColor;
 2387|  10.2k|  }
 2388|  10.2k|  if (fullScreenMatteColor) {
  ------------------
  |  Branch (2388:7): [True: 10.2k, False: 0]
  ------------------
 2389|  10.2k|    delete fullScreenMatteColor;
 2390|  10.2k|  }
 2391|  10.2k|  if (selectionColor) {
  ------------------
  |  Branch (2391:7): [True: 10.2k, False: 0]
  ------------------
 2392|  10.2k|    delete selectionColor;
 2393|  10.2k|  }
 2394|  10.2k|  if (launchCommand) {
  ------------------
  |  Branch (2394:7): [True: 0, False: 10.2k]
  ------------------
 2395|      0|    delete launchCommand;
 2396|      0|  }
 2397|  10.2k|  if (movieCommand) {
  ------------------
  |  Branch (2397:7): [True: 0, False: 10.2k]
  ------------------
 2398|      0|    delete movieCommand;
 2399|      0|  }
 2400|  10.2k|  if (defaultPrinter) {
  ------------------
  |  Branch (2400:7): [True: 0, False: 10.2k]
  ------------------
 2401|      0|    delete defaultPrinter;
 2402|      0|  }
 2403|  10.2k|  delete droppedFonts;
 2404|  10.2k|  deleteGList(keyBindings, KeyBinding);
  ------------------
  |  |   94|  10.2k|  do {                                              \
  |  |   95|  10.2k|    GList *_list = (list);                          \
  |  |   96|  10.2k|    {                                               \
  |  |   97|  10.2k|      int _i;                                       \
  |  |   98|   632k|      for (_i = 0; _i < _list->getLength(); ++_i) { \
  |  |  ------------------
  |  |  |  Branch (98:20): [True: 622k, False: 10.2k]
  |  |  ------------------
  |  |   99|   622k|        delete (T*)_list->get(_i);                  \
  |  |  100|   622k|      }                                             \
  |  |  101|  10.2k|      delete _list;                                 \
  |  |  102|  10.2k|    }                                               \
  |  |  103|  10.2k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (103:12): [Folded, False: 10.2k]
  |  |  ------------------
  ------------------
 2405|  10.2k|  deleteGList(popupMenuCmds, PopupMenuCmd);
  ------------------
  |  |   94|  10.2k|  do {                                              \
  |  |   95|  10.2k|    GList *_list = (list);                          \
  |  |   96|  10.2k|    {                                               \
  |  |   97|  10.2k|      int _i;                                       \
  |  |   98|  10.2k|      for (_i = 0; _i < _list->getLength(); ++_i) { \
  |  |  ------------------
  |  |  |  Branch (98:20): [True: 0, False: 10.2k]
  |  |  ------------------
  |  |   99|      0|        delete (T*)_list->get(_i);                  \
  |  |  100|      0|      }                                             \
  |  |  101|  10.2k|      delete _list;                                 \
  |  |  102|  10.2k|    }                                               \
  |  |  103|  10.2k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (103:12): [Folded, False: 10.2k]
  |  |  ------------------
  ------------------
 2406|  10.2k|  delete pagesFile;
 2407|  10.2k|  delete tabStateFile;
 2408|  10.2k|  delete sessionFile;
 2409|  10.2k|  delete debugLogFile;
 2410|       |
 2411|  10.2k|  cMapDirs->startIter(&iter);
 2412|  10.2k|  while (cMapDirs->getNext(&iter, &key, (void **)&list)) {
  ------------------
  |  Branch (2412:10): [True: 0, False: 10.2k]
  ------------------
 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|  10.2k|  delete cMapDirs;
 2416|       |
 2417|  10.2k|  delete cidToUnicodeCache;
 2418|  10.2k|  delete unicodeToUnicodeCache;
 2419|  10.2k|  delete unicodeMapCache;
 2420|  10.2k|  delete cMapCache;
 2421|       |
 2422|  10.2k|#if MULTITHREADED
 2423|  10.2k|  gDestroyMutex(&mutex);
  ------------------
  |  |   52|  10.2k|#define gDestroyMutex(m) pthread_mutex_destroy(m)
  ------------------
 2424|  10.2k|  gDestroyMutex(&unicodeMapCacheMutex);
  ------------------
  |  |   52|  10.2k|#define gDestroyMutex(m) pthread_mutex_destroy(m)
  ------------------
 2425|  10.2k|  gDestroyMutex(&cMapCacheMutex);
  ------------------
  |  |   52|  10.2k|#define gDestroyMutex(m) pthread_mutex_destroy(m)
  ------------------
 2426|  10.2k|#endif
 2427|  10.2k|}
_ZN12GlobalParams14setupBaseFontsEPKc:
 2519|  10.2k|void GlobalParams::setupBaseFonts(const char *dir) {
 2520|  10.2k|  GString *fontName;
 2521|  10.2k|  GString *fileName;
 2522|  10.2k|  int fontNum;
 2523|  10.2k|  const char *s;
 2524|  10.2k|  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|  10.2k|  FILE *f;
 2539|  10.2k|  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|   153k|  for (i = 0; displayFontTab[i].name; ++i) {
  ------------------
  |  Branch (2555:15): [True: 142k, False: 10.2k]
  ------------------
 2556|   142k|    if (fontFiles->lookup(displayFontTab[i].name)) {
  ------------------
  |  Branch (2556:9): [True: 0, False: 142k]
  ------------------
 2557|      0|      continue;
 2558|      0|    }
 2559|   142k|    fontName = new GString(displayFontTab[i].name);
 2560|   142k|    fileName = NULL;
 2561|   142k|    fontNum = 0;
 2562|   142k|    if (dir) {
  ------------------
  |  Branch (2562:9): [True: 0, False: 142k]
  ------------------
 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|   142k|    s = displayFontTab[i].t1FileName;
 2649|   142k|#endif
 2650|   142k|    if (!fileName && s) {
  ------------------
  |  Branch (2650:9): [True: 142k, False: 0]
  |  Branch (2650:22): [True: 142k, False: 0]
  ------------------
 2651|   857k|      for (j = 0; !fileName && displayFontDirs[j]; ++j) {
  ------------------
  |  Branch (2651:19): [True: 857k, False: 0]
  |  Branch (2651:32): [True: 714k, False: 142k]
  ------------------
 2652|   714k|	fileName = appendToPath(new GString(displayFontDirs[j]), s);
 2653|   714k|	if ((f = fopen(fileName->getCString(), "rb"))) {
  ------------------
  |  Branch (2653:6): [True: 0, False: 714k]
  ------------------
 2654|      0|	  fclose(f);
 2655|   714k|	} else {
 2656|   714k|	  delete fileName;
 2657|   714k|	  fileName = NULL;
 2658|   714k|	}
 2659|   714k|      }
 2660|   142k|    }
 2661|   142k|    if (!fileName) {
  ------------------
  |  Branch (2661:9): [True: 142k, False: 0]
  ------------------
 2662|   142k|      delete fontName;
 2663|   142k|      continue;
 2664|   142k|    }
 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|   153k|  for (i = 0; displayFontTab[i].name; ++i) {
  ------------------
  |  Branch (2672:15): [True: 142k, False: 10.2k]
  ------------------
 2673|   142k|    if (!base14SysFonts->lookup(displayFontTab[i].name) &&
  ------------------
  |  Branch (2673:9): [True: 142k, False: 0]
  ------------------
 2674|   142k|	!fontFiles->lookup(displayFontTab[i].name)) {
  ------------------
  |  Branch (2674:2): [True: 142k, False: 0]
  ------------------
 2675|   142k|      if (displayFontTab[i].obliqueFont &&
  ------------------
  |  Branch (2675:11): [True: 40.8k, False: 102k]
  ------------------
 2676|  40.8k|	  ((base14 = (Base14FontInfo *)base14SysFonts
  ------------------
  |  Branch (2676:4): [True: 0, False: 40.8k]
  ------------------
 2677|  40.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|   142k|      } else {
 2684|   142k|	error(errConfig, -1, "No display font for '{0:s}'",
 2685|   142k|	      displayFontTab[i].name);
 2686|   142k|      }
 2687|   142k|    }
 2688|   142k|  }
 2689|  10.2k|}
_ZN12GlobalParams12getEnableXFAEv:
 3505|  1.31k|GBool GlobalParams::getEnableXFA() {
 3506|  1.31k|  GBool xfa;
 3507|       |
 3508|  1.31k|  lockGlobalParams;
  ------------------
  |  |   50|  1.31k|#  define lockGlobalParams            gLockMutex(&mutex)
  |  |  ------------------
  |  |  |  |   53|  1.31k|#define gLockMutex(m) pthread_mutex_lock(m)
  |  |  ------------------
  ------------------
 3509|  1.31k|  xfa = enableXFA;
 3510|  1.31k|  unlockGlobalParams;
  ------------------
  |  |   53|  1.31k|#  define unlockGlobalParams          gUnlockMutex(&mutex)
  |  |  ------------------
  |  |  |  |   54|  1.31k|#define gUnlockMutex(m) pthread_mutex_unlock(m)
  |  |  ------------------
  ------------------
 3511|  1.31k|  return xfa;
 3512|  1.31k|}
_ZN12GlobalParams11getErrQuietEv:
 3775|  57.5M|GBool GlobalParams::getErrQuiet() {
 3776|       |  // no locking -- this function may get called from inside a locked
 3777|       |  // section
 3778|  57.5M|  return errQuiet;
 3779|  57.5M|}
_ZN12GlobalParams17setEnableFreeTypeEPc:
 4101|  10.2k|GBool GlobalParams::setEnableFreeType(char *s) {
 4102|  10.2k|  GBool ok;
 4103|       |
 4104|  10.2k|  lockGlobalParams;
  ------------------
  |  |   50|  10.2k|#  define lockGlobalParams            gLockMutex(&mutex)
  |  |  ------------------
  |  |  |  |   53|  10.2k|#define gLockMutex(m) pthread_mutex_lock(m)
  |  |  ------------------
  ------------------
 4105|  10.2k|  ok = parseYesNo2(s, &enableFreeType);
 4106|  10.2k|  unlockGlobalParams;
  ------------------
  |  |   53|  10.2k|#  define unlockGlobalParams          gUnlockMutex(&mutex)
  |  |  ------------------
  |  |  |  |   54|  10.2k|#define gUnlockMutex(m) pthread_mutex_unlock(m)
  |  |  ------------------
  ------------------
 4107|  10.2k|  return ok;
 4108|  10.2k|}
_ZN12GlobalParams11setErrQuietEi:
 4223|  20.4k|void GlobalParams::setErrQuiet(GBool errQuietA) {
 4224|  20.4k|  lockGlobalParams;
  ------------------
  |  |   50|  20.4k|#  define lockGlobalParams            gLockMutex(&mutex)
  |  |  ------------------
  |  |  |  |   53|  20.4k|#define gLockMutex(m) pthread_mutex_lock(m)
  |  |  ------------------
  ------------------
 4225|  20.4k|  errQuiet = errQuietA;
 4226|  20.4k|  unlockGlobalParams;
  ------------------
  |  |   53|  20.4k|#  define unlockGlobalParams          gUnlockMutex(&mutex)
  |  |  ------------------
  |  |  |  |   54|  20.4k|#define gUnlockMutex(m) pthread_mutex_unlock(m)
  |  |  ------------------
  ------------------
 4227|  20.4k|}

_ZN23JArithmeticDecoderStatsC2Ei:
   20|  4.37M|JArithmeticDecoderStats::JArithmeticDecoderStats(int contextSizeA) {
   21|  4.37M|  contextSize = contextSizeA;
   22|  4.37M|  cxTab = (Guchar *)gmallocn(contextSize, sizeof(Guchar));
   23|  4.37M|  reset();
   24|  4.37M|}
_ZN23JArithmeticDecoderStatsD2Ev:
   26|  4.35M|JArithmeticDecoderStats::~JArithmeticDecoderStats() {
   27|  4.35M|  gfree(cxTab);
   28|  4.35M|}
_ZN23JArithmeticDecoderStats4copyEv:
   30|  3.69k|JArithmeticDecoderStats *JArithmeticDecoderStats::copy() {
   31|  3.69k|  JArithmeticDecoderStats *stats;
   32|       |
   33|  3.69k|  stats = new JArithmeticDecoderStats(contextSize);
   34|  3.69k|  memcpy(stats->cxTab, cxTab, contextSize);
   35|  3.69k|  return stats;
   36|  3.69k|}
_ZN23JArithmeticDecoderStats5resetEv:
   38|  5.24M|void JArithmeticDecoderStats::reset() {
   39|  5.24M|  memset(cxTab, 0, contextSize);
   40|  5.24M|}
_ZN23JArithmeticDecoderStats8setEntryEjii:
   46|  3.30M|void JArithmeticDecoderStats::setEntry(Guint cx, int i, int mps) {
   47|  3.30M|  cxTab[cx] = (Guchar)((i << 1) + mps);
   48|  3.30M|}
_ZN18JArithmeticDecoderC2Ev:
   87|   571k|JArithmeticDecoder::JArithmeticDecoder() {
   88|   571k|  str = NULL;
   89|   571k|  dataLen = 0;
   90|   571k|  limitStream = gFalse;
  ------------------
  |  |   18|   571k|#define gFalse 0
  ------------------
   91|   571k|  nBytesRead = 0;
   92|   571k|  readBufNext = 0;
   93|   571k|  readBufLength = 0;
   94|   571k|}
_ZN18JArithmeticDecoderD2Ev:
  110|   570k|JArithmeticDecoder::~JArithmeticDecoder() {
  111|   570k|  cleanup();
  112|   570k|}
_ZN18JArithmeticDecoder5startEv:
  114|   756k|void JArithmeticDecoder::start() {
  115|   756k|  buf0 = readByte();
  116|   756k|  buf1 = readByte();
  117|       |
  118|       |  // INITDEC
  119|   756k|  c = (buf0 ^ 0xff) << 16;
  120|   756k|  byteIn();
  121|   756k|  c <<= 7;
  122|   756k|  ct -= 7;
  123|   756k|  a = 0x80000000;
  124|   756k|}
_ZN18JArithmeticDecoder7restartEi:
  126|  23.0k|void JArithmeticDecoder::restart(int dataLenA) {
  127|  23.0k|  Guint cAdd;
  128|  23.0k|  GBool prevFF;
  129|  23.0k|  int k, nBits;
  130|       |
  131|  23.0k|  if (dataLen >= 0) {
  ------------------
  |  Branch (131:7): [True: 15.2k, False: 7.79k]
  ------------------
  132|  15.2k|    dataLen = dataLenA;
  133|  15.2k|  } else if (dataLen == -1) {
  ------------------
  |  Branch (133:14): [True: 1.32k, False: 6.47k]
  ------------------
  134|  1.32k|    dataLen = dataLenA;
  135|  1.32k|    buf1 = readByte();
  136|  6.47k|  } else {
  137|  6.47k|    k = (-dataLen - 1) * 8 - ct;
  138|  6.47k|    dataLen = dataLenA;
  139|  6.47k|    cAdd = 0;
  140|  6.47k|    prevFF = gFalse;
  ------------------
  |  |   18|  6.47k|#define gFalse 0
  ------------------
  141|   476k|    while (k > 0) {
  ------------------
  |  Branch (141:12): [True: 469k, False: 6.47k]
  ------------------
  142|   469k|      buf0 = readByte();
  143|   469k|      if (prevFF) {
  ------------------
  |  Branch (143:11): [True: 382k, False: 87.0k]
  ------------------
  144|   382k|	cAdd += 0xfe00 - (buf0 << 9);
  145|   382k|	nBits = 7;
  146|   382k|      } else {
  147|  87.0k|	cAdd += 0xff00 - (buf0 << 8);
  148|  87.0k|	nBits = 8;
  149|  87.0k|      }
  150|   469k|      prevFF = buf0 == 0xff;
  151|   469k|      if (k > nBits) {
  ------------------
  |  Branch (151:11): [True: 463k, False: 6.47k]
  ------------------
  152|   463k|	cAdd <<= nBits;
  153|   463k|	k -= nBits;
  154|   463k|      } else {
  155|  6.47k|	cAdd <<= k;
  156|  6.47k|	ct = nBits - k;
  157|  6.47k|	k = 0;
  158|  6.47k|      }
  159|   469k|    }
  160|  6.47k|    c += cAdd;
  161|  6.47k|    buf1 = readByte();
  162|  6.47k|  }
  163|  23.0k|}
_ZN18JArithmeticDecoder7cleanupEv:
  165|  1.54M|void JArithmeticDecoder::cleanup() {
  166|  1.54M|  if (limitStream) {
  ------------------
  |  Branch (166:7): [True: 1.29M, False: 251k]
  ------------------
  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.29M|    readBufLength = 0;
  175|  4.85G|    while (dataLen > 0) {
  ------------------
  |  Branch (175:12): [True: 4.85G, False: 1.29M]
  ------------------
  176|  4.85G|      if (readBufLength < (int)sizeof(readBuf)) {
  ------------------
  |  Branch (176:11): [True: 6.79M, False: 4.84G]
  ------------------
  177|  6.79M|	readBuf[readBufLength++] = (Guchar)str->getChar();
  178|  6.79M|	++nBytesRead;
  179|  6.79M|      }
  180|  4.85G|      --dataLen;
  181|  4.85G|    }
  182|  1.29M|    readBufNext = 0;
  183|  1.29M|  }
  184|  1.54M|}
_ZN18JArithmeticDecoder9decodeBitEjP23JArithmeticDecoderStats:
  187|   755M|				  JArithmeticDecoderStats *stats) {
  188|   755M|  int bit;
  189|   755M|  Guint qe;
  190|   755M|  int iCX, mpsCX;
  191|       |
  192|   755M|  iCX = stats->cxTab[context] >> 1;
  193|   755M|  mpsCX = stats->cxTab[context] & 1;
  194|   755M|  qe = qeTab[iCX];
  195|   755M|  a -= qe;
  196|   755M|  if (c < a) {
  ------------------
  |  Branch (196:7): [True: 719M, False: 35.9M]
  ------------------
  197|   719M|    if (a & 0x80000000) {
  ------------------
  |  Branch (197:9): [True: 679M, False: 39.8M]
  ------------------
  198|   679M|      bit = mpsCX;
  199|   679M|    } else {
  200|       |      // MPS_EXCHANGE
  201|  39.8M|      if (a < qe) {
  ------------------
  |  Branch (201:11): [True: 5.87M, False: 33.9M]
  ------------------
  202|  5.87M|	bit = 1 - mpsCX;
  203|  5.87M|	if (switchTab[iCX]) {
  ------------------
  |  Branch (203:6): [True: 3.23M, False: 2.63M]
  ------------------
  204|  3.23M|	  stats->cxTab[context] = (Guchar)((nlpsTab[iCX] << 1) | (1 - mpsCX));
  205|  3.23M|	} else {
  206|  2.63M|	  stats->cxTab[context] = (Guchar)((nlpsTab[iCX] << 1) | mpsCX);
  207|  2.63M|	}
  208|  33.9M|      } else {
  209|  33.9M|	bit = mpsCX;
  210|  33.9M|	stats->cxTab[context] = (Guchar)((nmpsTab[iCX] << 1) | mpsCX);
  211|  33.9M|      }
  212|       |      // RENORMD
  213|  42.2M|      do {
  214|  42.2M|	if (ct == 0) {
  ------------------
  |  Branch (214:6): [True: 5.30M, False: 36.9M]
  ------------------
  215|  5.30M|	  byteIn();
  216|  5.30M|	}
  217|  42.2M|	a <<= 1;
  218|  42.2M|	c <<= 1;
  219|  42.2M|	--ct;
  220|  42.2M|      } while (!(a & 0x80000000));
  ------------------
  |  Branch (220:16): [True: 2.38M, False: 39.8M]
  ------------------
  221|  39.8M|    }
  222|   719M|  } else {
  223|  35.9M|    c -= a;
  224|       |    // LPS_EXCHANGE
  225|  35.9M|    if (a < qe) {
  ------------------
  |  Branch (225:9): [True: 6.93M, False: 28.9M]
  ------------------
  226|  6.93M|      bit = mpsCX;
  227|  6.93M|      stats->cxTab[context] = (Guchar)((nmpsTab[iCX] << 1) | mpsCX);
  228|  28.9M|    } else {
  229|  28.9M|      bit = 1 - mpsCX;
  230|  28.9M|      if (switchTab[iCX]) {
  ------------------
  |  Branch (230:11): [True: 4.34M, False: 24.6M]
  ------------------
  231|  4.34M|	stats->cxTab[context] = (Guchar)((nlpsTab[iCX] << 1) | (1 - mpsCX));
  232|  24.6M|      } else {
  233|  24.6M|	stats->cxTab[context] = (Guchar)((nlpsTab[iCX] << 1) | mpsCX);
  234|  24.6M|      }
  235|  28.9M|    }
  236|  35.9M|    a = qe;
  237|       |    // RENORMD
  238|  56.8M|    do {
  239|  56.8M|      if (ct == 0) {
  ------------------
  |  Branch (239:11): [True: 7.19M, False: 49.6M]
  ------------------
  240|  7.19M|	byteIn();
  241|  7.19M|      }
  242|  56.8M|      a <<= 1;
  243|  56.8M|      c <<= 1;
  244|  56.8M|      --ct;
  245|  56.8M|    } while (!(a & 0x80000000));
  ------------------
  |  Branch (245:14): [True: 20.9M, False: 35.9M]
  ------------------
  246|  35.9M|  }
  247|   755M|  return bit;
  248|   755M|}
_ZN18JArithmeticDecoder9decodeIntEPiP23JArithmeticDecoderStats:
  262|  4.90M|GBool JArithmeticDecoder::decodeInt(int *x, JArithmeticDecoderStats *stats) {
  263|  4.90M|  int s;
  264|  4.90M|  Guint v;
  265|  4.90M|  int i;
  266|       |
  267|  4.90M|  prev = 1;
  268|  4.90M|  s = decodeIntBit(stats);
  269|  4.90M|  if (decodeIntBit(stats)) {
  ------------------
  |  Branch (269:7): [True: 1.84M, False: 3.05M]
  ------------------
  270|  1.84M|    if (decodeIntBit(stats)) {
  ------------------
  |  Branch (270:9): [True: 451k, False: 1.39M]
  ------------------
  271|   451k|      if (decodeIntBit(stats)) {
  ------------------
  |  Branch (271:11): [True: 123k, False: 328k]
  ------------------
  272|   123k|	if (decodeIntBit(stats)) {
  ------------------
  |  Branch (272:6): [True: 75.6k, False: 47.3k]
  ------------------
  273|  75.6k|	  if (decodeIntBit(stats)) {
  ------------------
  |  Branch (273:8): [True: 18.3k, False: 57.2k]
  ------------------
  274|  18.3k|	    v = 0;
  275|   605k|	    for (i = 0; i < 32; ++i) {
  ------------------
  |  Branch (275:18): [True: 587k, False: 18.3k]
  ------------------
  276|   587k|	      v = (v << 1) | decodeIntBit(stats);
  277|   587k|	    }
  278|  18.3k|	    v += 4436;
  279|  57.2k|	  } else {
  280|  57.2k|	    v = 0;
  281|   744k|	    for (i = 0; i < 12; ++i) {
  ------------------
  |  Branch (281:18): [True: 687k, False: 57.2k]
  ------------------
  282|   687k|	      v = (v << 1) | decodeIntBit(stats);
  283|   687k|	    }
  284|  57.2k|	    v += 340;
  285|  57.2k|	  }
  286|  75.6k|	} else {
  287|  47.3k|	  v = 0;
  288|   426k|	  for (i = 0; i < 8; ++i) {
  ------------------
  |  Branch (288:16): [True: 379k, False: 47.3k]
  ------------------
  289|   379k|	    v = (v << 1) | decodeIntBit(stats);
  290|   379k|	  }
  291|  47.3k|	  v += 84;
  292|  47.3k|	}
  293|   328k|      } else {
  294|   328k|	v = 0;
  295|  2.29M|	for (i = 0; i < 6; ++i) {
  ------------------
  |  Branch (295:14): [True: 1.96M, False: 328k]
  ------------------
  296|  1.96M|	  v = (v << 1) | decodeIntBit(stats);
  297|  1.96M|	}
  298|   328k|	v += 20;
  299|   328k|      }
  300|  1.39M|    } else {
  301|  1.39M|      v = decodeIntBit(stats);
  302|  1.39M|      v = (v << 1) | decodeIntBit(stats);
  303|  1.39M|      v = (v << 1) | decodeIntBit(stats);
  304|  1.39M|      v = (v << 1) | decodeIntBit(stats);
  305|  1.39M|      v += 4;
  306|  1.39M|    }
  307|  3.05M|  } else {
  308|  3.05M|    v = decodeIntBit(stats);
  309|  3.05M|    v = (v << 1) | decodeIntBit(stats);
  310|  3.05M|  }
  311|       |
  312|  4.90M|  if (s) {
  ------------------
  |  Branch (312:7): [True: 2.06M, False: 2.83M]
  ------------------
  313|  2.06M|    if (v == 0) {
  ------------------
  |  Branch (313:9): [True: 1.20M, False: 865k]
  ------------------
  314|  1.20M|      return gFalse;
  ------------------
  |  |   18|  1.20M|#define gFalse 0
  ------------------
  315|  1.20M|    }
  316|   865k|    *x = -(int)v;
  317|  2.83M|  } else {
  318|  2.83M|    *x = (int)v;
  319|  2.83M|  }
  320|  3.69M|  return gTrue;
  ------------------
  |  |   17|  3.69M|#define gTrue 1
  ------------------
  321|  4.90M|}
_ZN18JArithmeticDecoder12decodeIntBitEP23JArithmeticDecoderStats:
  323|  27.6M|int JArithmeticDecoder::decodeIntBit(JArithmeticDecoderStats *stats) {
  324|  27.6M|  int bit;
  325|       |
  326|  27.6M|  bit = decodeBit(prev, stats);
  327|  27.6M|  if (prev < 0x100) {
  ------------------
  |  Branch (327:7): [True: 25.6M, False: 2.01M]
  ------------------
  328|  25.6M|    prev = (prev << 1) | bit;
  329|  25.6M|  } else {
  330|  2.01M|    prev = (((prev << 1) | bit) & 0x1ff) | 0x100;
  331|  2.01M|  }
  332|  27.6M|  return bit;
  333|  27.6M|}
_ZN18JArithmeticDecoder10decodeIAIDEjP23JArithmeticDecoderStats:
  336|   894k|				     JArithmeticDecoderStats *stats) {
  337|   894k|  Guint i;
  338|   894k|  int bit;
  339|       |
  340|   894k|  prev = 1;
  341|  11.1M|  for (i = 0; i < codeLen; ++i) {
  ------------------
  |  Branch (341:15): [True: 10.2M, False: 894k]
  ------------------
  342|  10.2M|    bit = decodeBit(prev, stats);
  343|  10.2M|    prev = (prev << 1) | bit;
  344|  10.2M|  }
  345|   894k|  return prev - (1 << codeLen);
  346|   894k|}
_ZN18JArithmeticDecoder6byteInEv:
  348|  13.2M|void JArithmeticDecoder::byteIn() {
  349|  13.2M|  if (buf0 == 0xff) {
  ------------------
  |  Branch (349:7): [True: 10.6M, False: 2.57M]
  ------------------
  350|  10.6M|    if (buf1 > 0x8f) {
  ------------------
  |  Branch (350:9): [True: 10.6M, False: 15.1k]
  ------------------
  351|  10.6M|      if (limitStream) {
  ------------------
  |  Branch (351:11): [True: 1.29M, False: 9.38M]
  ------------------
  352|  1.29M|	buf0 = buf1;
  353|  1.29M|	buf1 = readByte();
  354|  1.29M|	c = c + 0xff00 - (buf0 << 8);
  355|  1.29M|      }
  356|  10.6M|      ct = 8;
  357|  10.6M|    } else {
  358|  15.1k|      buf0 = buf1;
  359|  15.1k|      buf1 = readByte();
  360|  15.1k|      c = c + 0xfe00 - (buf0 << 9);
  361|  15.1k|      ct = 7;
  362|  15.1k|    }
  363|  10.6M|  } else {
  364|  2.57M|    buf0 = buf1;
  365|  2.57M|    buf1 = readByte();
  366|  2.57M|    c = c + 0xff00 - (buf0 << 8);
  367|  2.57M|    ct = 8;
  368|  2.57M|  }
  369|  13.2M|}
_ZN18JArithmeticDecoder8readByteEv:
   96|  5.87M|inline Guint JArithmeticDecoder::readByte() {
   97|  5.87M|  if (limitStream) {
  ------------------
  |  Branch (97:7): [True: 4.84M, False: 1.02M]
  ------------------
   98|  4.84M|    if (readBufNext < readBufLength) {
  ------------------
  |  Branch (98:9): [True: 1.06M, False: 3.78M]
  ------------------
   99|  1.06M|      return readBuf[readBufNext++];
  100|  1.06M|    }
  101|  3.78M|    --dataLen;
  102|  3.78M|    if (dataLen < 0) {
  ------------------
  |  Branch (102:9): [True: 1.71M, False: 2.07M]
  ------------------
  103|  1.71M|      return 0xff;
  104|  1.71M|    }
  105|  3.78M|  }
  106|  3.09M|  ++nBytesRead;
  107|  3.09M|  return (Guint)str->getChar() & 0xff;
  108|  5.87M|}

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

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

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

_ZN5LexerC2EP4XRefP6Stream:
   46|   350k|Lexer::Lexer(XRef *xref, Stream *str) {
   47|   350k|  Object obj;
   48|       |
   49|   350k|  curStr.initStream(str);
   50|   350k|  streams = new Array(xref);
   51|   350k|  streams->add(curStr.copy(&obj));
   52|   350k|  strPtr = 0;
   53|   350k|  freeArray = gTrue;
  ------------------
  |  |   17|   350k|#define gTrue 1
  ------------------
   54|   350k|  curStr.streamReset();
   55|   350k|}
_ZN5LexerD2Ev:
   75|   350k|Lexer::~Lexer() {
   76|   350k|  if (!curStr.isNone()) {
  ------------------
  |  Branch (76:7): [True: 108k, False: 241k]
  ------------------
   77|   108k|    curStr.streamClose();
   78|   108k|    curStr.free();
   79|   108k|  }
   80|   350k|  if (freeArray) {
  ------------------
  |  Branch (80:7): [True: 350k, False: 0]
  ------------------
   81|   350k|    delete streams;
   82|   350k|  }
   83|   350k|}
_ZN5Lexer7getCharEv:
   85|  1.95G|int Lexer::getChar() {
   86|  1.95G|  int c;
   87|       |
   88|  1.95G|  c = EOF;
   89|  1.95G|  while (!curStr.isNone() && (c = curStr.streamGetChar()) == EOF) {
  ------------------
  |  Branch (89:10): [True: 1.83G, False: 121M]
  |  Branch (89:30): [True: 241k, False: 1.83G]
  ------------------
   90|   241k|    curStr.streamClose();
   91|   241k|    curStr.free();
   92|   241k|    ++strPtr;
   93|   241k|    if (strPtr < streams->getLength()) {
  ------------------
  |  Branch (93:9): [True: 0, False: 241k]
  ------------------
   94|      0|      streams->get(strPtr, &curStr);
   95|      0|      curStr.streamReset();
   96|      0|    }
   97|   241k|  }
   98|  1.95G|  return c;
   99|  1.95G|}
_ZN5Lexer8lookCharEv:
  101|   289M|int Lexer::lookChar() {
  102|   289M|  if (curStr.isNone()) {
  ------------------
  |  Branch (102:7): [True: 2.66k, False: 289M]
  ------------------
  103|  2.66k|    return EOF;
  104|  2.66k|  }
  105|   289M|  return curStr.streamLookChar();
  106|   289M|}
_ZN5Lexer6getObjEP6Object:
  108|   165M|Object *Lexer::getObj(Object *obj) {
  109|   165M|  char *p;
  110|   165M|  int c, c2;
  111|   165M|  GBool comment, neg, doubleMinus, done, invalid;
  112|   165M|  int numParen, nErrors;
  113|   165M|  int xi;
  114|   165M|  double xf, scale;
  115|   165M|  GString *s;
  116|   165M|  int n, m;
  117|       |
  118|       |  // skip whitespace and comments
  119|   165M|  comment = gFalse;
  ------------------
  |  |   18|   165M|#define gFalse 0
  ------------------
  120|   912M|  while (1) {
  ------------------
  |  Branch (120:10): [True: 912M, Folded]
  ------------------
  121|   912M|    if ((c = getChar()) == EOF) {
  ------------------
  |  Branch (121:9): [True: 121M, False: 790M]
  ------------------
  122|   121M|      return obj->initEOF();
  123|   121M|    }
  124|   790M|    if (comment) {
  ------------------
  |  Branch (124:9): [True: 19.6M, False: 771M]
  ------------------
  125|  19.6M|      if (c == '\r' || c == '\n')
  ------------------
  |  Branch (125:11): [True: 120k, False: 19.4M]
  |  Branch (125:24): [True: 185k, False: 19.2M]
  ------------------
  126|   306k|	comment = gFalse;
  ------------------
  |  |   18|   306k|#define gFalse 0
  ------------------
  127|   771M|    } else if (c == '%') {
  ------------------
  |  Branch (127:16): [True: 309k, False: 771M]
  ------------------
  128|   309k|      comment = gTrue;
  ------------------
  |  |   17|   309k|#define gTrue 1
  ------------------
  129|   771M|    } else if (specialChars[c] != 1) {
  ------------------
  |  Branch (129:16): [True: 44.1M, False: 726M]
  ------------------
  130|  44.1M|      break;
  131|  44.1M|    }
  132|   790M|  }
  133|       |
  134|       |  // start reading token
  135|  44.1M|  switch (c) {
  136|       |
  137|       |  // number
  138|  4.48M|  case '0': case '1': case '2': case '3': case '4':
  ------------------
  |  Branch (138:3): [True: 2.37M, False: 41.7M]
  |  Branch (138:13): [True: 943k, False: 43.2M]
  |  Branch (138:23): [True: 694k, False: 43.4M]
  |  Branch (138:33): [True: 172k, False: 43.9M]
  |  Branch (138:43): [True: 299k, False: 43.8M]
  ------------------
  139|  5.93M|  case '5': case '6': case '7': case '8': case '9':
  ------------------
  |  Branch (139:3): [True: 196k, False: 43.9M]
  |  Branch (139:13): [True: 327k, False: 43.8M]
  |  Branch (139:23): [True: 149k, False: 44.0M]
  |  Branch (139:33): [True: 531k, False: 43.6M]
  |  Branch (139:43): [True: 247k, False: 43.9M]
  ------------------
  140|  6.44M|  case '+': case '-': case '.':
  ------------------
  |  Branch (140:3): [True: 38.2k, False: 44.1M]
  |  Branch (140:13): [True: 259k, False: 43.8M]
  |  Branch (140:23): [True: 211k, False: 43.9M]
  ------------------
  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|  6.44M|    neg = gFalse;
  ------------------
  |  |   18|  6.44M|#define gFalse 0
  ------------------
  156|  6.44M|    doubleMinus = gFalse;
  ------------------
  |  |   18|  6.44M|#define gFalse 0
  ------------------
  157|  6.44M|    xf = xi = 0;
  158|  6.44M|    if (c == '+') {
  ------------------
  |  Branch (158:9): [True: 38.2k, False: 6.40M]
  ------------------
  159|       |      // just ignore it
  160|  6.40M|    } else if (c == '-') {
  ------------------
  |  Branch (160:16): [True: 259k, False: 6.14M]
  ------------------
  161|   259k|      neg = gTrue;
  ------------------
  |  |   17|   259k|#define gTrue 1
  ------------------
  162|   259k|      if (lookChar() == '-') {
  ------------------
  |  Branch (162:11): [True: 11.4k, False: 247k]
  ------------------
  163|  11.4k|	doubleMinus = gTrue;
  ------------------
  |  |   17|  11.4k|#define gTrue 1
  ------------------
  164|  18.3k|	do {
  165|  18.3k|	  getChar();
  166|  18.3k|	} while (lookChar() == '-');
  ------------------
  |  Branch (166:11): [True: 6.90k, False: 11.4k]
  ------------------
  167|  11.4k|      }
  168|  6.14M|    } else if (c == '.') {
  ------------------
  |  Branch (168:16): [True: 211k, False: 5.93M]
  ------------------
  169|   211k|      goto doReal;
  170|  5.93M|    } else {
  171|  5.93M|      xf = xi = c - '0';
  172|  5.93M|    }
  173|  13.0M|    while (1) {
  ------------------
  |  Branch (173:12): [True: 13.0M, Folded]
  ------------------
  174|  13.0M|      c = lookChar();
  175|  13.0M|      if (isdigit(c)) {
  ------------------
  |  Branch (175:11): [True: 6.82M, False: 6.23M]
  ------------------
  176|  6.82M|	getChar();
  177|  6.82M|	xi = xi * 10 + (c - '0');
  178|  6.82M|	if (xf < 1e20) {
  ------------------
  |  Branch (178:6): [True: 6.45M, False: 368k]
  ------------------
  179|  6.45M|	  xf = xf * 10 + (c - '0');
  180|  6.45M|	}
  181|  6.82M|      } else if (c == '.') {
  ------------------
  |  Branch (181:18): [True: 304k, False: 5.92M]
  ------------------
  182|   304k|	getChar();
  183|   304k|	goto doReal;
  184|  5.92M|      } else {
  185|  5.92M|	break;
  186|  5.92M|      }
  187|  13.0M|    }
  188|  5.93M|    while ((c = lookChar()) == '-' || isdigit(c)) {
  ------------------
  |  Branch (188:12): [True: 5.30k, False: 5.93M]
  |  Branch (188:39): [True: 5.58k, False: 5.92M]
  ------------------
  189|  10.8k|      getChar();
  190|  10.8k|    }
  191|  5.92M|    if (neg) {
  ------------------
  |  Branch (191:9): [True: 253k, False: 5.67M]
  ------------------
  192|   253k|      xi = -xi;
  193|   253k|    }
  194|  5.92M|    if (doubleMinus) {
  ------------------
  |  Branch (194:9): [True: 11.1k, False: 5.91M]
  ------------------
  195|  11.1k|      xi = 0;
  196|  11.1k|    }
  197|  5.92M|    obj->initInt(xi);
  198|  5.92M|    break;
  199|   515k|  doReal:
  200|   515k|    scale = 0.1;
  201|   984k|    while (1) {
  ------------------
  |  Branch (201:12): [True: 984k, Folded]
  ------------------
  202|   984k|      c = lookChar();
  203|   984k|      if (c == '-') {
  ------------------
  |  Branch (203:11): [True: 19.2k, False: 965k]
  ------------------
  204|  19.2k|	error(errSyntaxWarning, getPos(), "Badly formatted number");
  205|  19.2k|	getChar();
  206|  19.2k|	continue;
  207|  19.2k|      }
  208|   965k|      if (!isdigit(c)) {
  ------------------
  |  Branch (208:11): [True: 515k, False: 449k]
  ------------------
  209|   515k|	break;
  210|   515k|      }
  211|   449k|      getChar();
  212|   449k|      xf = xf + scale * (c - '0');
  213|   449k|      scale *= 0.1;
  214|   449k|    }
  215|   515k|    while ((c = lookChar()) == '-' || isdigit(c)) {
  ------------------
  |  Branch (215:12): [True: 0, False: 515k]
  |  Branch (215:39): [True: 0, False: 515k]
  ------------------
  216|      0|      getChar();
  217|      0|    }
  218|   515k|    if (neg) {
  ------------------
  |  Branch (218:9): [True: 5.40k, False: 510k]
  ------------------
  219|  5.40k|      xf = -xf;
  220|  5.40k|    }
  221|   515k|    obj->initReal(xf);
  222|   515k|    break;
  223|       |
  224|       |  // string
  225|   181k|  case '(':
  ------------------
  |  Branch (225:3): [True: 181k, False: 43.9M]
  ------------------
  226|   181k|    p = tokBuf;
  227|   181k|    n = 0;
  228|   181k|    numParen = 1;
  229|   181k|    done = gFalse;
  ------------------
  |  |   18|   181k|#define gFalse 0
  ------------------
  230|   181k|    s = NULL;
  231|   742M|    do {
  232|   742M|      c2 = EOF;
  233|   742M|      switch (c = getChar()) {
  234|       |
  235|  11.6k|      case EOF:
  ------------------
  |  Branch (235:7): [True: 11.6k, False: 742M]
  ------------------
  236|  11.6k|	error(errSyntaxError, getPos(), "Unterminated string");
  237|  11.6k|	done = gTrue;
  ------------------
  |  |   17|  11.6k|#define gTrue 1
  ------------------
  238|  11.6k|	break;
  239|       |
  240|  2.76M|      case '(':
  ------------------
  |  Branch (240:7): [True: 2.76M, False: 739M]
  ------------------
  241|  2.76M|	++numParen;
  242|  2.76M|	c2 = c;
  243|  2.76M|	break;
  244|       |
  245|  1.61M|      case ')':
  ------------------
  |  Branch (245:7): [True: 1.61M, False: 741M]
  ------------------
  246|  1.61M|	if (--numParen == 0) {
  ------------------
  |  Branch (246:6): [True: 169k, False: 1.44M]
  ------------------
  247|   169k|	  done = gTrue;
  ------------------
  |  |   17|   169k|#define gTrue 1
  ------------------
  248|  1.44M|	} else {
  249|  1.44M|	  c2 = c;
  250|  1.44M|	}
  251|  1.61M|	break;
  252|       |
  253|  6.02M|      case '\r':
  ------------------
  |  Branch (253:7): [True: 6.02M, False: 736M]
  ------------------
  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|  6.02M|	c = lookChar();
  257|  6.02M|	if (c == '\n') {
  ------------------
  |  Branch (257:6): [True: 108k, False: 5.91M]
  ------------------
  258|   108k|	  getChar();
  259|   108k|	}
  260|  6.02M|	c2 = '\n';
  261|  6.02M|	break;
  262|       |
  263|  1.06M|      case '\\':
  ------------------
  |  Branch (263:7): [True: 1.06M, False: 741M]
  ------------------
  264|  1.06M|	switch (c = getChar()) {
  265|  5.59k|	case 'n':
  ------------------
  |  Branch (265:2): [True: 5.59k, False: 1.05M]
  ------------------
  266|  5.59k|	  c2 = '\n';
  267|  5.59k|	  break;
  268|  15.0k|	case 'r':
  ------------------
  |  Branch (268:2): [True: 15.0k, False: 1.04M]
  ------------------
  269|  15.0k|	  c2 = '\r';
  270|  15.0k|	  break;
  271|  25.4k|	case 't':
  ------------------
  |  Branch (271:2): [True: 25.4k, False: 1.03M]
  ------------------
  272|  25.4k|	  c2 = '\t';
  273|  25.4k|	  break;
  274|  7.32k|	case 'b':
  ------------------
  |  Branch (274:2): [True: 7.32k, False: 1.05M]
  ------------------
  275|  7.32k|	  c2 = '\b';
  276|  7.32k|	  break;
  277|  5.50k|	case 'f':
  ------------------
  |  Branch (277:2): [True: 5.50k, False: 1.05M]
  ------------------
  278|  5.50k|	  c2 = '\f';
  279|  5.50k|	  break;
  280|  3.69k|	case '\\':
  ------------------
  |  Branch (280:2): [True: 3.69k, False: 1.06M]
  ------------------
  281|  12.9k|	case '(':
  ------------------
  |  Branch (281:2): [True: 9.29k, False: 1.05M]
  ------------------
  282|  21.1k|	case ')':
  ------------------
  |  Branch (282:2): [True: 8.14k, False: 1.05M]
  ------------------
  283|  21.1k|	  c2 = c;
  284|  21.1k|	  break;
  285|  19.6k|	case '0': case '1': case '2': case '3':
  ------------------
  |  Branch (285:2): [True: 9.98k, False: 1.05M]
  |  Branch (285:12): [True: 3.46k, False: 1.06M]
  |  Branch (285:22): [True: 3.39k, False: 1.06M]
  |  Branch (285:32): [True: 2.79k, False: 1.06M]
  ------------------
  286|  53.5k|	case '4': case '5': case '6': case '7':
  ------------------
  |  Branch (286:2): [True: 6.98k, False: 1.05M]
  |  Branch (286:12): [True: 9.00k, False: 1.05M]
  |  Branch (286:22): [True: 8.91k, False: 1.05M]
  |  Branch (286:32): [True: 9.00k, False: 1.05M]
  ------------------
  287|  53.5k|	  c2 = c - '0';
  288|  53.5k|	  c = lookChar();
  289|  53.5k|	  if (c >= '0' && c <= '7') {
  ------------------
  |  Branch (289:8): [True: 29.9k, False: 23.6k]
  |  Branch (289:20): [True: 7.52k, False: 22.3k]
  ------------------
  290|  7.52k|	    getChar();
  291|  7.52k|	    c2 = (c2 << 3) + (c - '0');
  292|  7.52k|	    c = lookChar();
  293|  7.52k|	    if (c >= '0' && c <= '7') {
  ------------------
  |  Branch (293:10): [True: 2.41k, False: 5.10k]
  |  Branch (293:22): [True: 680, False: 1.73k]
  ------------------
  294|    680|	      getChar();
  295|    680|	      c2 = (c2 << 3) + (c - '0');
  296|    680|	    }
  297|  7.52k|	  }
  298|  53.5k|	  break;
  299|  4.99k|	case '\r':
  ------------------
  |  Branch (299:2): [True: 4.99k, False: 1.05M]
  ------------------
  300|  4.99k|	  c = lookChar();
  301|  4.99k|	  if (c == '\n') {
  ------------------
  |  Branch (301:8): [True: 1.17k, False: 3.82k]
  ------------------
  302|  1.17k|	    getChar();
  303|  1.17k|	  }
  304|  4.99k|	  break;
  305|  10.4k|	case '\n':
  ------------------
  |  Branch (305:2): [True: 10.4k, False: 1.05M]
  ------------------
  306|  10.4k|	  break;
  307|    580|	case EOF:
  ------------------
  |  Branch (307:2): [True: 580, False: 1.06M]
  ------------------
  308|    580|	  error(errSyntaxError, getPos(), "Unterminated string");
  309|    580|	  done = gTrue;
  ------------------
  |  |   17|    580|#define gTrue 1
  ------------------
  310|    580|	  break;
  311|   914k|	default:
  ------------------
  |  Branch (311:2): [True: 914k, False: 149k]
  ------------------
  312|   914k|	  c2 = c;
  313|   914k|	  break;
  314|  1.06M|	}
  315|  1.06M|	break;
  316|       |
  317|   731M|      default:
  ------------------
  |  Branch (317:7): [True: 731M, False: 11.4M]
  ------------------
  318|   731M|	c2 = c;
  319|   731M|	break;
  320|   742M|      }
  321|       |
  322|   742M|      if (c2 != EOF) {
  ------------------
  |  Branch (322:11): [True: 742M, False: 197k]
  ------------------
  323|   742M|	if (n == tokBufSize) {
  ------------------
  |  |   19|   742M|#define tokBufSize 128		// size of token buffer
  ------------------
  |  Branch (323:6): [True: 5.73M, False: 736M]
  ------------------
  324|  5.73M|	  if (!s)
  ------------------
  |  Branch (324:8): [True: 64.3k, False: 5.67M]
  ------------------
  325|  64.3k|	    s = new GString(tokBuf, tokBufSize);
  ------------------
  |  |   19|  64.3k|#define tokBufSize 128		// size of token buffer
  ------------------
  326|  5.67M|	  else
  327|  5.67M|	    s->append(tokBuf, tokBufSize);
  ------------------
  |  |   19|  5.67M|#define tokBufSize 128		// size of token buffer
  ------------------
  328|  5.73M|	  p = tokBuf;
  329|  5.73M|	  n = 0;
  330|  5.73M|	}
  331|   742M|	*p++ = (char)c2;
  332|   742M|	++n;
  333|   742M|      }
  334|   742M|    } while (!done);
  ------------------
  |  Branch (334:14): [True: 742M, False: 181k]
  ------------------
  335|   181k|    if (!s)
  ------------------
  |  Branch (335:9): [True: 117k, False: 64.3k]
  ------------------
  336|   117k|      s = new GString(tokBuf, n);
  337|  64.3k|    else
  338|  64.3k|      s->append(tokBuf, n);
  339|   181k|    obj->initString(s);
  340|   181k|    break;
  341|       |
  342|       |  // name
  343|  6.28M|  case '/':
  ------------------
  |  Branch (343:3): [True: 6.28M, False: 37.8M]
  ------------------
  344|  6.28M|    p = tokBuf;
  345|  6.28M|    n = 0;
  346|  6.28M|    s = NULL;
  347|  6.28M|    invalid = gFalse;
  ------------------
  |  |   18|  6.28M|#define gFalse 0
  ------------------
  348|  25.4M|    while ((c = lookChar()) != EOF && !specialChars[c]) {
  ------------------
  |  Branch (348:12): [True: 25.4M, False: 3.39k]
  |  Branch (348:39): [True: 19.1M, False: 6.28M]
  ------------------
  349|  19.1M|      getChar();
  350|  19.1M|      if (c == '#') {
  ------------------
  |  Branch (350:11): [True: 822k, False: 18.3M]
  ------------------
  351|   822k|	c2 = lookChar();
  352|   822k|	if (c2 >= '0' && c2 <= '9') {
  ------------------
  |  Branch (352:6): [True: 405k, False: 417k]
  |  Branch (352:19): [True: 1.32k, False: 404k]
  ------------------
  353|  1.32k|	  c = c2 - '0';
  354|   821k|	} else if (c2 >= 'A' && c2 <= 'F') {
  ------------------
  |  Branch (354:13): [True: 404k, False: 417k]
  |  Branch (354:26): [True: 47.0k, False: 357k]
  ------------------
  355|  47.0k|	  c = c2 - 'A' + 10;
  356|   774k|	} else if (c2 >= 'a' && c2 <= 'f') {
  ------------------
  |  Branch (356:13): [True: 356k, False: 417k]
  |  Branch (356:26): [True: 98.5k, False: 258k]
  ------------------
  357|  98.5k|	  c = c2 - 'a' + 10;
  358|   675k|	} else {
  359|   675k|	  error(errSyntaxError, getPos(), "Invalid hex escape in name");
  360|   675k|	  goto notEscChar;
  361|   675k|	}
  362|   146k|	getChar();
  363|   146k|	c2 = lookChar();
  364|   146k|	if (c2 >= '0' && c2 <= '9') {
  ------------------
  |  Branch (364:6): [True: 144k, False: 2.39k]
  |  Branch (364:19): [True: 27.1k, False: 117k]
  ------------------
  365|  27.1k|	  c = (c << 4) + (c2 - '0');
  366|   119k|	} else if (c2 >= 'A' && c2 <= 'F') {
  ------------------
  |  Branch (366:13): [True: 94.9k, False: 24.8k]
  |  Branch (366:26): [True: 46.6k, False: 48.2k]
  ------------------
  367|  46.6k|	  c = (c << 4) + (c2 - 'A' + 10);
  368|  73.1k|	} else if (c2 >= 'a' && c2 <= 'f') {
  ------------------
  |  Branch (368:13): [True: 1.92k, False: 71.2k]
  |  Branch (368:26): [True: 822, False: 1.10k]
  ------------------
  369|    822|	  c = (c << 4) + (c2 - 'a' + 10);
  370|  72.3k|	} else {
  371|  72.3k|	  error(errSyntaxError, getPos(), "Invalid hex escape in name");
  372|  72.3k|	  goto notEscChar;
  373|  72.3k|	}
  374|  74.5k|	getChar();
  375|  74.5k|	if (c == 0) {
  ------------------
  |  Branch (375:6): [True: 397, False: 74.1k]
  ------------------
  376|    397|	  invalid = gTrue;
  ------------------
  |  |   17|    397|#define gTrue 1
  ------------------
  377|    397|	}
  378|  74.5k|      }
  379|  19.1M|     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|  19.1M|      ++n;
  384|  19.1M|      if (n < tokBufSize) {
  ------------------
  |  |   19|  19.1M|#define tokBufSize 128		// size of token buffer
  ------------------
  |  Branch (384:11): [True: 18.8M, False: 283k]
  ------------------
  385|  18.8M|	*p++ = (char)c;
  386|  18.8M|      } else if (n == tokBufSize) {
  ------------------
  |  |   19|   283k|#define tokBufSize 128		// size of token buffer
  ------------------
  |  Branch (386:18): [True: 1.64k, False: 281k]
  ------------------
  387|  1.64k|	*p = (char)c;
  388|  1.64k|	s = new GString(tokBuf, n);
  389|   281k|      } else {
  390|   281k|	s->append((char)c);
  391|   281k|      }
  392|  19.1M|    }
  393|  6.28M|    if (invalid) {
  ------------------
  |  Branch (393:9): [True: 397, False: 6.28M]
  ------------------
  394|    397|      error(errSyntaxError, getPos(), "Null character in name");
  395|    397|      obj->initError();
  396|    397|      if (s) {
  ------------------
  |  Branch (396:11): [True: 245, False: 152]
  ------------------
  397|    245|	delete s;
  398|    245|      }
  399|  6.28M|    } else if (n < tokBufSize) {
  ------------------
  |  |   19|  6.28M|#define tokBufSize 128		// size of token buffer
  ------------------
  |  Branch (399:16): [True: 6.28M, False: 1.40k]
  ------------------
  400|  6.28M|      *p = '\0';
  401|  6.28M|      obj->initName(tokBuf);
  402|  6.28M|    } else {
  403|  1.40k|      obj->initName(s->getCString());
  404|  1.40k|      delete s;
  405|  1.40k|    }
  406|  6.28M|    break;
  407|       |
  408|       |  // array punctuation
  409|  5.27M|  case '[':
  ------------------
  |  Branch (409:3): [True: 5.27M, False: 38.8M]
  ------------------
  410|  5.77M|  case ']':
  ------------------
  |  Branch (410:3): [True: 496k, False: 43.6M]
  ------------------
  411|  5.77M|    tokBuf[0] = (char)c;
  412|  5.77M|    tokBuf[1] = '\0';
  413|  5.77M|    obj->initCmd(tokBuf);
  414|  5.77M|    break;
  415|       |
  416|       |  // hex string or dict punctuation
  417|  3.83M|  case '<':
  ------------------
  |  Branch (417:3): [True: 3.83M, False: 40.3M]
  ------------------
  418|  3.83M|    c = lookChar();
  419|       |
  420|       |    // dict punctuation
  421|  3.83M|    if (c == '<') {
  ------------------
  |  Branch (421:9): [True: 3.11M, False: 728k]
  ------------------
  422|  3.11M|      getChar();
  423|  3.11M|      tokBuf[0] = tokBuf[1] = '<';
  424|  3.11M|      tokBuf[2] = '\0';
  425|  3.11M|      obj->initCmd(tokBuf);
  426|       |
  427|       |    // hex string
  428|  3.11M|    } else {
  429|   728k|      p = tokBuf;
  430|   728k|      m = n = 0;
  431|   728k|      c2 = 0;
  432|   728k|      s = NULL;
  433|   728k|      nErrors = 0;
  434|  55.5M|      while (nErrors < 100) {
  ------------------
  |  Branch (434:14): [True: 55.3M, False: 165k]
  ------------------
  435|  55.3M|	c = getChar();
  436|  55.3M|	if (c == '>') {
  ------------------
  |  Branch (436:6): [True: 560k, False: 54.8M]
  ------------------
  437|   560k|	  break;
  438|  54.8M|	} else if (c == EOF) {
  ------------------
  |  Branch (438:13): [True: 2.64k, False: 54.8M]
  ------------------
  439|  2.64k|	  error(errSyntaxError, getPos(), "Unterminated hex string");
  440|  2.64k|	  break;
  441|  54.8M|	} else if (specialChars[c] != 1) {
  ------------------
  |  Branch (441:13): [True: 44.9M, False: 9.83M]
  ------------------
  442|  44.9M|	  c2 = c2 << 4;
  443|  44.9M|	  if (c >= '0' && c <= '9') {
  ------------------
  |  Branch (443:8): [True: 40.2M, False: 4.76M]
  |  Branch (443:20): [True: 4.96M, False: 35.2M]
  ------------------
  444|  4.96M|	    c2 += c - '0';
  445|  40.0M|	  } else if (c >= 'A' && c <= 'F') {
  ------------------
  |  Branch (445:15): [True: 31.3M, False: 8.66M]
  |  Branch (445:27): [True: 718k, False: 30.6M]
  ------------------
  446|   718k|	    c2 += c - 'A' + 10;
  447|  39.2M|	  } else if (c >= 'a' && c <= 'f') {
  ------------------
  |  Branch (447:15): [True: 27.9M, False: 11.3M]
  |  Branch (447:27): [True: 6.09M, False: 21.8M]
  ------------------
  448|  6.09M|	    c2 += c - 'a' + 10;
  449|  33.1M|	  } else {
  450|  33.1M|	    error(errSyntaxError, getPos(),
  451|  33.1M|		  "Illegal character <{0:02x}> in hex string", c);
  452|  33.1M|	    ++nErrors;
  453|  33.1M|	  }
  454|  44.9M|	  if (++m == 2) {
  ------------------
  |  Branch (454:8): [True: 22.3M, False: 22.6M]
  ------------------
  455|  22.3M|	    if (n == tokBufSize) {
  ------------------
  |  |   19|  22.3M|#define tokBufSize 128		// size of token buffer
  ------------------
  |  Branch (455:10): [True: 3.74k, False: 22.3M]
  ------------------
  456|  3.74k|	      if (!s)
  ------------------
  |  Branch (456:12): [True: 1.98k, False: 1.76k]
  ------------------
  457|  1.98k|		s = new GString(tokBuf, tokBufSize);
  ------------------
  |  |   19|  1.98k|#define tokBufSize 128		// size of token buffer
  ------------------
  458|  1.76k|	      else
  459|  1.76k|		s->append(tokBuf, tokBufSize);
  ------------------
  |  |   19|  1.76k|#define tokBufSize 128		// size of token buffer
  ------------------
  460|  3.74k|	      p = tokBuf;
  461|  3.74k|	      n = 0;
  462|  3.74k|	    }
  463|  22.3M|	    *p++ = (char)c2;
  464|  22.3M|	    ++n;
  465|  22.3M|	    c2 = 0;
  466|  22.3M|	    m = 0;
  467|  22.3M|	  }
  468|  44.9M|	}
  469|  55.3M|      }
  470|   728k|      if (!s)
  ------------------
  |  Branch (470:11): [True: 726k, False: 1.98k]
  ------------------
  471|   726k|	s = new GString(tokBuf, n);
  472|  1.98k|      else
  473|  1.98k|	s->append(tokBuf, n);
  474|   728k|      if (m == 1)
  ------------------
  |  Branch (474:11): [True: 328k, False: 399k]
  ------------------
  475|   328k|	s->append((char)(c2 << 4));
  476|   728k|      obj->initString(s);
  477|   728k|    }
  478|  3.83M|    break;
  479|       |
  480|       |  // dict punctuation
  481|  2.85M|  case '>':
  ------------------
  |  Branch (481:3): [True: 2.85M, False: 41.3M]
  ------------------
  482|  2.85M|    c = lookChar();
  483|  2.85M|    if (c == '>') {
  ------------------
  |  Branch (483:9): [True: 1.76M, False: 1.08M]
  ------------------
  484|  1.76M|      getChar();
  485|  1.76M|      tokBuf[0] = tokBuf[1] = '>';
  486|  1.76M|      tokBuf[2] = '\0';
  487|  1.76M|      obj->initCmd(tokBuf);
  488|  1.76M|    } else {
  489|  1.08M|      error(errSyntaxError, getPos(), "Illegal character '>'");
  490|  1.08M|      obj->initError();
  491|  1.08M|    }
  492|  2.85M|    break;
  493|       |
  494|       |  // error
  495|   842k|  case ')':
  ------------------
  |  Branch (495:3): [True: 842k, False: 43.3M]
  ------------------
  496|  1.04M|  case '{':
  ------------------
  |  Branch (496:3): [True: 203k, False: 43.9M]
  ------------------
  497|  1.18M|  case '}':
  ------------------
  |  Branch (497:3): [True: 135k, False: 44.0M]
  ------------------
  498|  1.18M|    error(errSyntaxError, getPos(), "Illegal character '{0:c}'", c);
  499|  1.18M|    obj->initError();
  500|  1.18M|    break;
  501|       |
  502|       |  // command
  503|  17.5M|  default:
  ------------------
  |  Branch (503:3): [True: 17.5M, False: 26.5M]
  ------------------
  504|  17.5M|    p = tokBuf;
  505|  17.5M|    *p++ = (char)c;
  506|  17.5M|    n = 1;
  507|   229M|    while ((c = lookChar()) != EOF && !specialChars[c]) {
  ------------------
  |  Branch (507:12): [True: 229M, False: 25.6k]
  |  Branch (507:39): [True: 213M, False: 16.5M]
  ------------------
  508|   213M|      getChar();
  509|   213M|      if (++n == tokBufSize) {
  ------------------
  |  |   19|   213M|#define tokBufSize 128		// size of token buffer
  ------------------
  |  Branch (509:11): [True: 1.00M, False: 212M]
  ------------------
  510|  1.00M|	error(errSyntaxError, getPos(), "Command token too long");
  511|  1.00M|	break;
  512|  1.00M|      }
  513|   212M|      *p++ = (char)c;
  514|   212M|    }
  515|  17.5M|    *p = '\0';
  516|  17.5M|    if (tokBuf[0] == 't' && !strcmp(tokBuf, "true")) {
  ------------------
  |  Branch (516:9): [True: 1.99M, False: 15.6M]
  |  Branch (516:29): [True: 67.7k, False: 1.92M]
  ------------------
  517|  67.7k|      obj->initBool(gTrue);
  ------------------
  |  |   17|  67.7k|#define gTrue 1
  ------------------
  518|  17.5M|    } else if (tokBuf[0] == 'f' && !strcmp(tokBuf, "false")) {
  ------------------
  |  Branch (518:16): [True: 32.9k, False: 17.4M]
  |  Branch (518:36): [True: 1.82k, False: 31.1k]
  ------------------
  519|  1.82k|      obj->initBool(gFalse);
  ------------------
  |  |   18|  1.82k|#define gFalse 0
  ------------------
  520|  17.5M|    } else if (tokBuf[0] == 'n' && !strcmp(tokBuf, "null")) {
  ------------------
  |  Branch (520:16): [True: 118k, False: 17.4M]
  |  Branch (520:36): [True: 1.41k, False: 117k]
  ------------------
  521|  1.41k|      obj->initNull();
  522|  17.5M|    } else {
  523|  17.5M|      obj->initCmd(tokBuf);
  524|  17.5M|    }
  525|  17.5M|    break;
  526|  44.1M|  }
  527|       |
  528|  44.1M|  return obj;
  529|  44.1M|}
_ZN5Lexer14skipToNextLineEv:
  531|  94.3k|void Lexer::skipToNextLine() {
  532|  94.3k|  int c;
  533|       |
  534|   410k|  while (1) {
  ------------------
  |  Branch (534:10): [True: 410k, Folded]
  ------------------
  535|   410k|    c = getChar();
  536|   410k|    if (c == EOF || c == '\n') {
  ------------------
  |  Branch (536:9): [True: 2.70k, False: 407k]
  |  Branch (536:21): [True: 33.3k, False: 374k]
  ------------------
  537|  36.0k|      return;
  538|  36.0k|    }
  539|   374k|    if (c == '\r') {
  ------------------
  |  Branch (539:9): [True: 58.2k, False: 315k]
  ------------------
  540|  58.2k|      if ((c = lookChar()) == '\n') {
  ------------------
  |  Branch (540:11): [True: 53.3k, False: 4.90k]
  ------------------
  541|  53.3k|	getChar();
  542|  53.3k|      }
  543|  58.2k|      return;
  544|  58.2k|    }
  545|   374k|  }
  546|  94.3k|}
_ZN5Lexer9skipToEOFEv:
  548|  35.3k|void Lexer::skipToEOF() {
  549|  2.09M|  while (getChar() != EOF) ;
  ------------------
  |  Branch (549:10): [True: 2.06M, False: 35.3k]
  ------------------
  550|  35.3k|}
_ZN5Lexer7isSpaceEi:
  552|  42.9M|GBool Lexer::isSpace(int c) {
  553|  42.9M|  return c >= 0 && c <= 0xff && specialChars[c] == 1;
  ------------------
  |  Branch (553:10): [True: 42.9M, False: 9.58k]
  |  Branch (553:20): [True: 42.9M, False: 0]
  |  Branch (553:33): [True: 8.55M, False: 34.3M]
  ------------------
  554|  42.9M|}

_ZN5Lexer8skipCharEv:
   49|   293k|  void skipChar() { getChar(); }
_ZN5Lexer9getStreamEv:
   56|   369k|    { return curStr.isNone() ? (Stream *)NULL : curStr.getStream(); }
  ------------------
  |  Branch (56:14): [True: 2.70k, False: 366k]
  ------------------
_ZN5Lexer6getPosEv:
   60|  51.0M|    { return curStr.isNone() ? -1 : curStr.streamGetPos(); }
  ------------------
  |  Branch (60:14): [True: 446k, False: 50.5M]
  ------------------
_ZN5Lexer6setPosEli:
   64|  72.9k|    { if (!curStr.isNone()) curStr.streamSetPos(pos, dir); }
  ------------------
  |  Branch (64:11): [True: 72.9k, False: 0]
  ------------------

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

_ZN10LinkActionD2Ev:
   41|    622|  virtual ~LinkAction() {}
_ZN8LinkDest4isOkEv:
   85|    359|  GBool isOk() { return ok; }
_ZN8LinkGoTo4isOkEv:
  135|    377|  virtual GBool isOk() { return dest || namedDest; }
  ------------------
  |  Branch (135:33): [True: 240, False: 137]
  |  Branch (135:41): [True: 19, False: 118]
  ------------------
_ZN9LinkGoToR4isOkEv:
  165|    122|  virtual GBool isOk() { return fileName && (dest || namedDest); }
  ------------------
  |  Branch (165:33): [True: 18, False: 104]
  |  Branch (165:46): [True: 6, False: 12]
  |  Branch (165:54): [True: 2, False: 10]
  ------------------
_ZN7LinkURI4isOkEv:
  223|     44|  virtual GBool isOk() { return uri != NULL; }
_ZN14LinkJavaScript4isOkEv:
  296|     37|  virtual GBool isOk() { return js != NULL; }
_ZN11LinkUnknown4isOkEv:
  373|     42|  virtual GBool isOk() { return action != NULL; }

_ZN14NameToCharCodeC2Ev:
   25|  20.4k|NameToCharCode::NameToCharCode() {
   26|  20.4k|  int i;
   27|       |
   28|  20.4k|  size = 31;
   29|  20.4k|  len = 0;
   30|  20.4k|  tab = (NameToCharCodeEntry *)gmallocn(size, sizeof(NameToCharCodeEntry));
   31|   653k|  for (i = 0; i < size; ++i) {
  ------------------
  |  Branch (31:15): [True: 632k, False: 20.4k]
  ------------------
   32|       |    tab[i].name = NULL;
   33|   632k|  }
   34|  20.4k|}
_ZN14NameToCharCodeD2Ev:
   36|  20.4k|NameToCharCode::~NameToCharCode() {
   37|  20.4k|  int i;
   38|       |
   39|   172M|  for (i = 0; i < size; ++i) {
  ------------------
  |  Branch (39:15): [True: 172M, False: 20.4k]
  ------------------
   40|   172M|    if (tab[i].name) {
  ------------------
  |  Branch (40:9): [True: 45.5M, False: 126M]
  ------------------
   41|  45.5M|      gfree(tab[i].name);
   42|  45.5M|    }
   43|   172M|  }
   44|  20.4k|  gfree(tab);
   45|  20.4k|}
_ZN14NameToCharCode3addEPKcj:
   47|  45.5M|void NameToCharCode::add(const char *name, CharCode c) {
   48|  45.5M|  NameToCharCodeEntry *oldTab;
   49|  45.5M|  int h, i, oldSize;
   50|       |
   51|       |  // expand the table if necessary
   52|  45.5M|  if (len >= size / 2) {
  ------------------
  |  Branch (52:7): [True: 132k, False: 45.4M]
  ------------------
   53|   132k|    oldSize = size;
   54|   132k|    oldTab = tab;
   55|   132k|    size = 2*size + 1;
   56|   132k|    tab = (NameToCharCodeEntry *)gmallocn(size, sizeof(NameToCharCodeEntry));
   57|   343M|    for (h = 0; h < size; ++h) {
  ------------------
  |  Branch (57:17): [True: 343M, False: 132k]
  ------------------
   58|   343M|      tab[h].name = NULL;
   59|   343M|    }
   60|   171M|    for (i = 0; i < oldSize; ++i) {
  ------------------
  |  Branch (60:17): [True: 171M, False: 132k]
  ------------------
   61|   171M|      if (oldTab[i].name) {
  ------------------
  |  Branch (61:11): [True: 85.7M, False: 85.8M]
  ------------------
   62|  85.7M|	h = hash(oldTab[i].name);
   63|   125M|	while (tab[h].name) {
  ------------------
  |  Branch (63:9): [True: 39.5M, False: 85.7M]
  ------------------
   64|  39.5M|	  if (++h == size) {
  ------------------
  |  Branch (64:8): [True: 0, False: 39.5M]
  ------------------
   65|      0|	    h = 0;
   66|      0|	  }
   67|  39.5M|	}
   68|  85.7M|	tab[h] = oldTab[i];
   69|  85.7M|      }
   70|   171M|    }
   71|   132k|    gfree(oldTab);
   72|   132k|  }
   73|       |
   74|       |  // add the new name
   75|  45.5M|  h = hash(name);
   76|   189M|  while (tab[h].name && strcmp(tab[h].name, name)) {
  ------------------
  |  Branch (76:10): [True: 143M, False: 45.5M]
  |  Branch (76:25): [True: 143M, False: 10.2k]
  ------------------
   77|   143M|    if (++h == size) {
  ------------------
  |  Branch (77:9): [True: 30.6k, False: 143M]
  ------------------
   78|  30.6k|      h = 0;
   79|  30.6k|    }
   80|   143M|  }
   81|  45.5M|  if (!tab[h].name) {
  ------------------
  |  Branch (81:7): [True: 45.5M, False: 10.2k]
  ------------------
   82|  45.5M|    tab[h].name = copyString(name);
   83|  45.5M|  }
   84|  45.5M|  tab[h].c = c;
   85|       |
   86|  45.5M|  ++len;
   87|  45.5M|}
_ZN14NameToCharCode4hashEPKc:
  104|   131M|int NameToCharCode::hash(const char *name) {
  105|   131M|  const char *p;
  106|   131M|  unsigned int h;
  107|       |
  108|   131M|  h = 0;
  109|  1.54G|  for (p = name; *p; ++p) {
  ------------------
  |  Branch (109:18): [True: 1.41G, False: 131M]
  ------------------
  110|  1.41G|    h = 17 * h + (int)(*p & 0xff);
  111|  1.41G|  }
  112|   131M|  return (int)(h % size);
  113|   131M|}

_ZN6Object9initArrayEP4XRef:
   51|   665k|Object *Object::initArray(XRef *xref) {
   52|   665k|  initObj(objArray);
  ------------------
  |  |   77|   665k|#define initObj(t) type = t
  ------------------
   53|   665k|  array = new Array(xref);
   54|   665k|  return this;
   55|   665k|}
_ZN6Object8initDictEP4XRef:
   57|   576k|Object *Object::initDict(XRef *xref) {
   58|   576k|  initObj(objDict);
  ------------------
  |  |   77|   576k|#define initObj(t) type = t
  ------------------
   59|   576k|  dict = new Dict(xref);
   60|   576k|  return this;
   61|   576k|}
_ZN6Object8initDictEP4Dict:
   63|  4.78k|Object *Object::initDict(Dict *dictA) {
   64|  4.78k|  initObj(objDict);
  ------------------
  |  |   77|  4.78k|#define initObj(t) type = t
  ------------------
   65|  4.78k|  dict = dictA;
   66|  4.78k|  dict->incRef();
   67|  4.78k|  return this;
   68|  4.78k|}
_ZN6Object10initStreamEP6Stream:
   70|   437k|Object *Object::initStream(Stream *streamA) {
   71|   437k|  initObj(objStream);
  ------------------
  |  |   77|   437k|#define initObj(t) type = t
  ------------------
   72|   437k|  stream = streamA;
   73|   437k|  return this;
   74|   437k|}
_ZN6Object4copyEPS_:
   76|   156M|Object *Object::copy(Object *obj) {
   77|   156M|  *obj = *this;
   78|   156M|  switch (type) {
   79|   618k|  case objString:
  ------------------
  |  Branch (79:3): [True: 618k, False: 156M]
  ------------------
   80|   618k|    obj->string = string->copy();
   81|   618k|    break;
   82|  4.97M|  case objName:
  ------------------
  |  Branch (82:3): [True: 4.97M, False: 151M]
  ------------------
   83|  4.97M|    obj->name = copyString(name);
   84|  4.97M|    break;
   85|   645k|  case objArray:
  ------------------
  |  Branch (85:3): [True: 645k, False: 156M]
  ------------------
   86|   645k|    array->incRef();
   87|   645k|    break;
   88|  1.57M|  case objDict:
  ------------------
  |  Branch (88:3): [True: 1.57M, False: 155M]
  ------------------
   89|  1.57M|    dict->incRef();
   90|  1.57M|    break;
   91|   777k|  case objStream:
  ------------------
  |  Branch (91:3): [True: 777k, False: 156M]
  ------------------
   92|   777k|    obj->stream = stream->copy();
   93|   777k|    break;
   94|  18.3M|  case objCmd:
  ------------------
  |  Branch (94:3): [True: 18.3M, False: 138M]
  ------------------
   95|  18.3M|    obj->cmd = copyString(cmd);
   96|  18.3M|    break;
   97|   129M|  default:
  ------------------
  |  Branch (97:3): [True: 129M, False: 26.9M]
  ------------------
   98|   129M|    break;
   99|   156M|  }
  100|       |#ifdef DEBUG_OBJECT_MEM
  101|       |#if MULTITHREADED
  102|       |  gAtomicIncrement(&numAlloc[type]);
  103|       |#else
  104|       |  ++numAlloc[type];
  105|       |#endif
  106|       |#endif
  107|   156M|  return obj;
  108|   156M|}
_ZN6Object5fetchEP4XRefPS_i:
  110|  3.26M|Object *Object::fetch(XRef *xref, Object *obj, int recursion) {
  111|  3.26M|  return (type == objRef && xref) ?
  ------------------
  |  Branch (111:11): [True: 1.35M, False: 1.91M]
  |  Branch (111:29): [True: 1.35M, False: 3]
  ------------------
  112|  1.91M|         xref->fetch(ref.num, ref.gen, obj, recursion) : copy(obj);
  113|  3.26M|}
_ZN6Object4freeEv:
  115|   331M|void Object::free() {
  116|   331M|  switch (type) {
  117|  1.49M|  case objString:
  ------------------
  |  Branch (117:3): [True: 1.49M, False: 330M]
  ------------------
  118|  1.49M|    delete string;
  119|  1.49M|    break;
  120|  11.0M|  case objName:
  ------------------
  |  Branch (120:3): [True: 11.0M, False: 320M]
  ------------------
  121|  11.0M|    gfree(name);
  122|  11.0M|    break;
  123|  1.24M|  case objArray:
  ------------------
  |  Branch (123:3): [True: 1.24M, False: 330M]
  ------------------
  124|  1.24M|    if (!array->decRef()) {
  ------------------
  |  Branch (124:9): [True: 601k, False: 645k]
  ------------------
  125|   601k|      delete array;
  126|   601k|    }
  127|  1.24M|    break;
  128|  2.04M|  case objDict:
  ------------------
  |  Branch (128:3): [True: 2.04M, False: 329M]
  ------------------
  129|  2.04M|    if (!dict->decRef()) {
  ------------------
  |  Branch (129:9): [True: 465k, False: 1.58M]
  ------------------
  130|   465k|      delete dict;
  131|   465k|    }
  132|  2.04M|    break;
  133|  1.19M|  case objStream:
  ------------------
  |  Branch (133:3): [True: 1.19M, False: 330M]
  ------------------
  134|  1.19M|    delete stream;
  135|  1.19M|    break;
  136|  46.2M|  case objCmd:
  ------------------
  |  Branch (136:3): [True: 46.2M, False: 285M]
  ------------------
  137|  46.2M|    gfree(cmd);
  138|  46.2M|    break;
  139|   268M|  default:
  ------------------
  |  Branch (139:3): [True: 268M, False: 63.3M]
  ------------------
  140|   268M|    break;
  141|   331M|  }
  142|       |#ifdef DEBUG_OBJECT_MEM
  143|       |#if MULTITHREADED
  144|       |  gAtomicDecrement(&numAlloc[type]);
  145|       |#else
  146|       |  --numAlloc[type];
  147|       |#endif
  148|       |#endif
  149|   331M|  type = objNone;
  150|   331M|}
_ZN6Object11getTypeNameEv:
  152|   633k|const char *Object::getTypeName() {
  153|   633k|  return objTypeNames[type];
  154|   633k|}

_ZN6ObjectC2Ev:
   85|   374M|    type(objNone) {}
_ZN6Object8initNullEv:
   99|  55.9M|    { initObj(objNull); return this; }
  ------------------
  |  |   77|  55.9M|#define initObj(t) type = t
  ------------------
_ZN6Object8isStreamEv:
  134|  51.6M|  GBool isStream() { return type == objStream; }
_ZN6Object9getStreamEv:
  158|   657k|  Stream *getStream() { return stream; }
_ZN6Object8initBoolEi:
   89|  69.5k|    { initObj(objBool); booln = boolnA; return this; }
  ------------------
  |  |   77|  69.5k|#define initObj(t) type = t
  ------------------
_ZN6Object7initIntEi:
   91|  9.52M|    { initObj(objInt); intg = intgA; return this; }
  ------------------
  |  |   77|  9.52M|#define initObj(t) type = t
  ------------------
_ZN6Object8initRealEd:
   93|   515k|    { initObj(objReal); real = realA; return this; }
  ------------------
  |  |   77|   515k|#define initObj(t) type = t
  ------------------
_ZN6Object10initStringEP7GString:
   95|   924k|    { initObj(objString); string = stringA; return this; }
  ------------------
  |  |   77|   924k|#define initObj(t) type = t
  ------------------
_ZN6Object8initNameEPKc:
   97|  6.28M|    { initObj(objName); name = copyString(nameA); return this; }
  ------------------
  |  |   77|  6.28M|#define initObj(t) type = t
  ------------------
_ZN6Object7initRefEii:
  105|   561k|    { initObj(objRef); ref.num = numA; ref.gen = genA; return this; }
  ------------------
  |  |   77|   561k|#define initObj(t) type = t
  ------------------
_ZN6Object7initCmdEPc:
  107|  28.1M|    { initObj(objCmd); cmd = copyString(cmdA); return this; }
  ------------------
  |  |   77|  28.1M|#define initObj(t) type = t
  ------------------
_ZN6Object9initErrorEv:
  109|  2.27M|    { initObj(objError); return this; }
  ------------------
  |  |   77|  2.27M|#define initObj(t) type = t
  ------------------
_ZN6Object7initEOFEv:
  111|   121M|    { initObj(objEOF); return this; }
  ------------------
  |  |   77|   121M|#define initObj(t) type = t
  ------------------
_ZN6Object6isBoolEv:
  125|  10.0k|  GBool isBool() { return type == objBool; }
_ZN6Object5isIntEv:
  126|   214M|  GBool isInt() { return type == objInt; }
_ZN6Object5isNumEv:
  128|   180k|  GBool isNum() { return type == objInt || type == objReal; }
  ------------------
  |  Branch (128:26): [True: 26.7k, False: 153k]
  |  Branch (128:44): [True: 9.93k, False: 143k]
  ------------------
_ZN6Object8isStringEv:
  129|   142M|  GBool isString() { return type == objString; }
_ZN6Object6isNameEv:
  130|  15.8M|  GBool isName() { return type == objName; }
_ZN6Object6isNullEv:
  131|   520k|  GBool isNull() { return type == objNull; }
_ZN6Object7isArrayEv:
  132|  2.04M|  GBool isArray() { return type == objArray; }
_ZN6Object6isDictEv:
  133|  1.99M|  GBool isDict() { return type == objDict; }
_ZN6Object5isRefEv:
  135|  10.5M|  GBool isRef() { return type == objRef; }
_ZN6Object7isErrorEv:
  137|  2.40M|  GBool isError() { return type == objError; }
_ZN6Object5isEOFEv:
  138|  38.9M|  GBool isEOF() { return type == objEOF; }
_ZN6Object6isNoneEv:
  139|  2.30G|  GBool isNone() { return type == objNone; }
_ZN6Object6isNameEPKc:
  143|   614k|    { return type == objName && !strcmp(name, nameA); }
  ------------------
  |  Branch (143:14): [True: 489k, False: 124k]
  |  Branch (143:33): [True: 253k, False: 236k]
  ------------------
_ZN6Object5isCmdEPKc:
  147|   221M|    { return type == objCmd && !strcmp(cmd, cmdA); }
  ------------------
  |  Branch (147:14): [True: 60.4M, False: 160M]
  |  Branch (147:32): [True: 2.85M, False: 57.5M]
  ------------------
_ZN6Object7getBoolEv:
  150|  1.01k|  GBool getBool() { return booln; }
_ZN6Object6getIntEv:
  151|  5.35M|  int getInt() { return intg; }
_ZN6Object6getNumEv:
  153|  36.7k|  double getNum() { return type == objInt ? (double)intg : real; }
  ------------------
  |  Branch (153:28): [True: 26.7k, False: 9.98k]
  ------------------
_ZN6Object9getStringEv:
  154|  65.3k|  GString *getString() { return string; }
_ZN6Object7getNameEv:
  155|  2.46M|  char *getName() { return name; }
_ZN6Object8getArrayEv:
  156|    359|  Array *getArray() { return array; }
_ZN6Object7getDictEv:
  157|  1.02M|  Dict *getDict() { return dict; }
_ZN6Object6getRefEv:
  159|  67.8k|  Ref getRef() { return ref; }
_ZN6Object9getRefNumEv:
  160|  1.98M|  int getRefNum() { return ref.num; }
_ZN6Object9getRefGenEv:
  161|  1.15M|  int getRefGen() { return ref.gen; }
_ZN6Object14arrayGetLengthEv:
  233|  9.82M|  { return array->getLength(); }
_ZN6Object8arrayAddEPS_:
  236|  19.2M|  { array->add(elem); }
_ZN6Object8arrayGetEiPS_i:
  239|   176k|  { return array->get(i, obj, recursion); }
_ZN6Object10arrayGetNFEiPS_:
  242|  9.35M|  { return array->getNF(i, obj); }
_ZN6Object7dictAddEPcPS_:
  254|  2.36M|  { dict->add(key, val); }
_ZN6Object10dictLookupEPKcPS_i:
  263|   839k|  { return dict->lookup(key, obj, recursion); }
_ZN6Object12dictLookupNFEPKcPS_:
  266|  50.3k|  { return dict->lookupNF(key, obj); }
_ZN6Object11streamResetEv:
  290|   363k|  { stream->reset(); }
_ZN6Object11streamCloseEv:
  293|   358k|  { stream->close(); }
_ZN6Object13streamGetCharEv:
  296|  1.83G|  { return stream->getChar(); }
_ZN6Object14streamLookCharEv:
  299|   289M|  { return stream->lookChar(); }
_ZN6Object12streamGetPosEv:
  308|  50.5M|  { return stream->getPos(); }
_ZN6Object12streamSetPosEli:
  311|  72.9k|  { stream->setPos(pos, dir); }
_ZN6Object13streamGetDictEv:
  314|   649k|  { return stream->getDict(); }

_ZN15OptionalContentC2EP6PDFDoc:
   39|  2.56k|OptionalContent::OptionalContent(PDFDoc *doc) {
   40|  2.56k|  Object *ocProps;
   41|  2.56k|  Object ocgList, defView, uad, obj1, obj2, obj3, obj4;
   42|  2.56k|  Ref ref1;
   43|  2.56k|  OptionalContentGroup *ocg;
   44|  2.56k|  int i, j;
   45|       |
   46|  2.56k|  xref = doc->getXRef();
   47|  2.56k|  ocgs = new GList();
   48|  2.56k|  display = NULL;
   49|       |
   50|  2.56k|  if ((ocProps = doc->getCatalog()->getOCProperties())->isDict()) {
  ------------------
  |  Branch (50:7): [True: 464, False: 2.10k]
  ------------------
   51|    464|    if (ocProps->dictLookup("OCGs", &ocgList)->isArray()) {
  ------------------
  |  Branch (51:9): [True: 429, False: 35]
  ------------------
   52|       |
   53|       |      //----- read the OCG list
   54|  20.2k|      for (i = 0; i < ocgList.arrayGetLength(); ++i) {
  ------------------
  |  Branch (54:19): [True: 19.8k, False: 429]
  ------------------
   55|  19.8k|	if (ocgList.arrayGetNF(i, &obj1)->isRef()) {
  ------------------
  |  Branch (55:6): [True: 4.09k, False: 15.7k]
  ------------------
   56|  4.09k|	  ref1 = obj1.getRef();
   57|  4.09k|	  obj1.fetch(xref, &obj2);
   58|  4.09k|	  if ((ocg = OptionalContentGroup::parse(&ref1, &obj2))) {
  ------------------
  |  Branch (58:8): [True: 2.23k, False: 1.86k]
  ------------------
   59|  2.23k|	    ocgs->append(ocg);
   60|  2.23k|	  }
   61|  4.09k|	  obj2.free();
   62|  4.09k|	}
   63|  19.8k|	obj1.free();
   64|  19.8k|      }
   65|       |
   66|       |      //----- read the default viewing OCCD
   67|    429|      if (ocProps->dictLookup("D", &defView)->isDict()) {
  ------------------
  |  Branch (67:11): [True: 272, False: 157]
  ------------------
   68|       |
   69|       |	//----- read the usage app dicts
   70|    272|	if (defView.dictLookup("AS", &obj1)->isArray()) {
  ------------------
  |  Branch (70:6): [True: 37, False: 235]
  ------------------
   71|  2.23k|	  for (i = 0; i < obj1.arrayGetLength(); ++i) {
  ------------------
  |  Branch (71:16): [True: 2.19k, False: 37]
  ------------------
   72|  2.19k|	    if (obj1.arrayGet(i, &uad)->isDict()) {
  ------------------
  |  Branch (72:10): [True: 170, False: 2.02k]
  ------------------
   73|    170|	      if (uad.dictLookup("Event", &obj2)->isName("View")) {
  ------------------
  |  Branch (73:12): [True: 28, False: 142]
  ------------------
   74|     28|		if (uad.dictLookup("OCGs", &obj3)->isArray()) {
  ------------------
  |  Branch (74:7): [True: 25, False: 3]
  ------------------
   75|    284|		  for (j = 0; j < obj3.arrayGetLength(); ++j) {
  ------------------
  |  Branch (75:17): [True: 259, False: 25]
  ------------------
   76|    259|		    if (obj3.arrayGetNF(j, &obj4)->isRef()) {
  ------------------
  |  Branch (76:11): [True: 70, False: 189]
  ------------------
   77|     70|		      ref1 = obj4.getRef();
   78|     70|		      if ((ocg = findOCG(&ref1))) {
  ------------------
  |  Branch (78:13): [True: 29, False: 41]
  ------------------
   79|     29|			ocg->setInViewUsageAppDict();
   80|     29|		      }
   81|     70|		    }
   82|    259|		    obj4.free();
   83|    259|		  }
   84|     25|		}
   85|     28|		obj3.free();
   86|     28|	      }
   87|    170|	      obj2.free();
   88|    170|	    }
   89|  2.19k|	    uad.free();
   90|  2.19k|	  }
   91|     37|	}
   92|    272|	obj1.free();
   93|       |
   94|       |	//----- initial state from OCCD
   95|    272|	if (defView.dictLookup("OFF", &obj1)->isArray()) {
  ------------------
  |  Branch (95:6): [True: 32, False: 240]
  ------------------
   96|  2.32k|	  for (i = 0; i < obj1.arrayGetLength(); ++i) {
  ------------------
  |  Branch (96:16): [True: 2.29k, False: 32]
  ------------------
   97|  2.29k|	    if (obj1.arrayGetNF(i, &obj2)->isRef()) {
  ------------------
  |  Branch (97:10): [True: 847, False: 1.44k]
  ------------------
   98|    847|	      ref1 = obj2.getRef();
   99|    847|	      if ((ocg = findOCG(&ref1))) {
  ------------------
  |  Branch (99:12): [True: 219, False: 628]
  ------------------
  100|    219|		ocg->setState(gFalse);
  ------------------
  |  |   18|    219|#define gFalse 0
  ------------------
  101|    628|	      } else {
  102|    628|		error(errSyntaxError, -1,
  103|    628|		      "Invalid OCG reference in OFF array in default viewing OCCD");
  104|    628|	      }
  105|    847|	    }
  106|  2.29k|	    obj2.free();
  107|  2.29k|	  }
  108|     32|	}
  109|    272|	obj1.free();
  110|       |
  111|       |	//----- initial state from OCG usage dict
  112|    691|	for (i = 0; i < ocgs->getLength(); ++i) {
  ------------------
  |  Branch (112:14): [True: 419, False: 272]
  ------------------
  113|    419|	  ocg = (OptionalContentGroup *)ocgs->get(i);
  114|    419|	  if (ocg->getInViewUsageAppDict() &&
  ------------------
  |  Branch (114:8): [True: 28, False: 391]
  ------------------
  115|     28|	      ocg->getViewState() != ocUsageUnset) {
  ------------------
  |  Branch (115:8): [True: 0, False: 28]
  ------------------
  116|      0|	    ocg->setState(ocg->getViewState() == ocUsageOn);
  117|      0|	  }
  118|    419|	}
  119|       |
  120|       |	//----- display order
  121|    272|	if (defView.dictLookup("Order", &obj1)->isArray()) {
  ------------------
  |  Branch (121:6): [True: 228, False: 44]
  ------------------
  122|    228|	  display = OCDisplayNode::parse(&obj1, this, xref);
  123|    228|	}
  124|    272|	obj1.free();
  125|       |
  126|    272|      } else {
  127|    157|	error(errSyntaxError, -1, "Missing or invalid default viewing OCCD");
  128|    157|      }
  129|    429|      defView.free();
  130|       |
  131|    429|    }
  132|    464|    ocgList.free();
  133|    464|  }
  134|       |
  135|  2.56k|  if (!display) {
  ------------------
  |  Branch (135:7): [True: 2.33k, False: 228]
  ------------------
  136|  2.33k|    display = new OCDisplayNode();
  137|  2.33k|  }
  138|  2.56k|}
_ZN15OptionalContentD2Ev:
  140|  2.56k|OptionalContent::~OptionalContent() {
  141|  2.56k|  deleteGList(ocgs, OptionalContentGroup);
  ------------------
  |  |   94|  2.56k|  do {                                              \
  |  |   95|  2.56k|    GList *_list = (list);                          \
  |  |   96|  2.56k|    {                                               \
  |  |   97|  2.56k|      int _i;                                       \
  |  |   98|  4.79k|      for (_i = 0; _i < _list->getLength(); ++_i) { \
  |  |  ------------------
  |  |  |  Branch (98:20): [True: 2.23k, False: 2.56k]
  |  |  ------------------
  |  |   99|  2.23k|        delete (T*)_list->get(_i);                  \
  |  |  100|  2.23k|      }                                             \
  |  |  101|  2.56k|      delete _list;                                 \
  |  |  102|  2.56k|    }                                               \
  |  |  103|  2.56k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (103:12): [Folded, False: 2.56k]
  |  |  ------------------
  ------------------
  142|  2.56k|  delete display;
  143|  2.56k|}
_ZN15OptionalContent7findOCGEP3Ref:
  153|  28.4k|OptionalContentGroup *OptionalContent::findOCG(Ref *ref) {
  154|  28.4k|  OptionalContentGroup *ocg;
  155|  28.4k|  int i;
  156|       |
  157|  55.2k|  for (i = 0; i < ocgs->getLength(); ++i) {
  ------------------
  |  Branch (157:15): [True: 28.2k, False: 26.9k]
  ------------------
  158|  28.2k|    ocg = (OptionalContentGroup *)ocgs->get(i);
  159|  28.2k|    if (ocg->matches(ref)) {
  ------------------
  |  Branch (159:9): [True: 1.43k, False: 26.7k]
  ------------------
  160|  1.43k|      return ocg;
  161|  1.43k|    }
  162|  28.2k|  }
  163|  26.9k|  return NULL;
  164|  28.4k|}
_ZN20OptionalContentGroup5parseEP3RefP6Object:
  328|  4.09k|OptionalContentGroup *OptionalContentGroup::parse(Ref *refA, Object *obj) {
  329|  4.09k|  TextString *nameA;
  330|  4.09k|  Object obj1, obj2, obj3;
  331|  4.09k|  OCUsageState viewStateA, printStateA;
  332|       |
  333|  4.09k|  if (!obj->isDict()) {
  ------------------
  |  Branch (333:7): [True: 1.39k, False: 2.70k]
  ------------------
  334|  1.39k|    return NULL;
  335|  1.39k|  }
  336|  2.70k|  if (!obj->dictLookup("Name", &obj1)->isString()) {
  ------------------
  |  Branch (336:7): [True: 471, False: 2.23k]
  ------------------
  337|    471|    error(errSyntaxError, -1, "Missing or invalid Name in OCG");
  338|    471|    obj1.free();
  339|    471|    return NULL;
  340|    471|  }
  341|  2.23k|  nameA = new TextString(obj1.getString());
  342|  2.23k|  obj1.free();
  343|       |
  344|  2.23k|  viewStateA = printStateA = ocUsageUnset;
  345|  2.23k|  if (obj->dictLookup("Usage", &obj1)->isDict()) {
  ------------------
  |  Branch (345:7): [True: 51, False: 2.18k]
  ------------------
  346|     51|    if (obj1.dictLookup("View", &obj2)->isDict()) {
  ------------------
  |  Branch (346:9): [True: 19, False: 32]
  ------------------
  347|     19|      if (obj2.dictLookup("ViewState", &obj3)->isName()) {
  ------------------
  |  Branch (347:11): [True: 9, False: 10]
  ------------------
  348|      9|	if (obj3.isName("ON")) {
  ------------------
  |  Branch (348:6): [True: 7, False: 2]
  ------------------
  349|      7|	  viewStateA = ocUsageOn;
  350|      7|	} else {
  351|      2|	  viewStateA = ocUsageOff;
  352|      2|	}
  353|      9|      }
  354|     19|      obj3.free();
  355|     19|    }
  356|     51|    obj2.free();
  357|     51|    if (obj1.dictLookup("Print", &obj2)->isDict()) {
  ------------------
  |  Branch (357:9): [True: 19, False: 32]
  ------------------
  358|     19|      if (obj2.dictLookup("PrintState", &obj3)->isName()) {
  ------------------
  |  Branch (358:11): [True: 9, False: 10]
  ------------------
  359|      9|	if (obj3.isName("ON")) {
  ------------------
  |  Branch (359:6): [True: 7, False: 2]
  ------------------
  360|      7|	  printStateA = ocUsageOn;
  361|      7|	} else {
  362|      2|	  printStateA = ocUsageOff;
  363|      2|	}
  364|      9|      }
  365|     19|      obj3.free();
  366|     19|    }
  367|     51|    obj2.free();
  368|     51|  }
  369|  2.23k|  obj1.free();
  370|       |
  371|  2.23k|  return new OptionalContentGroup(refA, nameA, viewStateA, printStateA);
  372|  2.70k|}
_ZN20OptionalContentGroupC2EP3RefP10TextString12OCUsageStateS4_:
  376|  2.23k|					   OCUsageState printStateA) {
  377|  2.23k|  ref = *refA;
  378|  2.23k|  name = nameA;
  379|  2.23k|  viewState = viewStateA;
  380|  2.23k|  printState = printStateA;
  381|  2.23k|  state = gTrue;
  ------------------
  |  |   17|  2.23k|#define gTrue 1
  ------------------
  382|  2.23k|  inViewUsageAppDict = gFalse;
  ------------------
  |  |   18|  2.23k|#define gFalse 0
  ------------------
  383|  2.23k|}
_ZN20OptionalContentGroupD2Ev:
  385|  2.23k|OptionalContentGroup::~OptionalContentGroup() {
  386|  2.23k|  delete name;
  387|  2.23k|}
_ZN20OptionalContentGroup7matchesEP3Ref:
  389|  28.2k|GBool OptionalContentGroup::matches(Ref *refA) {
  390|  28.2k|  return refA->num == ref.num && refA->gen == ref.gen;
  ------------------
  |  Branch (390:10): [True: 3.57k, False: 24.6k]
  |  Branch (390:34): [True: 1.43k, False: 2.14k]
  ------------------
  391|  28.2k|}
_ZN13OCDisplayNode5parseEP6ObjectP15OptionalContentP4XRefi:
  404|   568k|				    XRef *xref, int recursion) {
  405|   568k|  Object obj2, obj3;
  406|   568k|  Ref ref;
  407|   568k|  OptionalContentGroup *ocgA;
  408|   568k|  OCDisplayNode *node, *child;
  409|   568k|  int i;
  410|       |
  411|   568k|  if (recursion > displayNodeRecursionLimit) {
  ------------------
  |  |   35|   568k|#define displayNodeRecursionLimit 50
  ------------------
  |  Branch (411:7): [True: 72.6k, False: 496k]
  ------------------
  412|  72.6k|    error(errSyntaxError, -1, "Loop detected in optional content order");
  413|  72.6k|    return NULL;
  414|  72.6k|  }
  415|   496k|  if (obj->isRef()) {
  ------------------
  |  Branch (415:7): [True: 27.5k, False: 468k]
  ------------------
  416|  27.5k|    ref = obj->getRef();
  417|  27.5k|    if ((ocgA = oc->findOCG(&ref))) {
  ------------------
  |  Branch (417:9): [True: 1.18k, False: 26.3k]
  ------------------
  418|  1.18k|      return new OCDisplayNode(ocgA);
  419|  1.18k|    }
  420|  27.5k|  }
  421|   494k|  obj->fetch(xref, &obj2);
  422|   494k|  if (!obj2.isArray()) {
  ------------------
  |  Branch (422:7): [True: 408k, False: 86.7k]
  ------------------
  423|   408k|    obj2.free();
  424|   408k|    return NULL;
  425|   408k|  }
  426|  86.7k|  i = 0;
  427|  86.7k|  if (obj2.arrayGetLength() >= 1) {
  ------------------
  |  Branch (427:7): [True: 86.0k, False: 660]
  ------------------
  428|  86.0k|    if (obj2.arrayGet(0, &obj3)->isString()) {
  ------------------
  |  Branch (428:9): [True: 9.83k, False: 76.2k]
  ------------------
  429|  9.83k|      node = new OCDisplayNode(obj3.getString());
  430|  9.83k|      i = 1;
  431|  76.2k|    } else {
  432|  76.2k|      node = new OCDisplayNode();
  433|  76.2k|    }
  434|  86.0k|    obj3.free();
  435|  86.0k|  } else {
  436|    660|    node = new OCDisplayNode();
  437|    660|  }
  438|   655k|  for (; i < obj2.arrayGetLength(); ++i) {
  ------------------
  |  Branch (438:10): [True: 568k, False: 86.7k]
  ------------------
  439|   568k|    obj2.arrayGetNF(i, &obj3);
  440|   568k|    if ((child = OCDisplayNode::parse(&obj3, oc, xref, recursion + 1))) {
  ------------------
  |  Branch (440:9): [True: 87.6k, False: 480k]
  ------------------
  441|  87.6k|      if (!child->ocg && !child->name && node->getNumChildren() > 0) {
  ------------------
  |  Branch (441:11): [True: 86.4k, False: 1.18k]
  |  Branch (441:26): [True: 0, False: 86.4k]
  |  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|  87.6k|      } else {
  448|  87.6k|	node->addChild(child);
  449|  87.6k|      }
  450|  87.6k|    }
  451|   568k|    obj3.free();
  452|   568k|  }
  453|  86.7k|  obj2.free();
  454|  86.7k|  return node;
  455|   494k|}
_ZN13OCDisplayNodeC2Ev:
  457|  79.2k|OCDisplayNode::OCDisplayNode() {
  458|  79.2k|  name = new TextString();
  459|  79.2k|  ocg = NULL;
  460|  79.2k|  parent = NULL;
  461|       |  children = NULL;
  462|  79.2k|}
_ZN13OCDisplayNodeC2EP7GString:
  464|  9.83k|OCDisplayNode::OCDisplayNode(GString *nameA) {
  465|  9.83k|  name = new TextString(nameA);
  466|  9.83k|  ocg = NULL;
  467|       |  children = NULL;
  468|  9.83k|}
_ZN13OCDisplayNodeC2EP20OptionalContentGroup:
  470|  1.18k|OCDisplayNode::OCDisplayNode(OptionalContentGroup *ocgA) {
  471|  1.18k|  name = new TextString(ocgA->name);
  472|  1.18k|  ocg = ocgA;
  473|       |  children = NULL;
  474|  1.18k|}
_ZN13OCDisplayNode8addChildEPS_:
  476|  87.6k|void OCDisplayNode::addChild(OCDisplayNode *child) {
  477|  87.6k|  if (!children) {
  ------------------
  |  Branch (477:7): [True: 60.5k, False: 27.1k]
  ------------------
  478|  60.5k|    children = new GList();
  479|  60.5k|  }
  480|  87.6k|  children->append(child);
  481|  87.6k|  child->parent = this;
  482|  87.6k|}
_ZN13OCDisplayNodeD2Ev:
  509|  90.2k|OCDisplayNode::~OCDisplayNode() {
  510|  90.2k|  delete name;
  511|  90.2k|  if (children) {
  ------------------
  |  Branch (511:7): [True: 60.5k, False: 29.7k]
  ------------------
  512|  60.5k|    deleteGList(children, OCDisplayNode);
  ------------------
  |  |   94|  60.5k|  do {                                              \
  |  |   95|  60.5k|    GList *_list = (list);                          \
  |  |   96|  60.5k|    {                                               \
  |  |   97|  60.5k|      int _i;                                       \
  |  |   98|   148k|      for (_i = 0; _i < _list->getLength(); ++_i) { \
  |  |  ------------------
  |  |  |  Branch (98:20): [True: 87.6k, False: 60.5k]
  |  |  ------------------
  |  |   99|  87.6k|        delete (T*)_list->get(_i);                  \
  |  |  100|  87.6k|      }                                             \
  |  |  101|  60.5k|      delete _list;                                 \
  |  |  102|  60.5k|    }                                               \
  |  |  103|  60.5k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (103:12): [Folded, False: 60.5k]
  |  |  ------------------
  ------------------
  513|  60.5k|  }
  514|  90.2k|}

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

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

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

_ZN6PDFDoc4isOkEv:
   58|  10.1k|  GBool isOk() { return ok; }
_ZN6PDFDoc7getXRefEv:
   70|  1.08M|  XRef *getXRef() { return xref; }
_ZN6PDFDoc11getFileNameEv:
   64|  2.56k|  GString *getFileName() { return fileName; }
_ZN6PDFDoc10getCatalogEv:
   73|  2.56k|  Catalog *getCatalog() { return catalog; }
_ZN6PDFDoc11getNumPagesEv:
   94|   316k|  int getNumPages() { return catalog->getNumPages(); }
_ZN6PDFDoc7getCoreEv:
  186|    104|  PDFCore *getCore() { return core; }

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

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

_ZN6ParserC2EP4XRefP5Lexeri:
   22|   350k|Parser::Parser(XRef *xrefA, Lexer *lexerA, GBool allowStreamsA) {
   23|   350k|  xref = xrefA;
   24|   350k|  lexer = lexerA;
   25|   350k|  inlineImg = 0;
   26|   350k|  allowStreams = allowStreamsA;
   27|   350k|  lexer->getObj(&buf1);
   28|   350k|  lexer->getObj(&buf2);
   29|   350k|}
_ZN6ParserD2Ev:
   31|   350k|Parser::~Parser() {
   32|   350k|  buf1.free();
   33|   350k|  buf2.free();
   34|   350k|  delete lexer;
   35|   350k|}
_ZN6Parser6getObjEP6ObjectiPh14CryptAlgorithmiiii:
   40|   147M|		       int objNum, int objGen, int recursion) {
   41|   147M|  char *key;
   42|   147M|  Stream *str;
   43|   147M|  Object obj2;
   44|   147M|  int num;
   45|   147M|  DecryptStream *decrypt;
   46|   147M|  GString *s, *s2;
   47|   147M|  int c;
   48|       |
   49|       |  // refill buffer after inline image data
   50|   147M|  if (inlineImg == 2) {
  ------------------
  |  Branch (50:7): [True: 58.5k, False: 147M]
  ------------------
   51|  58.5k|    buf1.free();
   52|  58.5k|    buf2.free();
   53|  58.5k|    lexer->getObj(&buf1);
   54|  58.5k|    lexer->getObj(&buf2);
   55|  58.5k|    inlineImg = 0;
   56|  58.5k|  }
   57|       |
   58|       |  // array
   59|   147M|  if (!simpleOnly && recursion < objectRecursionLimit && buf1.isCmd("[")) {
  ------------------
  |  |   20|   169M|#define objectRecursionLimit 500
  ------------------
  |  Branch (59:7): [True: 21.7M, False: 125M]
  |  Branch (59:22): [True: 9.48M, False: 12.2M]
  |  Branch (59:58): [True: 665k, False: 8.82M]
  ------------------
   60|   665k|    shift();
   61|   665k|    obj->initArray(xref);
   62|  19.8M|    while (!buf1.isCmd("]") && !buf1.isEOF())
  ------------------
  |  Branch (62:12): [True: 19.6M, False: 274k]
  |  Branch (62:32): [True: 19.2M, False: 391k]
  ------------------
   63|  19.2M|      obj->arrayAdd(getObj(&obj2, gFalse, fileKey, encAlgorithm, keyLength,
  ------------------
  |  |   18|  19.2M|#define gFalse 0
  ------------------
   64|  19.2M|			   objNum, objGen, recursion + 1));
   65|   665k|    if (buf1.isEOF())
  ------------------
  |  Branch (65:9): [True: 391k, False: 274k]
  ------------------
   66|   391k|      error(errSyntaxError, getPos(), "End of file inside array");
   67|   665k|    shift();
   68|       |
   69|       |  // dictionary or stream
   70|   146M|  } else if (!simpleOnly && recursion < objectRecursionLimit &&
  ------------------
  |  |   20|   167M|#define objectRecursionLimit 500
  ------------------
  |  Branch (70:14): [True: 21.0M, False: 125M]
  |  Branch (70:29): [True: 8.82M, False: 12.2M]
  ------------------
   71|  8.82M|	     buf1.isCmd("<<")) {
  ------------------
  |  Branch (71:7): [True: 547k, False: 8.27M]
  ------------------
   72|   547k|    shift();
   73|   547k|    obj->initDict(xref);
   74|  16.2M|    while (!buf1.isCmd(">>") && !buf1.isEOF()) {
  ------------------
  |  Branch (74:12): [True: 15.7M, False: 476k]
  |  Branch (74:33): [True: 15.7M, False: 32.0k]
  ------------------
   75|  15.7M|      if (!buf1.isName()) {
  ------------------
  |  Branch (75:11): [True: 13.3M, False: 2.40M]
  ------------------
   76|  13.3M|	error(errSyntaxError, getPos(),
   77|  13.3M|	      "Dictionary key must be a name object");
   78|  13.3M|	shift();
   79|  13.3M|      } else {
   80|  2.40M|	key = copyString(buf1.getName());
   81|  2.40M|	shift();
   82|  2.40M|	if (buf1.isEOF() || buf1.isError()) {
  ------------------
  |  Branch (82:6): [True: 2.77k, False: 2.40M]
  |  Branch (82:22): [True: 36.8k, False: 2.36M]
  ------------------
   83|  39.6k|	  gfree(key);
   84|  39.6k|	  break;
   85|  39.6k|	}
   86|  2.36M|	obj->dictAdd(key, getObj(&obj2, gFalse,
  ------------------
  |  |   18|  2.36M|#define gFalse 0
  ------------------
   87|  2.36M|				 fileKey, encAlgorithm, keyLength,
   88|  2.36M|				 objNum, objGen, recursion + 1));
   89|  2.36M|      }
   90|  15.7M|    }
   91|   547k|    if (buf1.isEOF())
  ------------------
  |  Branch (91:9): [True: 34.7k, False: 512k]
  ------------------
   92|  34.7k|      error(errSyntaxError, getPos(), "End of file inside dictionary");
   93|       |    // stream objects are not allowed inside content streams or
   94|       |    // object streams
   95|   547k|    if (allowStreams && buf2.isCmd("stream")) {
  ------------------
  |  Branch (95:9): [True: 302k, False: 245k]
  |  Branch (95:25): [True: 94.3k, False: 207k]
  ------------------
   96|  94.3k|      if ((str = makeStream(obj, fileKey, encAlgorithm, keyLength,
  ------------------
  |  Branch (96:11): [True: 87.0k, False: 7.33k]
  ------------------
   97|  94.3k|			    objNum, objGen, recursion + 1))) {
   98|  87.0k|	obj->initStream(str);
   99|  87.0k|      } else {
  100|  7.33k|	obj->free();
  101|  7.33k|	obj->initError();
  102|  7.33k|      }
  103|   453k|    } else {
  104|   453k|      shift();
  105|   453k|    }
  106|       |
  107|       |  // indirect reference or integer
  108|   146M|  } else if (buf1.isInt()) {
  ------------------
  |  Branch (108:14): [True: 4.02M, False: 142M]
  ------------------
  109|  4.02M|    num = buf1.getInt();
  110|  4.02M|    shift();
  111|  4.02M|    if (buf1.isInt() && buf2.isCmd("R")) {
  ------------------
  |  Branch (111:9): [True: 1.62M, False: 2.39M]
  |  Branch (111:25): [True: 422k, False: 1.20M]
  ------------------
  112|   422k|      int gen = buf1.getInt();
  113|   422k|      if (num >= 0 && gen >= 0) {
  ------------------
  |  Branch (113:11): [True: 420k, False: 2.17k]
  |  Branch (113:23): [True: 419k, False: 833]
  ------------------
  114|   419k|	obj->initRef(num, gen);
  115|   419k|      } else {
  116|  3.01k|	error(errSyntaxError, getPos(),
  117|  3.01k|	      "Negative number or generation in indirect reference");
  118|  3.01k|	obj->initError();
  119|  3.01k|      }
  120|   422k|      shift();
  121|   422k|      shift();
  122|  3.59M|    } else {
  123|  3.59M|      obj->initInt(num);
  124|  3.59M|    }
  125|       |
  126|       |  // string
  127|   142M|  } else if (buf1.isString() && fileKey) {
  ------------------
  |  Branch (127:14): [True: 476k, False: 141M]
  |  Branch (127:33): [True: 15.0k, False: 461k]
  ------------------
  128|  15.0k|    s = buf1.getString();
  129|  15.0k|    s2 = new GString();
  130|  15.0k|    obj2.initNull();
  131|  15.0k|    decrypt = new DecryptStream(new MemStream(s->getCString(), 0,
  132|  15.0k|					      s->getLength(), &obj2),
  133|  15.0k|				fileKey, encAlgorithm, keyLength,
  134|  15.0k|				objNum, objGen);
  135|  15.0k|    decrypt->reset();
  136|   687k|    while ((c = decrypt->getChar()) != EOF) {
  ------------------
  |  Branch (136:12): [True: 672k, False: 15.0k]
  ------------------
  137|   672k|      s2->append((char)c);
  138|   672k|    }
  139|  15.0k|    delete decrypt;
  140|  15.0k|    obj->initString(s2);
  141|  15.0k|    shift();
  142|       |
  143|       |  // simple object
  144|   142M|  } else {
  145|   142M|    buf1.copy(obj);
  146|   142M|    shift();
  147|   142M|  }
  148|       |
  149|   147M|  return obj;
  150|   147M|}
_ZN6Parser10makeStreamEP6ObjectPh14CryptAlgorithmiiii:
  154|  94.3k|			   int objNum, int objGen, int recursion) {
  155|       |  // get stream start position
  156|  94.3k|  lexer->skipToNextLine();
  157|  94.3k|  Stream *curStr = lexer->getStream();
  158|  94.3k|  if (!curStr) {
  ------------------
  |  Branch (158:7): [True: 2.70k, False: 91.6k]
  ------------------
  159|  2.70k|    return NULL;
  160|  2.70k|  }
  161|  91.6k|  GFileOffset pos = curStr->getPos();
  162|       |
  163|  91.6k|  GBool haveLength = gFalse;
  ------------------
  |  |   18|  91.6k|#define gFalse 0
  ------------------
  164|  91.6k|  GFileOffset length = 0;
  165|  91.6k|  GFileOffset endPos;
  166|       |
  167|       |  // check for length in damaged file
  168|  91.6k|  if (xref && xref->getStreamEnd(pos, &endPos)) {
  ------------------
  |  Branch (168:7): [True: 90.8k, False: 798]
  |  Branch (168:15): [True: 43.7k, False: 47.1k]
  ------------------
  169|  43.7k|    length = endPos - pos;
  170|  43.7k|    haveLength = gTrue;
  ------------------
  |  |   17|  43.7k|#define gTrue 1
  ------------------
  171|       |
  172|       |  // get length from the stream object
  173|  47.9k|  } else {
  174|  47.9k|    Object obj;
  175|  47.9k|    dict->dictLookup("Length", &obj, recursion);
  176|  47.9k|    if (obj.isInt()) {
  ------------------
  |  Branch (176:9): [True: 29.2k, False: 18.6k]
  ------------------
  177|  29.2k|      length = (GFileOffset)(Guint)obj.getInt();
  178|  29.2k|      haveLength = gTrue;
  ------------------
  |  |   17|  29.2k|#define gTrue 1
  ------------------
  179|  29.2k|    } else {
  180|  18.6k|      error(errSyntaxError, getPos(),
  181|  18.6k|	    "Missing or invalid 'Length' attribute in stream");
  182|  18.6k|    }
  183|  47.9k|    obj.free();
  184|  47.9k|  }
  185|       |
  186|       |  // in badly damaged PDF files, we can run off the end of the input
  187|       |  // stream immediately after the "stream" token
  188|  91.6k|  if (!lexer->getStream()) {
  ------------------
  |  Branch (188:7): [True: 0, False: 91.6k]
  ------------------
  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|  91.6k|  BaseStream *baseStr =
  195|  91.6k|      (BaseStream *)lexer->getStream()->getBaseStream()->copy();
  196|       |
  197|       |  // 'Length' attribute is missing -- search for 'endstream'
  198|  91.6k|  if (!haveLength) {
  ------------------
  |  Branch (198:7): [True: 18.6k, False: 72.9k]
  ------------------
  199|  18.6k|    GBool foundEndstream = gFalse;
  ------------------
  |  |   18|  18.6k|#define gFalse 0
  ------------------
  200|  18.6k|    char endstreamBuf[8];
  201|  18.6k|    if ((curStr = lexer->getStream())) {
  ------------------
  |  Branch (201:9): [True: 18.6k, False: 0]
  ------------------
  202|  18.6k|      int c;
  203|  5.93M|      while ((c = curStr->getChar()) != EOF) {
  ------------------
  |  Branch (203:14): [True: 5.93M, False: 4.62k]
  ------------------
  204|  5.93M|	if (c == 'e' &&
  ------------------
  |  Branch (204:6): [True: 219k, False: 5.71M]
  ------------------
  205|   219k|	    curStr->getBlock(endstreamBuf, 8) == 8 &&
  ------------------
  |  Branch (205:6): [True: 217k, False: 1.66k]
  ------------------
  206|   217k|	    !memcmp(endstreamBuf, "ndstream", 8)) {
  ------------------
  |  Branch (206:6): [True: 14.0k, False: 203k]
  ------------------
  207|  14.0k|	  length = curStr->getPos() - 9 - pos;
  208|  14.0k|	  foundEndstream = gTrue;
  ------------------
  |  |   17|  14.0k|#define gTrue 1
  ------------------
  209|  14.0k|	  break;
  210|  14.0k|	}
  211|  5.93M|      }
  212|  18.6k|    }
  213|  18.6k|    if (!foundEndstream) {
  ------------------
  |  Branch (213:9): [True: 4.62k, False: 14.0k]
  ------------------
  214|  4.62k|      error(errSyntaxError, getPos(), "Couldn't find 'endstream' for stream");
  215|  4.62k|      delete baseStr;
  216|  4.62k|      return NULL;
  217|  4.62k|    }
  218|  18.6k|  }
  219|       |
  220|       |  // make new base stream
  221|  87.0k|  Stream *str = baseStr->makeSubStream(pos, gTrue, length, dict);
  ------------------
  |  |   17|  87.0k|#define gTrue 1
  ------------------
  222|       |
  223|       |  // look for the 'endstream' marker
  224|  87.0k|  if (haveLength) {
  ------------------
  |  Branch (224:7): [True: 72.9k, False: 14.0k]
  ------------------
  225|       |    // skip over stream data
  226|  72.9k|    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|  72.9k|    GBool foundEndstream = gFalse;
  ------------------
  |  |   18|  72.9k|#define gFalse 0
  ------------------
  235|  72.9k|    char endstreamBuf[8];
  236|  72.9k|    if ((curStr = lexer->getStream())) {
  ------------------
  |  Branch (236:9): [True: 72.9k, False: 0]
  ------------------
  237|       |      // skip up to 100 whitespace chars
  238|  72.9k|      int c;
  239|   184k|      for (int i = 0; i < 100; ++i) {
  ------------------
  |  Branch (239:23): [True: 183k, False: 1.02k]
  ------------------
  240|   183k|	c = curStr->getChar();
  241|   183k|	if (!Lexer::isSpace(c)) {
  ------------------
  |  Branch (241:6): [True: 71.9k, False: 111k]
  ------------------
  242|  71.9k|	  break;
  243|  71.9k|	}
  244|   183k|      }
  245|  72.9k|      if (c == 'e') {
  ------------------
  |  Branch (245:11): [True: 45.8k, False: 27.1k]
  ------------------
  246|  45.8k|	if (curStr->getBlock(endstreamBuf, 8) == 8 &&
  ------------------
  |  Branch (246:6): [True: 45.5k, False: 299]
  ------------------
  247|  45.5k|	    !memcmp(endstreamBuf, "ndstream", 8)) {
  ------------------
  |  Branch (247:6): [True: 43.9k, False: 1.61k]
  ------------------
  248|  43.9k|	  foundEndstream = gTrue;
  ------------------
  |  |   17|  43.9k|#define gTrue 1
  ------------------
  249|  43.9k|	}
  250|  45.8k|      }
  251|  72.9k|    }
  252|  72.9k|    if (!foundEndstream) {
  ------------------
  |  Branch (252:9): [True: 29.0k, False: 43.9k]
  ------------------
  253|  29.0k|      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|  29.0k|      Object obj;
  258|  29.0k|      dict->copy(&obj);
  259|  29.0k|      delete str;
  260|  29.0k|      length += 5000;
  261|  29.0k|      str = baseStr->makeSubStream(pos, gTrue, length, &obj);
  ------------------
  |  |   17|  29.0k|#define gTrue 1
  ------------------
  262|  29.0k|    }
  263|  72.9k|  }
  264|       |
  265|       |  // free the copied base stream
  266|  87.0k|  delete baseStr;
  267|       |
  268|       |  // handle decryption
  269|  87.0k|  if (fileKey) {
  ------------------
  |  Branch (269:7): [True: 4.61k, False: 82.3k]
  ------------------
  270|       |    // the 'Crypt' filter is used to mark unencrypted metadata streams
  271|       |    //~ this should also check for an empty DecodeParams entry
  272|  4.61k|    GBool encrypted = gTrue;
  ------------------
  |  |   17|  4.61k|#define gTrue 1
  ------------------
  273|  4.61k|    Object obj;
  274|  4.61k|    dict->dictLookup("Filter", &obj, recursion);
  275|  4.61k|    if (obj.isName("Crypt")) {
  ------------------
  |  Branch (275:9): [True: 71, False: 4.54k]
  ------------------
  276|     71|      encrypted = gFalse;
  ------------------
  |  |   18|     71|#define gFalse 0
  ------------------
  277|  4.54k|    } else if (obj.isArray() && obj.arrayGetLength() >= 1) {
  ------------------
  |  Branch (277:16): [True: 668, False: 3.88k]
  |  Branch (277:33): [True: 634, False: 34]
  ------------------
  278|    634|      Object obj2;
  279|    634|      if (obj.arrayGet(0, &obj2)->isName("Crypt")) {
  ------------------
  |  Branch (279:11): [True: 0, False: 634]
  ------------------
  280|      0|	encrypted = gFalse;
  ------------------
  |  |   18|      0|#define gFalse 0
  ------------------
  281|      0|      }
  282|    634|      obj2.free();
  283|    634|    }
  284|  4.61k|    obj.free();
  285|  4.61k|    if (encrypted) {
  ------------------
  |  Branch (285:9): [True: 4.54k, False: 71]
  ------------------
  286|  4.54k|      str = new DecryptStream(str, fileKey, encAlgorithm, keyLength,
  287|  4.54k|			      objNum, objGen);
  288|  4.54k|    }
  289|  4.61k|  }
  290|       |
  291|       |  // get filters
  292|  87.0k|  str = str->addFilters(dict, recursion);
  293|       |
  294|  87.0k|  return str;
  295|  91.6k|}
_ZN6Parser5shiftEv:
  297|   165M|void Parser::shift() {
  298|   165M|  if (inlineImg > 0) {
  ------------------
  |  Branch (298:7): [True: 528k, False: 164M]
  ------------------
  299|   528k|    if (inlineImg < 2) {
  ------------------
  |  Branch (299:9): [True: 293k, False: 234k]
  ------------------
  300|   293k|      ++inlineImg;
  301|   293k|    } else {
  302|       |      // in a damaged content stream, if 'ID' shows up in the middle
  303|       |      // of a dictionary, we need to reset
  304|   234k|      inlineImg = 0;
  305|   234k|    }
  306|   164M|  } else if (buf2.isCmd("ID")) {
  ------------------
  |  Branch (306:14): [True: 293k, False: 164M]
  ------------------
  307|   293k|    lexer->skipChar();		// skip char after 'ID' command
  308|   293k|    inlineImg = 1;
  309|   293k|  }
  310|   165M|  buf1.free();
  311|   165M|  buf1 = buf2;
  312|   165M|  if (inlineImg > 0)		// don't buffer inline image data
  ------------------
  |  Branch (312:7): [True: 587k, False: 164M]
  ------------------
  313|   587k|    buf2.initNull();
  314|   164M|  else
  315|   164M|    lexer->getObj(&buf2);
  316|   165M|}

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

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

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

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

_ZN10BaseStream13getBaseStreamEv:
  178|  91.6k|  virtual BaseStream *getBaseStream() { return this; }
_ZN10BaseStream7getDictEv:
  180|   649k|  virtual Dict *getDict() { return dict.getDict(); }
_ZN10BaseStream11getFileNameEv:
  181|  10.2k|  virtual GString *getFileName() { return NULL; }
_ZN12FilterStream6getPosEv:
  206|  11.9M|  virtual GFileOffset getPos() { return str->getPos(); }
_ZN12FilterStream7getDictEv:
  210|   472k|  virtual Dict *getDict() { return str->getDict(); }
_ZN15StreamPredictor4isOkEv:
  277|  8.78k|  GBool isOk() { return ok; }
_ZN15StreamPredictor12getPredictorEv:
  285|  5.55k|  int getPredictor() { return predictor; }
_ZN15StreamPredictor8getWidthEv:
  286|  5.55k|  int getWidth() { return width; }
_ZN15StreamPredictor9getNCompsEv:
  287|  5.55k|  int getNComps() { return nComps; }
_ZN15StreamPredictor8getNBitsEv:
  288|  5.55k|  int getNBits() { return nBits; }
_ZN9MemStream7getCharEv:
  366|   642M|    { return (bufPtr < bufEnd) ? (*bufPtr++ & 0xff) : EOF; }
  ------------------
  |  Branch (366:14): [True: 629M, False: 12.2M]
  ------------------
_ZN9MemStream8lookCharEv:
  368|   139M|    { return (bufPtr < bufEnd) ? (*bufPtr & 0xff) : EOF; }
  ------------------
  |  Branch (368:14): [True: 139M, False: 9.81k]
  ------------------
_ZN9MemStream6getPosEv:
  370|  56.0M|  virtual GFileOffset getPos() { return (GFileOffset)(bufPtr - buf); }
_ZN9MemStream8getStartEv:
  372|  20.3k|  virtual GFileOffset getStart() { return start; }
_ZN11EmbedStream5resetEv:
  405|  39.7k|  virtual void reset() {}
_ZN11EmbedStream6getPosEv:
  409|  38.1k|  virtual GFileOffset getPos() { return str->getPos(); }
_ZN14ASCIIHexStream7getCharEv:
  434|  43.8k|    { int c = lookChar(); buf = EOF; return c; }
_ZN13ASCII85Stream7getCharEv:
  459|  4.67M|    { int ch = lookChar(); ++index; return ch; }
_ZN15RunLengthStream7getCharEv:
  538|  12.8M|    { return (bufPtr >= bufEnd && !fillBuf()) ? EOF : (*bufPtr++ & 0xff); }
  ------------------
  |  Branch (538:15): [True: 1.08M, False: 11.7M]
  |  Branch (538:35): [True: 703k, False: 376k]
  ------------------
_ZN15RunLengthStream8lookCharEv:
  540|   484k|    { return (bufPtr >= bufEnd && !fillBuf()) ? EOF : (*bufPtr & 0xff); }
  ------------------
  |  Branch (540:15): [True: 8.03k, False: 476k]
  |  Branch (540:35): [True: 723, False: 7.31k]
  ------------------
_ZN14CCITTFaxStream7eatBitsEi:
  609|  67.3M|  void eatBits(int n) { if ((inputBits -= n) < 0) inputBits = 0; }
  ------------------
  |  Branch (609:29): [True: 3.36k, False: 67.3M]
  ------------------
_ZN9EOFStream5resetEv:
  873|  1.66k|  virtual void reset() {}
_ZN9EOFStream7getCharEv:
  874|    816|  virtual int getChar() { return EOF; }
_ZN9EOFStream8getBlockEPci:
  876|    289|  virtual int getBlock(char *blk, int size) { return 0; }

_ZN10TextStringC2Ev:
   21|  81.2k|TextString::TextString() {
   22|       |  u = NULL;
   23|  81.2k|  len = size = 0;
   24|  81.2k|}
_ZN10TextStringC2EP7GString:
   26|  15.6k|TextString::TextString(GString *s) {
   27|       |  u = NULL;
   28|  15.6k|  len = size = 0;
   29|  15.6k|  append(s);
   30|  15.6k|}
_ZN10TextStringC2EPS_:
   32|  1.18k|TextString::TextString(TextString *s) {
   33|  1.18k|  len = size = s->len;
   34|  1.18k|  if (len) {
  ------------------
  |  Branch (34:7): [True: 494, False: 690]
  ------------------
   35|    494|    u = (Unicode *)gmallocn(size, sizeof(Unicode));
   36|    494|    memcpy(u, s->u, len * sizeof(Unicode));
   37|    690|  } else {
   38|       |    u = NULL;
   39|    690|  }
   40|  1.18k|}
_ZN10TextStringD2Ev:
   42|  97.9k|TextString::~TextString() {
   43|  97.9k|  gfree(u);
   44|  97.9k|}
_ZN10TextString6appendEP7GString:
   53|  15.6k|TextString *TextString::append(GString *s) {
   54|  15.6k|  return insert(len, s);
   55|  15.6k|}
_ZN10TextString6insertEij:
   57|  31.7k|TextString *TextString::insert(int idx, Unicode c) {
   58|  31.7k|  if (idx >= 0 && idx <= len) {
  ------------------
  |  Branch (58:7): [True: 31.7k, False: 0]
  |  Branch (58:19): [True: 31.7k, False: 0]
  ------------------
   59|  31.7k|    expand(1);
   60|  31.7k|    if (idx < len) {
  ------------------
  |  Branch (60:9): [True: 31.7k, False: 0]
  ------------------
   61|  31.7k|      memmove(u + idx + 1, u + idx, (len - idx) * sizeof(Unicode));
   62|  31.7k|    }
   63|  31.7k|    u[idx] = c;
   64|  31.7k|    ++len;
   65|  31.7k|  }
   66|  31.7k|  return this;
   67|  31.7k|}
_ZN10TextString6insertEiPji:
   69|   184k|TextString *TextString::insert(int idx, Unicode *u2, int n) {
   70|   184k|  if (idx >= 0 && idx <= len) {
  ------------------
  |  Branch (70:7): [True: 184k, False: 0]
  |  Branch (70:19): [True: 184k, False: 0]
  ------------------
   71|   184k|    expand(n);
   72|   184k|    if (idx < len) {
  ------------------
  |  Branch (72:9): [True: 123k, False: 61.6k]
  ------------------
   73|   123k|      memmove(u + idx + n, u + idx, (len - idx) * sizeof(Unicode));
   74|   123k|    }
   75|   184k|    memcpy(u + idx, u2, n * sizeof(Unicode));
   76|   184k|    len += n;
   77|   184k|  }
   78|   184k|  return this;
   79|   184k|}
_ZN10TextString6insertEiP7GString:
   81|  47.9k|TextString *TextString::insert(int idx, GString *s) {
   82|  47.9k|  Unicode uBuf[100];
   83|  47.9k|  int n, i;
   84|       |
   85|  47.9k|  if (idx >= 0 && idx <= len) {
  ------------------
  |  Branch (85:7): [True: 47.9k, False: 0]
  |  Branch (85:19): [True: 47.9k, False: 0]
  ------------------
   86|       |    // look for a UTF-16BE BOM
   87|  47.9k|    if ((s->getChar(0) & 0xff) == 0xfe &&
  ------------------
  |  Branch (87:9): [True: 27.9k, False: 19.9k]
  ------------------
   88|  27.9k|	(s->getChar(1) & 0xff) == 0xff) {
  ------------------
  |  Branch (88:2): [True: 27.6k, False: 289]
  ------------------
   89|  27.6k|      i = 2;
   90|  27.6k|      n = 0;
   91|  3.79M|      while (getUTF16BE(s, &i, uBuf + n)) {
  ------------------
  |  Branch (91:14): [True: 3.76M, False: 27.6k]
  ------------------
   92|  3.76M|	++n;
   93|  3.76M|	if (n == sizeof(uBuf) / sizeof(Unicode)) {
  ------------------
  |  Branch (93:6): [True: 32.0k, False: 3.73M]
  ------------------
   94|  32.0k|	  insert(idx, uBuf, n);
   95|  32.0k|	  idx += n;
   96|  32.0k|	  n = 0;
   97|  32.0k|	}
   98|  3.76M|      }
   99|  27.6k|      if (n > 0) {
  ------------------
  |  Branch (99:11): [True: 27.2k, False: 401]
  ------------------
  100|  27.2k|	insert(idx, uBuf, n);
  101|  27.2k|      }
  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|  27.6k|    } else if ((s->getChar(0) & 0xff) == 0xff &&
  ------------------
  |  Branch (106:16): [True: 3.75k, False: 16.5k]
  ------------------
  107|  3.75k|	       (s->getChar(1) & 0xff) == 0xfe) {
  ------------------
  |  Branch (107:9): [True: 3.44k, False: 312]
  ------------------
  108|  3.44k|      i = 2;
  109|  3.44k|      n = 0;
  110|  8.75M|      while (getUTF16LE(s, &i, uBuf + n)) {
  ------------------
  |  Branch (110:14): [True: 8.75M, False: 3.44k]
  ------------------
  111|  8.75M|	++n;
  112|  8.75M|	if (n == sizeof(uBuf) / sizeof(Unicode)) {
  ------------------
  |  Branch (112:6): [True: 86.9k, False: 8.66M]
  ------------------
  113|  86.9k|	  insert(idx, uBuf, n);
  114|  86.9k|	  idx += n;
  115|  86.9k|	  n = 0;
  116|  86.9k|	}
  117|  8.75M|      }
  118|  3.44k|      if (n > 0) {
  ------------------
  |  Branch (118:11): [True: 1.54k, False: 1.89k]
  ------------------
  119|  1.54k|	insert(idx, uBuf, n);
  120|  1.54k|      }
  121|       |
  122|       |    // look for a UTF-8 BOM
  123|  16.8k|    } else if ((s->getChar(0) & 0xff) == 0xef &&
  ------------------
  |  Branch (123:16): [True: 1.44k, False: 15.4k]
  ------------------
  124|  1.44k|	       (s->getChar(1) & 0xff) == 0xbb &&
  ------------------
  |  Branch (124:9): [True: 1.27k, False: 167]
  ------------------
  125|  1.27k|	       (s->getChar(2) & 0xff) == 0xbf) {
  ------------------
  |  Branch (125:9): [True: 1.01k, False: 259]
  ------------------
  126|  1.01k|      i = 3;
  127|  1.01k|      n = 0;
  128|  3.67M|      while (getUTF8(s, &i, uBuf + n)) {
  ------------------
  |  Branch (128:14): [True: 3.67M, False: 1.01k]
  ------------------
  129|  3.67M|	++n;
  130|  3.67M|	if (n == sizeof(uBuf) / sizeof(Unicode)) {
  ------------------
  |  Branch (130:6): [True: 36.1k, False: 3.63M]
  ------------------
  131|  36.1k|	  insert(idx, uBuf, n);
  132|  36.1k|	  idx += n;
  133|  36.1k|	  n = 0;
  134|  36.1k|	}
  135|  3.67M|      }
  136|  1.01k|      if (n > 0) {
  ------------------
  |  Branch (136:11): [True: 945, False: 71]
  ------------------
  137|    945|	insert(idx, uBuf, n);
  138|    945|      }
  139|       |
  140|       |    // otherwise, use PDFDocEncoding
  141|  15.8k|    } else {
  142|  15.8k|      n = s->getLength();
  143|  15.8k|      expand(n);
  144|  15.8k|      if (idx < len) {
  ------------------
  |  Branch (144:11): [True: 6.13k, False: 9.69k]
  ------------------
  145|  6.13k|	memmove(u + idx + n, u + idx, (len - idx) * sizeof(Unicode));
  146|  6.13k|      }
  147|  19.2M|      for (i = 0; i < n; ++i) {
  ------------------
  |  Branch (147:19): [True: 19.1M, False: 15.8k]
  ------------------
  148|  19.1M|	u[idx + i] = pdfDocEncoding[s->getChar(i) & 0xff];
  149|  19.1M|      }
  150|  15.8k|      len += n;
  151|  15.8k|    }
  152|  47.9k|  }
  153|  47.9k|  return this;
  154|  47.9k|}
_ZN10TextString6expandEi:
  156|   232k|void TextString::expand(int delta) {
  157|   232k|  int newLen;
  158|       |
  159|   232k|  newLen = len + delta;
  160|   232k|  if (delta > INT_MAX - len) {
  ------------------
  |  Branch (160:7): [True: 0, False: 232k]
  ------------------
  161|       |    // trigger an out-of-memory error
  162|      0|    size = -1;
  163|   232k|  } else if (newLen <= size) {
  ------------------
  |  Branch (163:14): [True: 206k, False: 26.3k]
  ------------------
  164|   206k|    return;
  165|   206k|  } else if (size > 0 && size <= INT_MAX / 2 && size*2 >= newLen) {
  ------------------
  |  Branch (165:14): [True: 13.9k, False: 12.3k]
  |  Branch (165:26): [True: 13.9k, False: 0]
  |  Branch (165:49): [True: 13.1k, False: 856]
  ------------------
  166|  13.1k|    size *= 2;
  167|  13.2k|  } else {
  168|  13.2k|    size = newLen;
  169|  13.2k|  }
  170|  26.3k|  u = (Unicode *)greallocn(u, size, sizeof(Unicode));
  171|  26.3k|}
_ZN10TextString6toUTF8Ev:
  201|    129|GString *TextString::toUTF8() {
  202|    129|  GString *s = new GString();
  203|  56.7k|  for (int i = 0; i < len; ++i) {
  ------------------
  |  Branch (203:19): [True: 56.6k, False: 129]
  ------------------
  204|  56.6k|    char buf[8];
  205|  56.6k|    int n = mapUTF8(u[i], buf, sizeof(buf));
  206|  56.6k|    s->append(buf, n);
  207|  56.6k|  }
  208|    129|  return s;
  209|    129|}

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

_Z7mapUTF8jPci:
   12|  56.6k|int mapUTF8(Unicode u, char *buf, int bufSize) {
   13|  56.6k|  if        (u <= 0x0000007f) {
  ------------------
  |  Branch (13:14): [True: 53.4k, False: 3.15k]
  ------------------
   14|  53.4k|    if (bufSize < 1) {
  ------------------
  |  Branch (14:9): [True: 0, False: 53.4k]
  ------------------
   15|      0|      return 0;
   16|      0|    }
   17|  53.4k|    buf[0] = (char)u;
   18|  53.4k|    return 1;
   19|  53.4k|  } else if (u <= 0x000007ff) {
  ------------------
  |  Branch (19:14): [True: 982, False: 2.17k]
  ------------------
   20|    982|    if (bufSize < 2) {
  ------------------
  |  Branch (20:9): [True: 0, False: 982]
  ------------------
   21|      0|      return 0;
   22|      0|    }
   23|    982|    buf[0] = (char)(0xc0 + (u >> 6));
   24|    982|    buf[1] = (char)(0x80 + (u & 0x3f));
   25|    982|    return 2;
   26|  2.17k|  } else if (u <= 0x0000ffff) {
  ------------------
  |  Branch (26:14): [True: 2.02k, False: 151]
  ------------------
   27|  2.02k|    if (bufSize < 3) {
  ------------------
  |  Branch (27:9): [True: 0, False: 2.02k]
  ------------------
   28|      0|      return 0;
   29|      0|    }
   30|  2.02k|    buf[0] = (char)(0xe0 + (u >> 12));
   31|  2.02k|    buf[1] = (char)(0x80 + ((u >> 6) & 0x3f));
   32|  2.02k|    buf[2] = (char)(0x80 + (u & 0x3f));
   33|  2.02k|    return 3;
   34|  2.02k|  } else if (u <= 0x0010ffff) {
  ------------------
  |  Branch (34:14): [True: 52, False: 99]
  ------------------
   35|     52|    if (bufSize < 4) {
  ------------------
  |  Branch (35:9): [True: 0, False: 52]
  ------------------
   36|      0|      return 0;
   37|      0|    }
   38|     52|    buf[0] = (char)(0xf0 + (u >> 18));
   39|     52|    buf[1] = (char)(0x80 + ((u >> 12) & 0x3f));
   40|     52|    buf[2] = (char)(0x80 + ((u >> 6) & 0x3f));
   41|     52|    buf[3] = (char)(0x80 + (u & 0x3f));
   42|     52|    return 4;
   43|     99|  } else {
   44|     99|    return 0;
   45|     99|  }
   46|  56.6k|}
_Z7getUTF8P7GStringPiPj:
   61|  3.67M|GBool getUTF8(GString *s, int *i, Unicode *u) {
   62|  3.67M|  Guchar c0, c1, c2, c3, c4, c5;
   63|       |
   64|  3.67M|  if (*i >= s->getLength()) {
  ------------------
  |  Branch (64:7): [True: 1.01k, False: 3.67M]
  ------------------
   65|  1.01k|    return gFalse;
  ------------------
  |  |   18|  1.01k|#define gFalse 0
  ------------------
   66|  1.01k|  }
   67|  3.67M|  c0 = (Guchar)s->getChar((*i)++);
   68|  3.67M|  if (c0 < 0x80) {
  ------------------
  |  Branch (68:7): [True: 2.88M, False: 784k]
  ------------------
   69|  2.88M|    *u = (Unicode)c0;
   70|  2.88M|  } else if (c0 < 0xe0) {
  ------------------
  |  Branch (70:14): [True: 490k, False: 294k]
  ------------------
   71|   490k|    if (*i < s->getLength() &&
  ------------------
  |  Branch (71:9): [True: 490k, False: 132]
  ------------------
   72|   490k|	((c1 = (Guchar)s->getChar(*i)) & 0xc0) == 0x80) {
  ------------------
  |  Branch (72:2): [True: 169k, False: 320k]
  ------------------
   73|   169k|      *i += 1;
   74|   169k|      *u = (Unicode)(((c0 & 0x1f) << 6) |
   75|   169k|		     (c1 & 0x3f));
   76|   320k|    } else {
   77|   320k|      *u =  (Unicode)c0;
   78|   320k|    }
   79|   490k|  } else if (c0 < 0xf0) {
  ------------------
  |  Branch (79:14): [True: 96.7k, False: 197k]
  ------------------
   80|  96.7k|    if (*i < s->getLength() - 1 &&
  ------------------
  |  Branch (80:9): [True: 96.2k, False: 537]
  ------------------
   81|  96.2k|	((c1 = (Guchar)s->getChar(*i)) & 0xc0) == 0x80 &&
  ------------------
  |  Branch (81:2): [True: 12.5k, False: 83.6k]
  ------------------
   82|  12.5k|	((c2 = (Guchar)s->getChar(*i + 1)) & 0xc0) == 0x80) {
  ------------------
  |  Branch (82:2): [True: 4.02k, False: 8.56k]
  ------------------
   83|  4.02k|      *i += 2;
   84|  4.02k|      *u = (Unicode)(((c0 & 0x0f) << 12) |
   85|  4.02k|		     ((c1 & 0x3f) << 6) |
   86|  4.02k|		     (c2 & 0x3f));
   87|  92.7k|    } else {
   88|  92.7k|      *u = (Unicode)c0;
   89|  92.7k|    }
   90|   197k|  } else if (c0 < 0xf8) {
  ------------------
  |  Branch (90:14): [True: 25.6k, False: 171k]
  ------------------
   91|  25.6k|    if (*i < s->getLength() - 2 &&
  ------------------
  |  Branch (91:9): [True: 25.6k, False: 35]
  ------------------
   92|  25.6k|	((c1 = (Guchar)s->getChar(*i)) & 0xc0) == 0x80 &&
  ------------------
  |  Branch (92:2): [True: 9.70k, False: 15.9k]
  ------------------
   93|  9.70k|	((c2 = (Guchar)s->getChar(*i + 1)) & 0xc0) == 0x80 &&
  ------------------
  |  Branch (93:2): [True: 4.19k, False: 5.51k]
  ------------------
   94|  4.19k|	((c3 = (Guchar)s->getChar(*i + 2)) & 0xc0) == 0x80) {
  ------------------
  |  Branch (94:2): [True: 2.04k, False: 2.15k]
  ------------------
   95|  2.04k|      *i += 3;
   96|  2.04k|      *u = (Unicode)(((c0 & 0x07) << 18) |
   97|  2.04k|		     ((c1 & 0x3f) << 12) |
   98|  2.04k|		     ((c2 & 0x3f) << 6) |
   99|  2.04k|		     (c3 & 0x3f));
  100|  23.6k|    } else {
  101|  23.6k|      *u = (Unicode)c0;
  102|  23.6k|    }
  103|   171k|  } else if (c0 < 0xfc) {
  ------------------
  |  Branch (103:14): [True: 6.33k, False: 165k]
  ------------------
  104|  6.33k|    if (*i < s->getLength() - 3 &&
  ------------------
  |  Branch (104:9): [True: 6.07k, False: 259]
  ------------------
  105|  6.07k|	((c1 = (Guchar)s->getChar(*i)) & 0xc0) == 0x80 &&
  ------------------
  |  Branch (105:2): [True: 1.21k, False: 4.86k]
  ------------------
  106|  1.21k|	((c2 = (Guchar)s->getChar(*i + 1)) & 0xc0) == 0x80 &&
  ------------------
  |  Branch (106:2): [True: 851, False: 360]
  ------------------
  107|    851|	((c3 = (Guchar)s->getChar(*i + 2)) & 0xc0) == 0x80 &&
  ------------------
  |  Branch (107:2): [True: 633, False: 218]
  ------------------
  108|    633|	((c4 = (Guchar)s->getChar(*i + 3)) & 0xc0) == 0x80) {
  ------------------
  |  Branch (108:2): [True: 542, False: 91]
  ------------------
  109|    542|      *i += 4;
  110|    542|      *u = (Unicode)(((c0 & 0x03) << 24) |
  111|    542|		     ((c1 & 0x3f) << 18) |
  112|    542|		     ((c2 & 0x3f) << 12) |
  113|    542|		     ((c3 & 0x3f) << 6) |
  114|    542|		     (c4 & 0x3f));
  115|  5.79k|    } else {
  116|  5.79k|      *u = (Unicode)c0;
  117|  5.79k|    }
  118|   165k|  } else if (c0 < 0xfe) {
  ------------------
  |  Branch (118:14): [True: 26.5k, False: 139k]
  ------------------
  119|  26.5k|    if (*i < s->getLength() - 4 &&
  ------------------
  |  Branch (119:9): [True: 25.8k, False: 692]
  ------------------
  120|  25.8k|	((c1 = (Guchar)s->getChar(*i)) & 0xc0) == 0x80 &&
  ------------------
  |  Branch (120:2): [True: 2.41k, False: 23.4k]
  ------------------
  121|  2.41k|	((c2 = (Guchar)s->getChar(*i + 1)) & 0xc0) == 0x80 &&
  ------------------
  |  Branch (121:2): [True: 1.90k, False: 505]
  ------------------
  122|  1.90k|	((c3 = (Guchar)s->getChar(*i + 2)) & 0xc0) == 0x80 &&
  ------------------
  |  Branch (122:2): [True: 1.77k, False: 131]
  ------------------
  123|  1.77k|	((c4 = (Guchar)s->getChar(*i + 3)) & 0xc0) == 0x80 &&
  ------------------
  |  Branch (123:2): [True: 1.56k, False: 208]
  ------------------
  124|  1.56k|	((c5 = (Guchar)s->getChar(*i + 4)) & 0xc0) == 0x80) {
  ------------------
  |  Branch (124:2): [True: 1.03k, False: 530]
  ------------------
  125|  1.03k|      *i += 5;
  126|  1.03k|      *u = (Unicode)(((c0 & 0x01) << 30) |
  127|  1.03k|		     ((c1 & 0x3f) << 24) |
  128|  1.03k|		     ((c2 & 0x3f) << 18) |
  129|  1.03k|		     ((c3 & 0x3f) << 12) |
  130|  1.03k|		     ((c4 & 0x3f) << 6) |
  131|  1.03k|		     (c5 & 0x3f));
  132|  25.5k|    } else {
  133|  25.5k|      *u = (Unicode)c0;
  134|  25.5k|    }
  135|   139k|  } else {
  136|   139k|    *u = (Unicode)c0;
  137|   139k|  }
  138|  3.67M|  return gTrue;
  ------------------
  |  |   17|  3.67M|#define gTrue 1
  ------------------
  139|  3.67M|}
_Z10getUTF16BEP7GStringPiPj:
  141|  3.79M|GBool getUTF16BE(GString *s, int *i, Unicode *u) {
  142|  3.79M|  int w0, w1;
  143|       |
  144|  3.79M|  if (*i >= s->getLength() - 1) {
  ------------------
  |  Branch (144:7): [True: 27.6k, False: 3.76M]
  ------------------
  145|  27.6k|    return gFalse;
  ------------------
  |  |   18|  27.6k|#define gFalse 0
  ------------------
  146|  27.6k|  }
  147|  3.76M|  w0 = ((s->getChar(*i) & 0xff) << 8) | (s->getChar(*i + 1) & 0xff);
  148|  3.76M|  *i += 2;
  149|  3.76M|  if (w0 < 0xd800 || w0 >= 0xe000) {
  ------------------
  |  Branch (149:7): [True: 3.35M, False: 409k]
  |  Branch (149:22): [True: 87.0k, False: 322k]
  ------------------
  150|  3.44M|    *u = (Unicode)w0;
  151|  3.44M|  } else {
  152|   322k|    if (*i < s->getLength() - 1) {
  ------------------
  |  Branch (152:9): [True: 322k, False: 456]
  ------------------
  153|   322k|      w1 = ((s->getChar(*i) & 0xff) << 8) | (s->getChar(*i + 1) & 0xff);
  154|   322k|      *i += 2;
  155|   322k|      *u = 0x10000 + ((w0 - 0xd800) << 10) + (w1 - 0xdc00);
  156|   322k|    } else {
  157|    456|      *u = (Unicode)w0;
  158|    456|    }
  159|   322k|  }
  160|  3.76M|  return gTrue;
  ------------------
  |  |   17|  3.76M|#define gTrue 1
  ------------------
  161|  3.79M|}
_Z10getUTF16LEP7GStringPiPj:
  163|  8.75M|GBool getUTF16LE(GString *s, int *i, Unicode *u) {
  164|  8.75M|  int w0, w1;
  165|       |
  166|  8.75M|  if (*i >= s->getLength() - 1) {
  ------------------
  |  Branch (166:7): [True: 3.44k, False: 8.75M]
  ------------------
  167|  3.44k|    return gFalse;
  ------------------
  |  |   18|  3.44k|#define gFalse 0
  ------------------
  168|  3.44k|  }
  169|  8.75M|  w0 = (s->getChar(*i) & 0xff) | ((s->getChar(*i + 1) & 0xff) << 8);
  170|  8.75M|  *i += 2;
  171|  8.75M|  if (w0 < 0xd800 || w0 >= 0xe000) {
  ------------------
  |  Branch (171:7): [True: 8.55M, False: 194k]
  |  Branch (171:22): [True: 180k, False: 14.3k]
  ------------------
  172|  8.73M|    *u = (Unicode)w0;
  173|  8.73M|  } else {
  174|  14.3k|    if (*i < s->getLength() - 1) {
  ------------------
  |  Branch (174:9): [True: 13.9k, False: 369]
  ------------------
  175|  13.9k|      w1 = (s->getChar(*i) & 0xff) | ((s->getChar(*i + 1) & 0xff) << 8);
  176|  13.9k|      *i += 2;
  177|  13.9k|      *u = 0x10000 + ((w0 - 0xd800) << 10) + (w1 - 0xdc00);
  178|  13.9k|    } else {
  179|    369|      *u = (Unicode)w0;
  180|    369|    }
  181|  14.3k|  }
  182|  8.75M|  return gTrue;
  ------------------
  |  |   17|  8.75M|#define gTrue 1
  ------------------
  183|  8.75M|}

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

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

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

_ZN18XFAFieldLayoutInfoC2E20XFAFieldLayoutHAlign20XFAFieldLayoutVAligndd:
   47|  1.63k|				       double marginRightA) {
   48|  1.63k|  hAlign = hAlignA;
   49|  1.63k|  vAlign = vAlignA;
   50|  1.63k|  marginLeft = marginLeftA;
   51|  1.63k|  marginRight = marginRightA;
   52|  1.63k|}
_ZN8XFAFieldC2EP7GStringS1_S1_P18XFAFieldLayoutInfoP19XFAFieldPictureInfoP19XFAFieldBarcodeInfo:
   95|  3.37k|  : name(nameA)
   96|  3.37k|  , fullName(fullNameA)
   97|  3.37k|  , value(valueA)
   98|  3.37k|  , layoutInfo(layoutInfoA)
   99|  3.37k|  , pictureInfo(pictureInfoA)
  100|  3.37k|  , barcodeInfo(barcodeInfoA)
  101|  3.37k|{
  102|  3.37k|}
_ZN8XFAFieldD2Ev:
  104|  3.37k|XFAField::~XFAField() {
  105|  3.37k|  delete name;
  106|  3.37k|  delete fullName;
  107|  3.37k|  delete value;
  108|  3.37k|  delete layoutInfo;
  109|  3.37k|  delete pictureInfo;
  110|  3.37k|  delete barcodeInfo;
  111|  3.37k|}
_ZN10XFAScanner4loadEP6Object:
  115|  1.08k|XFAScanner *XFAScanner::load(Object *xfaObj) {
  116|  1.08k|  GString *xfaData = readXFAStreams(xfaObj);
  117|  1.08k|  if (!xfaData) {
  ------------------
  |  Branch (117:7): [True: 55, False: 1.03k]
  ------------------
  118|     55|    return NULL;
  119|     55|  }
  120|  1.03k|  ZxDoc *xml = ZxDoc::loadMem(xfaData->getCString(), xfaData->getLength());
  121|  1.03k|  delete xfaData;
  122|  1.03k|  if (!xml) {
  ------------------
  |  Branch (122:7): [True: 360, False: 671]
  ------------------
  123|    360|    error(errSyntaxError, -1, "Invalid XML in XFA form");
  124|    360|    return NULL;
  125|    360|  }
  126|       |
  127|    671|  XFAScanner *scanner = new XFAScanner();
  128|       |
  129|    671|  if (xml->getRoot()) {
  ------------------
  |  Branch (129:7): [True: 670, False: 1]
  ------------------
  130|    670|    GHash *formValues = scanner->scanFormValues(xml->getRoot());
  131|    670|    ZxElement *dataElem = NULL;
  132|    670|    ZxElement *datasets =
  133|    670|        xml->getRoot()->findFirstChildElement("xfa:datasets");
  134|    670|    if (datasets) {
  ------------------
  |  Branch (134:9): [True: 41, False: 629]
  ------------------
  135|     41|      dataElem = datasets->findFirstChildElement("xfa:data");
  136|     41|    }
  137|    670|    ZxElement *tmpl = xml->getRoot()->findFirstChildElement("template");
  138|    670|    if (tmpl) {
  ------------------
  |  Branch (138:9): [True: 264, False: 406]
  ------------------
  139|    264|      scanner->scanNode(tmpl, NULL, NULL, NULL, NULL, NULL,
  140|    264|			dataElem, formValues);
  141|    264|    }
  142|    670|    deleteGHash(formValues, GString);
  ------------------
  |  |   60|    670|  do {                                             \
  |  |   61|    670|    GHash *_hash = (hash);                         \
  |  |   62|    670|    {                                              \
  |  |   63|    670|      GHashIter *_iter;                            \
  |  |   64|    670|      GString *_key;                               \
  |  |   65|    670|      void *_p;                                    \
  |  |   66|    670|      _hash->startIter(&_iter);                    \
  |  |   67|    983|      while (_hash->getNext(&_iter, &_key, &_p)) { \
  |  |  ------------------
  |  |  |  Branch (67:14): [True: 313, False: 670]
  |  |  ------------------
  |  |   68|    313|        delete (T*)_p;                             \
  |  |   69|    313|      }                                            \
  |  |   70|    670|      delete _hash;                                \
  |  |   71|    670|    }                                              \
  |  |   72|    670|  } while(0)
  |  |  ------------------
  |  |  |  Branch (72:11): [Folded, False: 670]
  |  |  ------------------
  ------------------
  143|    670|  }
  144|       |
  145|    671|  delete xml;
  146|       |
  147|    671|  return scanner;
  148|  1.03k|}
_ZN10XFAScannerC2Ev:
  150|    670|XFAScanner::XFAScanner() {
  151|    670|  fields = new GHash();
  152|    670|}
_ZN10XFAScannerD2Ev:
  154|    670|XFAScanner::~XFAScanner() {
  155|    670|  deleteGHash(fields, XFAField);
  ------------------
  |  |   60|    670|  do {                                             \
  |  |   61|    670|    GHash *_hash = (hash);                         \
  |  |   62|    670|    {                                              \
  |  |   63|    670|      GHashIter *_iter;                            \
  |  |   64|    670|      GString *_key;                               \
  |  |   65|    670|      void *_p;                                    \
  |  |   66|    670|      _hash->startIter(&_iter);                    \
  |  |   67|  4.04k|      while (_hash->getNext(&_iter, &_key, &_p)) { \
  |  |  ------------------
  |  |  |  Branch (67:14): [True: 3.37k, False: 670]
  |  |  ------------------
  |  |   68|  3.37k|        delete (T*)_p;                             \
  |  |   69|  3.37k|      }                                            \
  |  |   70|    670|      delete _hash;                                \
  |  |   71|    670|    }                                              \
  |  |   72|    670|  } while(0)
  |  |  ------------------
  |  |  |  Branch (72:11): [Folded, False: 670]
  |  |  ------------------
  ------------------
  156|    670|}
_ZN10XFAScanner9findFieldEP7GString:
  158|    129|XFAField *XFAScanner::findField(GString *acroFormFieldName) {
  159|    129|  return (XFAField *)fields->lookup(acroFormFieldName);
  160|    129|}
_ZN10XFAScanner14readXFAStreamsEP6Object:
  162|  1.08k|GString *XFAScanner::readXFAStreams(Object *xfaObj) {
  163|  1.08k|  GString *data = new GString();
  164|  1.08k|  char buf[4096];
  165|  1.08k|  int n;
  166|  1.08k|  if (xfaObj->isStream()) {
  ------------------
  |  Branch (166:7): [True: 10, False: 1.07k]
  ------------------
  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.07k|  } else if (xfaObj->isArray()) {
  ------------------
  |  Branch (171:14): [True: 1.07k, False: 1]
  ------------------
  172|  5.94k|    for (int i = 1; i < xfaObj->arrayGetLength(); i += 2) {
  ------------------
  |  Branch (172:21): [True: 4.92k, False: 1.02k]
  ------------------
  173|  4.92k|      Object obj;
  174|  4.92k|      if (!xfaObj->arrayGet(i, &obj)->isStream()) {
  ------------------
  |  Branch (174:11): [True: 54, False: 4.87k]
  ------------------
  175|     54|	error(errSyntaxError, -1, "XFA array element is wrong type");
  176|     54|	obj.free();
  177|     54|	delete data;
  178|     54|	return NULL;
  179|     54|      }
  180|  4.87k|      obj.streamReset();
  181|  24.8k|      while ((n = obj.getStream()->getBlock(buf, sizeof(buf))) > 0) {
  ------------------
  |  Branch (181:14): [True: 19.9k, False: 4.87k]
  ------------------
  182|  19.9k|	data->append(buf, n);
  183|  19.9k|      }
  184|  4.87k|      obj.free();
  185|  4.87k|    }
  186|  1.07k|  } else {
  187|      1|    error(errSyntaxError, -1, "XFA object is wrong type");
  188|      1|    return NULL;
  189|      1|  }
  190|  1.03k|  return data;
  191|  1.08k|}
_ZN10XFAScanner14scanFormValuesEP9ZxElement:
  193|    670|GHash *XFAScanner::scanFormValues(ZxElement *xmlRoot) {
  194|    670|  GHash *formValues = new GHash(gTrue);
  ------------------
  |  |   17|    670|#define gTrue 1
  ------------------
  195|    670|  ZxElement *formElem = xmlRoot->findFirstChildElement("form");
  196|    670|  if (formElem) {
  ------------------
  |  Branch (196:7): [True: 56, False: 614]
  ------------------
  197|       |    scanFormNode(formElem, NULL, formValues);
  198|     56|  }
  199|    670|  return formValues;
  200|    670|}
_ZN10XFAScanner12scanFormNodeEP9ZxElementP7GStringP5GHash:
  203|  1.98k|			      GHash *formValues) {
  204|  1.98k|  GHash *fullNameIdx = new GHash();
  205|  1.98k|  for (ZxNode *node = elem->getFirstChild();
  206|  34.6k|       node;
  ------------------
  |  Branch (206:8): [True: 32.6k, False: 1.98k]
  ------------------
  207|  32.6k|       node = node->getNextChild()) {
  208|  32.6k|    if (node->isElement("value")) {
  ------------------
  |  Branch (208:9): [True: 2.06k, False: 30.6k]
  ------------------
  209|  2.06k|      if (fullName) {
  ------------------
  |  Branch (209:11): [True: 1.57k, False: 481]
  ------------------
  210|  1.57k|	ZxNode *child1Node = ((ZxElement *)node)->getFirstChild();
  211|  1.57k|	if (child1Node && child1Node->isElement()) {
  ------------------
  |  Branch (211:6): [True: 1.26k, False: 310]
  |  Branch (211:20): [True: 1.16k, False: 102]
  ------------------
  212|  1.16k|	  ZxNode *child2Node = ((ZxElement *)child1Node)->getFirstChild();
  213|  1.16k|	  if (child2Node && child2Node->isCharData()) {
  ------------------
  |  Branch (213:8): [True: 724, False: 443]
  |  Branch (213:22): [True: 313, False: 411]
  ------------------
  214|    313|	    formValues->add(fullName->copy(),
  215|    313|			    ((ZxCharData *)child2Node)->getData()->copy());
  216|    313|	  }
  217|  1.16k|	}
  218|  1.57k|      }
  219|  30.6k|    } else if (node->isElement()) {
  ------------------
  |  Branch (219:16): [True: 15.4k, False: 15.1k]
  ------------------
  220|  15.4k|      ZxAttr *nameAttr = ((ZxElement *)node)->findAttr("name");
  221|  15.4k|      if (nameAttr && (node->isElement("subform") ||
  ------------------
  |  Branch (221:11): [True: 1.62k, False: 13.8k]
  |  Branch (221:24): [True: 510, False: 1.11k]
  ------------------
  222|  1.60k|		       node->isElement("field"))) {
  ------------------
  |  Branch (222:10): [True: 1.09k, False: 23]
  ------------------
  223|  1.60k|	GString *nodeName = nameAttr->getValue();
  224|  1.60k|	GString *childFullName;
  225|  1.60k|	if (fullName) {
  ------------------
  |  Branch (225:6): [True: 1.28k, False: 315]
  ------------------
  226|  1.28k|	  childFullName = GString::format("{0:t}.{1:t}", fullName, nodeName);
  227|  1.28k|	} else {
  228|    315|	  childFullName = nodeName->copy();
  229|    315|	}
  230|  1.60k|	int idx = fullNameIdx->lookupInt(nodeName);
  231|  1.60k|	childFullName->appendf("[{0:d}]", idx);
  232|  1.60k|	fullNameIdx->replace(nodeName, idx + 1);
  233|  1.60k|	scanFormNode((ZxElement *)node, childFullName, formValues);
  234|  1.60k|	delete childFullName;
  235|  13.8k|      } else if (node->isElement("subform")) {
  ------------------
  |  Branch (235:18): [True: 329, False: 13.5k]
  ------------------
  236|    329|	scanFormNode((ZxElement *)node, fullName, formValues);
  237|    329|      }
  238|  15.4k|    }
  239|  32.6k|  }
  240|  1.98k|  delete fullNameIdx;
  241|  1.98k|}
_ZN10XFAScanner8scanNodeEP9ZxElementP7GStringS3_P5GHashS5_S3_S1_S5_:
  247|   129k|			  GHash *formValues) {
  248|   129k|  GString *nodeName = getNodeName(elem);
  249|   129k|  GHash *childNameIdx;
  250|   129k|  if (!nameIdx || nodeName) {
  ------------------
  |  Branch (250:7): [True: 264, False: 129k]
  |  Branch (250:19): [True: 14.4k, False: 114k]
  ------------------
  251|  14.6k|    childNameIdx = new GHash();
  252|   114k|  } else {
  253|   114k|    childNameIdx = nameIdx;
  254|   114k|  }
  255|   129k|  GString *nodeFullName = getNodeFullName(elem);
  256|   129k|  GHash *childFullNameIdx;
  257|   129k|  if (!fullNameIdx || (nodeFullName && !elem->isElement("area"))) {
  ------------------
  |  Branch (257:7): [True: 264, False: 129k]
  |  Branch (257:24): [True: 14.4k, False: 114k]
  |  Branch (257:40): [True: 14.4k, False: 7]
  ------------------
  258|  14.6k|    childFullNameIdx = new GHash();
  259|   114k|  } else {
  260|   114k|    childFullNameIdx = fullNameIdx;
  261|   114k|  }
  262|       |
  263|   129k|  GString *childName;
  264|   129k|  if (nodeName) {
  ------------------
  |  Branch (264:7): [True: 14.4k, False: 114k]
  ------------------
  265|  14.4k|    if (parentName) {
  ------------------
  |  Branch (265:9): [True: 13.3k, False: 1.06k]
  ------------------
  266|  13.3k|      childName = GString::format("{0:t}.{1:t}", parentName, nodeName);
  267|  13.3k|    } else {
  268|  1.06k|      childName = nodeName->copy();
  269|  1.06k|    }
  270|  14.4k|    int idx = nameIdx->lookupInt(nodeName);
  271|  14.4k|    nameIdx->replace(nodeName, idx + 1);
  272|  14.4k|    if (nodeIsBindGlobal(elem)) {
  ------------------
  |  Branch (272:9): [True: 0, False: 14.4k]
  ------------------
  273|      0|      childName->appendf("[0]");
  274|  14.4k|    } else {
  275|  14.4k|      childName->appendf("[{0:d}]", idx);
  276|  14.4k|    }
  277|   114k|  } else {
  278|   114k|    childName = parentName;
  279|   114k|  }
  280|   129k|  GString *childFullName;
  281|   129k|  if (nodeFullName) {
  ------------------
  |  Branch (281:7): [True: 14.4k, False: 114k]
  ------------------
  282|  14.4k|    if (parentFullName) {
  ------------------
  |  Branch (282:9): [True: 13.3k, False: 1.07k]
  ------------------
  283|  13.3k|      childFullName = GString::format("{0:t}.{1:t}",
  284|  13.3k|				      parentFullName, nodeFullName);
  285|  13.3k|    } else {
  286|  1.07k|      childFullName = nodeFullName->copy();
  287|  1.07k|    }
  288|  14.4k|    int idx = fullNameIdx->lookupInt(nodeFullName);
  289|  14.4k|    fullNameIdx->replace(nodeFullName, idx + 1);
  290|  14.4k|    childFullName->appendf("[{0:d}]", idx);
  291|   114k|  } else {
  292|   114k|    childFullName = parentFullName;
  293|   114k|  }
  294|       |
  295|   129k|  if (elem->isElement("field")) {
  ------------------
  |  Branch (295:7): [True: 3.47k, False: 125k]
  ------------------
  296|  3.47k|    if (childName && childFullName) {
  ------------------
  |  Branch (296:9): [True: 3.37k, False: 102]
  |  Branch (296:22): [True: 3.37k, False: 0]
  ------------------
  297|  3.37k|      scanField(elem, childName, childFullName, exclGroupName,
  298|  3.37k|		dataElem, formValues);
  299|  3.37k|    }
  300|   125k|  } else {
  301|   125k|    GString *childExclGroupName;
  302|   125k|    if (elem->isElement("exclGroup")) {
  ------------------
  |  Branch (302:9): [True: 803, False: 125k]
  ------------------
  303|    803|      childExclGroupName = childName;
  304|   125k|    } else {
  305|   125k|      childExclGroupName = NULL;
  306|   125k|    }
  307|   125k|    for (ZxNode *child = elem->getFirstChild();
  308|   354k|	 child;
  ------------------
  |  Branch (308:3): [True: 228k, False: 125k]
  ------------------
  309|   228k|	 child = child->getNextChild()) {
  310|   228k|      if (child->isElement()) {
  ------------------
  |  Branch (310:11): [True: 129k, False: 99.2k]
  ------------------
  311|   129k|	scanNode((ZxElement *)child, childName, childFullName,
  312|   129k|		 childNameIdx, childFullNameIdx, childExclGroupName,
  313|   129k|		 dataElem, formValues);
  314|   129k|      }
  315|   228k|    }
  316|   125k|  }
  317|       |
  318|   129k|  if (childName != parentName) {
  ------------------
  |  Branch (318:7): [True: 14.4k, False: 114k]
  ------------------
  319|  14.4k|    delete childName;
  320|  14.4k|  }
  321|   129k|  if (childFullName != parentFullName) {
  ------------------
  |  Branch (321:7): [True: 14.4k, False: 114k]
  ------------------
  322|  14.4k|    delete childFullName;
  323|  14.4k|  }
  324|   129k|  if (childNameIdx != nameIdx) {
  ------------------
  |  Branch (324:7): [True: 14.6k, False: 114k]
  ------------------
  325|  14.6k|    delete childNameIdx;
  326|  14.6k|  }
  327|   129k|  if (childFullNameIdx != fullNameIdx) {
  ------------------
  |  Branch (327:7): [True: 14.6k, False: 114k]
  ------------------
  328|  14.6k|    delete childFullNameIdx;
  329|  14.6k|  }
  330|   129k|}
_ZN10XFAScanner9scanFieldEP9ZxElementP7GStringS3_S3_S1_P5GHash:
  334|  3.37k|			   GHash *formValues) {
  335|  3.37k|  GString *value = getFieldValue(elem, name, fullName, exclGroupName,
  336|  3.37k|				 dataElem, formValues);
  337|  3.37k|  XFAFieldLayoutInfo *layoutInfo = getFieldLayoutInfo(elem);
  338|  3.37k|  XFAFieldPictureInfo *pictureInfo = getFieldPictureInfo(elem);
  339|  3.37k|  XFAFieldBarcodeInfo *barcodeInfo = getFieldBarcodeInfo(elem);
  340|  3.37k|  XFAField *field = new XFAField(name->copy(), fullName->copy(), value,
  341|  3.37k|				 layoutInfo, pictureInfo, barcodeInfo);
  342|  3.37k|  fields->add(field->fullName, field);
  343|  3.37k|}
_ZN10XFAScanner13getFieldValueEP9ZxElementP7GStringS3_S3_S1_P5GHash:
  347|  3.37k|				   ZxElement *dataElem, GHash *formValues) {
  348|  3.37k|  GString *val = NULL;
  349|       |
  350|       |  //--- check the <xfa:datasets> packet
  351|  3.37k|  val = getDatasetsValue(name->getCString(), dataElem);
  352|  3.37k|  if (!val && exclGroupName) {
  ------------------
  |  Branch (352:7): [True: 3.26k, False: 114]
  |  Branch (352:15): [True: 478, False: 2.78k]
  ------------------
  353|    478|    val = (GString *)getDatasetsValue(exclGroupName->getCString(), dataElem);
  354|    478|  }
  355|       |
  356|       |  //--- check the <form> element
  357|  3.37k|  if (!val) {
  ------------------
  |  Branch (357:7): [True: 3.26k, False: 114]
  ------------------
  358|  3.26k|    val = (GString *)formValues->lookup(fullName);
  359|  3.26k|  }
  360|       |
  361|       |  //--- check the <value> element within the field
  362|  3.37k|  if (!val) {
  ------------------
  |  Branch (362:7): [True: 3.26k, False: 114]
  ------------------
  363|  3.26k|    ZxElement *valueElem = elem->findFirstChildElement("value");
  364|  3.26k|    if (valueElem) {
  ------------------
  |  Branch (364:9): [True: 1.60k, False: 1.66k]
  ------------------
  365|  1.60k|      ZxNode *child1Node = valueElem->getFirstChild();
  366|  1.60k|      if (child1Node && child1Node->isElement()) {
  ------------------
  |  Branch (366:11): [True: 1.40k, False: 192]
  |  Branch (366:25): [True: 1.36k, False: 48]
  ------------------
  367|  1.36k|	ZxNode *child2Node = ((ZxElement *)child1Node)->getFirstChild();
  368|  1.36k|	if (child2Node && child2Node->isCharData()) {
  ------------------
  |  Branch (368:6): [True: 896, False: 465]
  |  Branch (368:20): [True: 736, False: 160]
  ------------------
  369|    736|	  val = ((ZxCharData *)child2Node)->getData();
  370|    736|	}
  371|  1.36k|      }
  372|  1.60k|    }
  373|  3.26k|  }
  374|       |
  375|       |  //--- get the checkbutton item value
  376|  3.37k|  GString *checkbuttonItem = NULL;
  377|  3.37k|  ZxElement *uiElem = elem->findFirstChildElement("ui");
  378|  3.37k|  if (uiElem) {
  ------------------
  |  Branch (378:7): [True: 1.76k, False: 1.60k]
  ------------------
  379|  1.76k|    ZxNode *uiChild = uiElem->getFirstChild();
  380|  1.76k|    if (uiChild && uiChild->isElement("checkButton")) {
  ------------------
  |  Branch (380:9): [True: 1.54k, False: 219]
  |  Branch (380:20): [True: 1.38k, False: 169]
  ------------------
  381|  1.38k|      ZxElement *itemsElem = elem->findFirstChildElement("items");
  382|  1.38k|      if (itemsElem) {
  ------------------
  |  Branch (382:11): [True: 867, False: 513]
  ------------------
  383|    867|	ZxNode *node1 = itemsElem->getFirstChild();
  384|    867|	if (node1 && node1->isElement()) {
  ------------------
  |  Branch (384:6): [True: 819, False: 48]
  |  Branch (384:15): [True: 747, False: 72]
  ------------------
  385|    747|	  ZxNode *node2 = ((ZxElement *)node1)->getFirstChild();
  386|    747|	  if (node2 && node2->isCharData()) {
  ------------------
  |  Branch (386:8): [True: 442, False: 305]
  |  Branch (386:17): [True: 355, False: 87]
  ------------------
  387|    355|	    checkbuttonItem = ((ZxCharData *)node2)->getData();
  388|    355|	  }
  389|    747|	}
  390|    867|      }
  391|  1.38k|    }
  392|  1.76k|  }
  393|       |  // convert XFA checkbutton value to AcroForm-style On/Off value
  394|  3.37k|  if (checkbuttonItem && val) {
  ------------------
  |  Branch (394:7): [True: 355, False: 3.02k]
  |  Branch (394:26): [True: 334, False: 21]
  ------------------
  395|    334|    if (val->cmp(checkbuttonItem)) {
  ------------------
  |  Branch (395:9): [True: 241, False: 93]
  ------------------
  396|    241|      val = new GString("Off");
  397|    241|    } else {
  398|     93|      val = new GString("On");
  399|     93|    }
  400|  3.04k|  } else if (val) {
  ------------------
  |  Branch (400:14): [True: 516, False: 2.52k]
  ------------------
  401|    516|    val = val->copy();
  402|    516|  }
  403|       |
  404|  3.37k|  return val;
  405|  3.37k|}
_ZN10XFAScanner16getDatasetsValueEPcP9ZxElement:
  407|  10.4k|GString *XFAScanner::getDatasetsValue(char *partName, ZxElement *elem) {
  408|  10.4k|  if (!elem) {
  ------------------
  |  Branch (408:7): [True: 3.33k, False: 7.13k]
  ------------------
  409|  3.33k|    return NULL;
  410|  3.33k|  }
  411|       |
  412|       |  // partName = xxxx[nn].yyyy----
  413|  7.13k|  char *p = strchr(partName, '[');
  414|  7.13k|  if (!p) {
  ------------------
  |  Branch (414:7): [True: 274, False: 6.86k]
  ------------------
  415|    274|    return NULL;
  416|    274|  }
  417|  6.86k|  int partLen = (int)(p - partName);
  418|  6.86k|  int idx = atoi(p + 1);
  419|  6.86k|  p = strchr(p + 1, '.');
  420|  6.86k|  if (p) {
  ------------------
  |  Branch (420:7): [True: 6.09k, False: 770]
  ------------------
  421|  6.09k|    ++p;
  422|  6.09k|  }
  423|       |
  424|  6.86k|  int curIdx = 0;
  425|  6.86k|  for (ZxNode *node = elem->getFirstChild();
  426|  44.9k|       node;
  ------------------
  |  Branch (426:8): [True: 39.0k, False: 5.90k]
  ------------------
  427|  39.0k|       node = node->getNextChild()) {
  428|  39.0k|    if (!node->isElement()) {
  ------------------
  |  Branch (428:9): [True: 5.98k, False: 33.0k]
  ------------------
  429|  5.98k|      continue;
  430|  5.98k|    }
  431|  33.0k|    GString *nodeName = ((ZxElement *)node)->getType();
  432|  33.0k|    if (nodeName->getLength() != partLen ||
  ------------------
  |  Branch (432:9): [True: 31.4k, False: 1.53k]
  ------------------
  433|  31.7k|	strncmp(nodeName->getCString(), partName, partLen)) {
  ------------------
  |  Branch (433:2): [True: 302, False: 1.23k]
  ------------------
  434|  31.7k|      continue;
  435|  31.7k|    }
  436|  1.23k|    if (curIdx != idx) {
  ------------------
  |  Branch (436:9): [True: 274, False: 959]
  ------------------
  437|    274|      ++curIdx;
  438|    274|      continue;
  439|    274|    }
  440|    959|    if (p) {
  ------------------
  |  Branch (440:9): [True: 641, False: 318]
  ------------------
  441|    641|      GString *val = getDatasetsValue(p, (ZxElement *)node);
  442|    641|      if (val) {
  ------------------
  |  Branch (442:11): [True: 114, False: 527]
  ------------------
  443|    114|	return val;
  444|    114|      }
  445|    527|      break;
  446|    641|    } else {
  447|    318|      ZxNode *child = ((ZxElement *)node)->getFirstChild();
  448|    318|      if (!child || !child->isCharData()) {
  ------------------
  |  Branch (448:11): [True: 66, False: 252]
  |  Branch (448:21): [True: 138, False: 114]
  ------------------
  449|    204|	return NULL;
  450|    204|      }
  451|    114|      return ((ZxCharData *)child)->getData();
  452|    318|    }
  453|    959|  }
  454|       |
  455|       |  // search for an 'ancestor match'
  456|  6.42k|  if (p) {
  ------------------
  |  Branch (456:7): [True: 5.97k, False: 452]
  ------------------
  457|  5.97k|    return getDatasetsValue(p, elem);
  458|  5.97k|  }
  459|       |
  460|    452|  return NULL;
  461|  6.42k|}
_ZN10XFAScanner18getFieldLayoutInfoEP9ZxElement:
  463|  3.37k|XFAFieldLayoutInfo *XFAScanner::getFieldLayoutInfo(ZxElement *elem) {
  464|  3.37k|  ZxElement *paraElem = elem->findFirstChildElement("para");
  465|  3.37k|  if (!paraElem) {
  ------------------
  |  Branch (465:7): [True: 1.73k, False: 1.63k]
  ------------------
  466|  1.73k|    return NULL;
  467|  1.73k|  }
  468|  1.63k|  XFAFieldLayoutHAlign hAlign = xfaFieldLayoutHAlignLeft;
  469|  1.63k|  ZxAttr *hAlignAttr = paraElem->findAttr("hAlign");
  470|  1.63k|  if (hAlignAttr) {
  ------------------
  |  Branch (470:7): [True: 26, False: 1.61k]
  ------------------
  471|     26|    if (!hAlignAttr->getValue()->cmp("left")) {
  ------------------
  |  Branch (471:9): [True: 0, False: 26]
  ------------------
  472|      0|      hAlign = xfaFieldLayoutHAlignLeft;
  473|     26|    } else if (!hAlignAttr->getValue()->cmp("center")) {
  ------------------
  |  Branch (473:16): [True: 0, False: 26]
  ------------------
  474|      0|      hAlign = xfaFieldLayoutHAlignCenter;
  475|     26|    } else if (!hAlignAttr->getValue()->cmp("right")) {
  ------------------
  |  Branch (475:16): [True: 0, False: 26]
  ------------------
  476|      0|      hAlign = xfaFieldLayoutHAlignRight;
  477|      0|    }
  478|     26|  }
  479|  1.63k|  XFAFieldLayoutVAlign vAlign = xfaFieldLayoutVAlignTop;
  480|  1.63k|  ZxAttr *vAlignAttr = paraElem->findAttr("vAlign");
  481|  1.63k|  if (vAlignAttr) {
  ------------------
  |  Branch (481:7): [True: 949, False: 687]
  ------------------
  482|    949|    if (!vAlignAttr->getValue()->cmp("top")) {
  ------------------
  |  Branch (482:9): [True: 0, False: 949]
  ------------------
  483|      0|      vAlign = xfaFieldLayoutVAlignTop;
  484|    949|    } else if (!vAlignAttr->getValue()->cmp("middle")) {
  ------------------
  |  Branch (484:16): [True: 87, False: 862]
  ------------------
  485|     87|      vAlign = xfaFieldLayoutVAlignMiddle;
  486|    862|    } else if (!vAlignAttr->getValue()->cmp("bottom")) {
  ------------------
  |  Branch (486:16): [True: 0, False: 862]
  ------------------
  487|      0|      vAlign = xfaFieldLayoutVAlignBottom;
  488|      0|    }
  489|    949|  }
  490|  1.63k|  double marginLeft = 0;
  491|  1.63k|  double marginRight = 0;
  492|  1.63k|  ZxAttr *marginAttr;
  493|  1.63k|  if ((marginAttr = paraElem->findAttr("marginLeft"))) {
  ------------------
  |  Branch (493:7): [True: 0, False: 1.63k]
  ------------------
  494|      0|    marginLeft = getMeasurement(marginAttr->getValue());
  495|      0|  }
  496|  1.63k|  if ((marginAttr = paraElem->findAttr("marginRight"))) {
  ------------------
  |  Branch (496:7): [True: 0, False: 1.63k]
  ------------------
  497|      0|    marginRight = getMeasurement(marginAttr->getValue());
  498|      0|  }
  499|  1.63k|  return new XFAFieldLayoutInfo(hAlign, vAlign, marginLeft, marginRight);
  500|  3.37k|}
_ZN10XFAScanner19getFieldPictureInfoEP9ZxElement:
  502|  3.37k|XFAFieldPictureInfo *XFAScanner::getFieldPictureInfo(ZxElement *elem) {
  503|  3.37k|  ZxElement *uiElem = elem->findFirstChildElement("ui");
  504|  3.37k|  if (!uiElem) {
  ------------------
  |  Branch (504:7): [True: 1.60k, False: 1.76k]
  ------------------
  505|  1.60k|    return NULL;
  506|  1.60k|  }
  507|  1.76k|  XFAFieldPictureSubtype subtype;
  508|  1.76k|  if (uiElem->findFirstChildElement("dateTimeEdit")) {
  ------------------
  |  Branch (508:7): [True: 0, False: 1.76k]
  ------------------
  509|      0|    subtype = xfaFieldPictureDateTime;
  510|  1.76k|  } else if (uiElem->findFirstChildElement("numericEdit")) {
  ------------------
  |  Branch (510:14): [True: 0, False: 1.76k]
  ------------------
  511|      0|    subtype = xfaFieldPictureNumeric;
  512|  1.76k|  } else if (uiElem->findFirstChildElement("textEdit")) {
  ------------------
  |  Branch (512:14): [True: 0, False: 1.76k]
  ------------------
  513|      0|    subtype = xfaFieldPictureText;
  514|  1.76k|  } else {
  515|  1.76k|    return NULL;
  516|  1.76k|  }
  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.37k|XFAFieldBarcodeInfo *XFAScanner::getFieldBarcodeInfo(ZxElement *elem) {
  532|  3.37k|  ZxElement *uiElem, *barcodeElem;
  533|  3.37k|  if (!(uiElem = elem->findFirstChildElement("ui")) ||
  ------------------
  |  Branch (533:7): [True: 1.60k, False: 1.76k]
  ------------------
  534|  3.37k|      !(barcodeElem = uiElem->findFirstChildElement("barcode"))) {
  ------------------
  |  Branch (534:7): [True: 1.76k, False: 0]
  ------------------
  535|  3.37k|    return NULL;
  536|  3.37k|  }
  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|   129k|GString *XFAScanner::getNodeName(ZxElement *elem) {
  643|   129k|  if (elem->isElement("template") ||
  ------------------
  |  Branch (643:7): [True: 767, False: 128k]
  ------------------
  644|   128k|      elem->isElement("area") ||
  ------------------
  |  Branch (644:7): [True: 96, False: 128k]
  ------------------
  645|   128k|      elem->isElement("draw")) {
  ------------------
  |  Branch (645:7): [True: 232, False: 128k]
  ------------------
  646|  1.09k|    return NULL;
  647|  1.09k|  }
  648|   128k|  if (!elem->isElement("field") && nodeIsBindNone(elem)) {
  ------------------
  |  Branch (648:7): [True: 124k, False: 3.47k]
  |  Branch (648:36): [True: 0, False: 124k]
  ------------------
  649|      0|    return NULL;
  650|      0|  }
  651|   128k|  ZxAttr *nameAttr = elem->findAttr("name");
  652|   128k|  if (!nameAttr) {
  ------------------
  |  Branch (652:7): [True: 113k, False: 14.4k]
  ------------------
  653|   113k|    return NULL;
  654|   113k|  }
  655|  14.4k|  return nameAttr->getValue();
  656|   128k|}
_ZN10XFAScanner15getNodeFullNameEP9ZxElement:
  658|   129k|GString *XFAScanner::getNodeFullName(ZxElement *elem) {
  659|   129k|  if (elem->isElement("template") ||
  ------------------
  |  Branch (659:7): [True: 767, False: 128k]
  ------------------
  660|   128k|      elem->isElement("draw")) {
  ------------------
  |  Branch (660:7): [True: 232, False: 128k]
  ------------------
  661|    999|    return NULL;
  662|    999|  }
  663|   128k|  ZxAttr *nameAttr = elem->findAttr("name");
  664|   128k|  if (!nameAttr) {
  ------------------
  |  Branch (664:7): [True: 113k, False: 14.4k]
  ------------------
  665|   113k|    return NULL;
  666|   113k|  }
  667|  14.4k|  return nameAttr->getValue();
  668|   128k|}
_ZN10XFAScanner16nodeIsBindGlobalEP9ZxElement:
  670|  14.4k|GBool XFAScanner::nodeIsBindGlobal(ZxElement *elem) {
  671|  14.4k|  ZxElement *bindElem = elem->findFirstChildElement("bind");
  672|  14.4k|  if (!bindElem) {
  ------------------
  |  Branch (672:7): [True: 14.4k, False: 10]
  ------------------
  673|  14.4k|    return gFalse;
  ------------------
  |  |   18|  14.4k|#define gFalse 0
  ------------------
  674|  14.4k|  }
  675|     10|  ZxAttr *attr = bindElem->findAttr("match");
  676|     10|  return attr && !attr->getValue()->cmp("global");
  ------------------
  |  Branch (676:10): [True: 0, False: 10]
  |  Branch (676:18): [True: 0, False: 0]
  ------------------
  677|  14.4k|}
_ZN10XFAScanner14nodeIsBindNoneEP9ZxElement:
  679|   124k|GBool XFAScanner::nodeIsBindNone(ZxElement *elem) {
  680|   124k|  ZxElement *bindElem = elem->findFirstChildElement("bind");
  681|   124k|  if (!bindElem) {
  ------------------
  |  Branch (681:7): [True: 124k, False: 25]
  ------------------
  682|   124k|    return gFalse;
  ------------------
  |  |   18|   124k|#define gFalse 0
  ------------------
  683|   124k|  }
  684|     25|  ZxAttr *attr = bindElem->findAttr("match");
  685|     25|  return attr && !attr->getValue()->cmp("none");
  ------------------
  |  Branch (685:10): [True: 0, False: 25]
  |  Branch (685:18): [True: 0, False: 0]
  ------------------
  686|   124k|}

_ZN10XRefPosSetC2Ev:
   66|    499|XRefPosSet::XRefPosSet() {
   67|    499|  size = 16;
   68|    499|  len = 0;
   69|    499|  tab = (GFileOffset *)gmallocn(size, sizeof(GFileOffset));
   70|    499|}
_ZN10XRefPosSetD2Ev:
   72|    498|XRefPosSet::~XRefPosSet() {
   73|    498|  gfree(tab);
   74|    498|}
_ZN10XRefPosSet3addEl:
   76|    584|void XRefPosSet::add(GFileOffset pos) {
   77|    584|  int i;
   78|       |
   79|    584|  i = find(pos);
   80|    584|  if (i < len && tab[i] == pos) {
  ------------------
  |  Branch (80:7): [True: 24, False: 560]
  |  Branch (80:18): [True: 0, False: 24]
  ------------------
   81|      0|    return;
   82|      0|  }
   83|    584|  if (len == size) {
  ------------------
  |  Branch (83:7): [True: 0, False: 584]
  ------------------
   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|    584|  if (i < len) {
  ------------------
  |  Branch (90:7): [True: 24, False: 560]
  ------------------
   91|     24|    memmove(&tab[i + 1], &tab[i], (len - i) * sizeof(GFileOffset));
   92|     24|  }
   93|    584|  tab[i] = pos;
   94|    584|  ++len;
   95|    584|}
_ZN10XRefPosSet5checkEl:
   97|    599|GBool XRefPosSet::check(GFileOffset pos) {
   98|    599|  int i;
   99|       |
  100|    599|  i = find(pos);
  101|    599|  return i < len && tab[i] == pos;
  ------------------
  |  Branch (101:10): [True: 39, False: 560]
  |  Branch (101:21): [True: 15, False: 24]
  ------------------
  102|    599|}
_ZN10XRefPosSet4findEl:
  104|  1.18k|int XRefPosSet::find(GFileOffset pos) {
  105|  1.18k|  int a, b, m;
  106|       |
  107|  1.18k|  a = - 1;
  108|  1.18k|  b = len;
  109|       |  // invariant: tab[a] < pos < tab[b]
  110|  1.36k|  while (b - a > 1) {
  ------------------
  |  Branch (110:10): [True: 197, False: 1.16k]
  ------------------
  111|    197|    m = (a + b) / 2;
  112|    197|    if (tab[m] < pos) {
  ------------------
  |  Branch (112:9): [True: 130, False: 67]
  ------------------
  113|    130|      a = m;
  114|    130|    } else if (tab[m] > pos) {
  ------------------
  |  Branch (114:16): [True: 52, False: 15]
  ------------------
  115|     52|      b = m;
  116|     52|    } else {
  117|     15|      return m;
  118|     15|    }
  119|    197|  }
  120|  1.16k|  return b;
  121|  1.18k|}
_ZN12ObjectStreamC2EP4XRefii:
  154|   111k|ObjectStream::ObjectStream(XRef *xref, int objStrNumA, int recursion) {
  155|   111k|  Stream *str;
  156|   111k|  Lexer *lexer;
  157|   111k|  Parser *parser;
  158|   111k|  int *offsets;
  159|   111k|  Object objStr, obj1, obj2;
  160|   111k|  int first, i;
  161|       |
  162|   111k|  objStrNum = objStrNumA;
  163|   111k|  nObjects = 0;
  164|   111k|  objs = NULL;
  165|   111k|  objNums = NULL;
  166|   111k|  ok = gFalse;
  ------------------
  |  |   18|   111k|#define gFalse 0
  ------------------
  167|       |
  168|   111k|  if (!xref->fetch(objStrNum, 0, &objStr, recursion)->isStream()) {
  ------------------
  |  Branch (168:7): [True: 598, False: 110k]
  ------------------
  169|    598|    goto err1;
  170|    598|  }
  171|       |
  172|   110k|  if (!objStr.streamGetDict()->lookup("N", &obj1, recursion)->isInt()) {
  ------------------
  |  Branch (172:7): [True: 93, False: 110k]
  ------------------
  173|     93|    obj1.free();
  174|     93|    goto err1;
  175|     93|  }
  176|   110k|  nObjects = obj1.getInt();
  177|   110k|  obj1.free();
  178|   110k|  if (nObjects <= 0) {
  ------------------
  |  Branch (178:7): [True: 73, False: 110k]
  ------------------
  179|     73|    goto err1;
  180|     73|  }
  181|       |
  182|   110k|  if (!objStr.streamGetDict()->lookup("First", &obj1, recursion)->isInt()) {
  ------------------
  |  Branch (182:7): [True: 102k, False: 8.10k]
  ------------------
  183|   102k|    obj1.free();
  184|   102k|    goto err1;
  185|   102k|  }
  186|  8.10k|  first = obj1.getInt();
  187|  8.10k|  obj1.free();
  188|  8.10k|  if (first < 0) {
  ------------------
  |  Branch (188:7): [True: 37, False: 8.06k]
  ------------------
  189|     37|    goto err1;
  190|     37|  }
  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|  8.06k|  if (nObjects > 1000000) {
  ------------------
  |  Branch (195:7): [True: 78, False: 7.98k]
  ------------------
  196|     78|    error(errSyntaxError, -1, "Too many objects in an object stream");
  197|     78|    goto err1;
  198|     78|  }
  199|  7.98k|  objs = new Object[nObjects];
  200|  7.98k|  objNums = (int *)gmallocn(nObjects, sizeof(int));
  201|  7.98k|  offsets = (int *)gmallocn(nObjects, sizeof(int));
  202|       |
  203|       |  // parse the header: object numbers and offsets
  204|  7.98k|  objStr.streamReset();
  205|  7.98k|  obj1.initNull();
  206|  7.98k|  str = new EmbedStream(objStr.getStream(), &obj1, gTrue, first);
  ------------------
  |  |   17|  7.98k|#define gTrue 1
  ------------------
  207|  7.98k|  lexer = new Lexer(xref, str);
  208|  7.98k|  parser = new Parser(xref, lexer, gFalse);
  ------------------
  |  |   18|  7.98k|#define gFalse 0
  ------------------
  209|   163k|  for (i = 0; i < nObjects; ++i) {
  ------------------
  |  Branch (209:15): [True: 160k, False: 3.56k]
  ------------------
  210|   160k|    parser->getObj(&obj1, gTrue);
  ------------------
  |  |   17|   160k|#define gTrue 1
  ------------------
  211|   160k|    parser->getObj(&obj2, gTrue);
  ------------------
  |  |   17|   160k|#define gTrue 1
  ------------------
  212|   160k|    if (!obj1.isInt() || !obj2.isInt()) {
  ------------------
  |  Branch (212:9): [True: 1.19k, False: 159k]
  |  Branch (212:26): [True: 1.20k, False: 157k]
  ------------------
  213|  2.39k|      obj1.free();
  214|  2.39k|      obj2.free();
  215|  2.39k|      delete parser;
  216|  2.39k|      gfree(offsets);
  217|  2.39k|      goto err2;
  218|  2.39k|    }
  219|   157k|    objNums[i] = obj1.getInt();
  220|   157k|    offsets[i] = obj2.getInt();
  221|   157k|    obj1.free();
  222|   157k|    obj2.free();
  223|   157k|    if (objNums[i] < 0 || offsets[i] < 0 ||
  ------------------
  |  Branch (223:9): [True: 213, False: 157k]
  |  Branch (223:27): [True: 353, False: 157k]
  ------------------
  224|   157k|	(i > 0 && offsets[i] < offsets[i-1])) {
  ------------------
  |  Branch (224:3): [True: 150k, False: 7.01k]
  |  Branch (224:12): [True: 1.46k, False: 148k]
  ------------------
  225|  2.02k|      delete parser;
  226|  2.02k|      gfree(offsets);
  227|  2.02k|      goto err2;
  228|  2.02k|    }
  229|   157k|  }
  230|  3.56k|  lexer->skipToEOF();
  231|  3.56k|  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.56k|  if (offsets[0] > 0) {
  ------------------
  |  Branch (235:7): [True: 257, False: 3.30k]
  ------------------
  236|    257|    objStr.getStream()->discardChars(offsets[0]);
  237|    257|  }
  238|       |
  239|       |  // parse the objects
  240|  35.3k|  for (i = 0; i < nObjects; ++i) {
  ------------------
  |  Branch (240:15): [True: 31.7k, False: 3.56k]
  ------------------
  241|  31.7k|    obj1.initNull();
  242|  31.7k|    if (i == nObjects - 1) {
  ------------------
  |  Branch (242:9): [True: 3.56k, False: 28.2k]
  ------------------
  243|  3.56k|      str = new EmbedStream(objStr.getStream(), &obj1, gFalse, 0);
  ------------------
  |  |   18|  3.56k|#define gFalse 0
  ------------------
  244|  28.2k|    } else {
  245|  28.2k|      str = new EmbedStream(objStr.getStream(), &obj1, gTrue,
  ------------------
  |  |   17|  28.2k|#define gTrue 1
  ------------------
  246|  28.2k|			    offsets[i+1] - offsets[i]);
  247|  28.2k|    }
  248|  31.7k|    lexer = new Lexer(xref, str);
  249|  31.7k|    parser = new Parser(xref, lexer, gFalse);
  ------------------
  |  |   18|  31.7k|#define gFalse 0
  ------------------
  250|  31.7k|    parser->getObj(&objs[i]);
  251|  31.7k|    lexer->skipToEOF();
  252|  31.7k|    delete parser;
  253|  31.7k|  }
  254|       |
  255|  3.56k|  gfree(offsets);
  256|  3.56k|  ok = gTrue;
  ------------------
  |  |   17|  3.56k|#define gTrue 1
  ------------------
  257|       |
  258|  7.98k| err2:
  259|  7.98k|  objStr.streamClose();
  260|   111k| err1:
  261|   111k|  objStr.free();
  262|   111k|}
_ZN12ObjectStreamD2Ev:
  264|   111k|ObjectStream::~ObjectStream() {
  265|   111k|  int i;
  266|       |
  267|   111k|  if (objs) {
  ------------------
  |  Branch (267:7): [True: 7.98k, False: 103k]
  ------------------
  268|   260k|    for (i = 0; i < nObjects; ++i) {
  ------------------
  |  Branch (268:17): [True: 252k, False: 7.98k]
  ------------------
  269|   252k|      objs[i].free();
  270|   252k|    }
  271|  7.98k|    delete[] objs;
  272|  7.98k|  }
  273|   111k|  gfree(objNums);
  274|   111k|}
_ZN12ObjectStream9getObjectEiiP6Object:
  276|  28.9k|Object *ObjectStream::getObject(int objIdx, int objNum, Object *obj) {
  277|  28.9k|  if (objIdx < 0 || objIdx >= nObjects || objNum != objNums[objIdx]) {
  ------------------
  |  Branch (277:7): [True: 0, False: 28.9k]
  |  Branch (277:21): [True: 281, False: 28.6k]
  |  Branch (277:43): [True: 81, False: 28.5k]
  ------------------
  278|    362|    obj->initNull();
  279|  28.5k|  } else {
  280|  28.5k|    objs[objIdx].copy(obj);
  281|  28.5k|  }
  282|  28.9k|  return obj;
  283|  28.9k|}
_ZN4XRefC2EP10BaseStreami:
  289|  20.3k|XRef::XRef(BaseStream *strA, GBool repair) {
  290|  20.3k|  GFileOffset pos;
  291|  20.3k|  Object obj;
  292|  20.3k|  XRefPosSet *posSet;
  293|  20.3k|  int i;
  294|       |
  295|  20.3k|  ok = gTrue;
  ------------------
  |  |   17|  20.3k|#define gTrue 1
  ------------------
  296|  20.3k|  errCode = errNone;
  ------------------
  |  |   12|  20.3k|#define errNone             0	// no error
  ------------------
  297|  20.3k|  repaired = gFalse;
  ------------------
  |  |   18|  20.3k|#define gFalse 0
  ------------------
  298|  20.3k|  size = 0;
  299|  20.3k|  last = -1;
  300|  20.3k|  entries = NULL;
  301|  20.3k|  lastStartxrefPos = 0;
  302|  20.3k|  xrefTablePos = NULL;
  303|  20.3k|  xrefTablePosLen = 0;
  304|  20.3k|  streamEnds = NULL;
  305|  20.3k|  streamEndsLen = 0;
  306|  2.62M|  for (i = 0; i < objStrCacheSize; ++i) {
  ------------------
  |  |   51|  2.62M|#define objStrCacheSize 128
  ------------------
  |  Branch (306:15): [True: 2.60M, False: 20.3k]
  ------------------
  307|  2.60M|    objStrs[i] = NULL;
  308|  2.60M|    objStrLastUse[i] = 0;
  309|  2.60M|  }
  310|  20.3k|  objStrCacheLength = 0;
  311|  20.3k|  objStrTime = 0;
  312|       |
  313|  20.3k|  encrypted = gFalse;
  ------------------
  |  |   18|  20.3k|#define gFalse 0
  ------------------
  314|  20.3k|  permFlags = defPermFlags;
  ------------------
  |  |   41|  20.3k|#define defPermFlags 0xfffc
  ------------------
  315|  20.3k|  ownerPasswordOk = gFalse;
  ------------------
  |  |   18|  20.3k|#define gFalse 0
  ------------------
  316|       |
  317|   346k|  for (i = 0; i < xrefCacheSize; ++i) {
  ------------------
  |  |   49|   346k|#define xrefCacheSize 16
  ------------------
  |  Branch (317:15): [True: 325k, False: 20.3k]
  ------------------
  318|   325k|    cache[i].num = -1;
  319|   325k|  }
  320|       |
  321|  20.3k|#if MULTITHREADED
  322|  20.3k|  gInitMutex(&objStrsMutex);
  ------------------
  |  |   51|  20.3k|#define gInitMutex(m) pthread_mutex_init(m, NULL)
  ------------------
  323|  20.3k|  gInitMutex(&cacheMutex);
  ------------------
  |  |   51|  20.3k|#define gInitMutex(m) pthread_mutex_init(m, NULL)
  ------------------
  324|  20.3k|#endif
  325|       |
  326|  20.3k|  str = strA;
  327|  20.3k|  start = str->getStart();
  328|       |
  329|       |  // if the 'repair' flag is set, try to reconstruct the xref table
  330|  20.3k|  if (repair) {
  ------------------
  |  Branch (330:7): [True: 10.1k, False: 10.2k]
  ------------------
  331|  10.1k|    if (!(ok = constructXRef())) {
  ------------------
  |  Branch (331:9): [True: 7.12k, False: 3.03k]
  ------------------
  332|  7.12k|      errCode = errDamaged;
  ------------------
  |  |   18|  7.12k|#define errDamaged          3	// PDF file was damaged and couldn't be
  ------------------
  333|  7.12k|      return;
  334|  7.12k|    }
  335|  3.03k|    repaired = gTrue;
  ------------------
  |  |   17|  3.03k|#define gTrue 1
  ------------------
  336|       |
  337|       |  // if the 'repair' flag is not set, read the xref table
  338|  10.2k|  } else {
  339|       |
  340|       |    // read the trailer
  341|  10.2k|    pos = getStartXref();
  342|  10.2k|    if (pos == 0) {
  ------------------
  |  Branch (342:9): [True: 9.70k, False: 499]
  ------------------
  343|  9.70k|      errCode = errDamaged;
  ------------------
  |  |   18|  9.70k|#define errDamaged          3	// PDF file was damaged and couldn't be
  ------------------
  344|  9.70k|      ok = gFalse;
  ------------------
  |  |   18|  9.70k|#define gFalse 0
  ------------------
  345|  9.70k|      return;
  346|  9.70k|    }
  347|       |
  348|       |    // read the xref table
  349|    499|    posSet = new XRefPosSet();
  350|    596|    while (readXRef(&pos, posSet, gFalse)) ;
  ------------------
  |  |   18|    596|#define gFalse 0
  ------------------
  |  Branch (350:12): [True: 97, False: 499]
  ------------------
  351|    499|    xrefTablePosLen = posSet->getLength();
  352|    499|    xrefTablePos = (GFileOffset *)gmallocn(xrefTablePosLen,
  353|    499|					   sizeof(GFileOffset));
  354|  1.08k|    for (i = 0; i < xrefTablePosLen; ++i)  {
  ------------------
  |  Branch (354:17): [True: 583, False: 499]
  ------------------
  355|    583|      xrefTablePos[i] = posSet->get(i);
  356|    583|    }
  357|    499|    delete posSet;
  358|    499|    if (!ok) {
  ------------------
  |  Branch (358:9): [True: 369, False: 130]
  ------------------
  359|    369|      errCode = errDamaged;
  ------------------
  |  |   18|    369|#define errDamaged          3	// PDF file was damaged and couldn't be
  ------------------
  360|    369|      return;
  361|    369|    }
  362|    499|  }
  363|       |
  364|       |  // get the root dictionary (catalog) object
  365|  3.16k|  trailerDict.dictLookupNF("Root", &obj);
  366|  3.16k|  if (obj.isRef()) {
  ------------------
  |  Branch (366:7): [True: 2.96k, False: 201]
  ------------------
  367|  2.96k|    rootNum = obj.getRefNum();
  368|  2.96k|    rootGen = obj.getRefGen();
  369|  2.96k|    obj.free();
  370|  2.96k|  } else {
  371|    201|    obj.free();
  372|    201|    if (!(ok = constructXRef())) {
  ------------------
  |  Branch (372:9): [True: 37, False: 164]
  ------------------
  373|     37|      errCode = errDamaged;
  ------------------
  |  |   18|     37|#define errDamaged          3	// PDF file was damaged and couldn't be
  ------------------
  374|     37|      return;
  375|     37|    }
  376|    201|  }
  377|       |
  378|       |  // now set the trailer dictionary's xref pointer so we can fetch
  379|       |  // indirect objects from it
  380|  3.13k|  trailerDict.getDict()->setXRef(this);
  381|  3.13k|}
_ZN4XRefD2Ev:
  383|  20.2k|XRef::~XRef() {
  384|  20.2k|  int i;
  385|       |
  386|   344k|  for (i = 0; i < xrefCacheSize; ++i) {
  ------------------
  |  |   49|   344k|#define xrefCacheSize 16
  ------------------
  |  Branch (386:15): [True: 324k, False: 20.2k]
  ------------------
  387|   324k|    if (cache[i].num >= 0) {
  ------------------
  |  Branch (387:9): [True: 29.0k, False: 295k]
  ------------------
  388|  29.0k|      cache[i].obj.free();
  389|  29.0k|    }
  390|   324k|  }
  391|  20.2k|  gfree(entries);
  392|  20.2k|  trailerDict.free();
  393|  20.2k|  if (xrefTablePos) {
  ------------------
  |  Branch (393:7): [True: 498, False: 19.7k]
  ------------------
  394|    498|    gfree(xrefTablePos);
  395|    498|  }
  396|  20.2k|  if (streamEnds) {
  ------------------
  |  Branch (396:7): [True: 2.11k, False: 18.1k]
  ------------------
  397|  2.11k|    gfree(streamEnds);
  398|  2.11k|  }
  399|  2.61M|  for (i = 0; i < objStrCacheSize; ++i) {
  ------------------
  |  |   51|  2.61M|#define objStrCacheSize 128
  ------------------
  |  Branch (399:15): [True: 2.59M, False: 20.2k]
  ------------------
  400|  2.59M|    if (objStrs[i]) {
  ------------------
  |  Branch (400:9): [True: 3.07k, False: 2.59M]
  ------------------
  401|  3.07k|      delete objStrs[i];
  402|  3.07k|    }
  403|  2.59M|  }
  404|  20.2k|#if MULTITHREADED
  405|  20.2k|  gDestroyMutex(&objStrsMutex);
  ------------------
  |  |   52|  20.2k|#define gDestroyMutex(m) pthread_mutex_destroy(m)
  ------------------
  406|  20.2k|  gDestroyMutex(&cacheMutex);
  ------------------
  |  |   52|  20.2k|#define gDestroyMutex(m) pthread_mutex_destroy(m)
  ------------------
  407|  20.2k|#endif
  408|  20.2k|}
_ZN4XRef12getStartXrefEv:
  411|  10.2k|GFileOffset XRef::getStartXref() {
  412|  10.2k|  char buf[xrefSearchSize+1];
  413|  10.2k|  char *p;
  414|  10.2k|  int n, i;
  415|       |
  416|       |  // read last xrefSearchSize bytes
  417|  10.2k|  str->setPos(xrefSearchSize, -1);
  ------------------
  |  |   30|  10.2k|#define xrefSearchSize 1024	// read this many bytes at end of file
  ------------------
  418|  10.2k|  n = str->getBlock(buf, xrefSearchSize);
  ------------------
  |  |   30|  10.2k|#define xrefSearchSize 1024	// read this many bytes at end of file
  ------------------
  419|  10.2k|  buf[n] = '\0';
  420|       |
  421|       |  // find startxref
  422|  7.82M|  for (i = n - 9; i >= 0; --i) {
  ------------------
  |  Branch (422:19): [True: 7.81M, False: 9.45k]
  ------------------
  423|  7.81M|    if (!strncmp(&buf[i], "startxref", 9)) {
  ------------------
  |  Branch (423:9): [True: 753, False: 7.81M]
  ------------------
  424|    753|      break;
  425|    753|    }
  426|  7.81M|  }
  427|  10.2k|  if (i < 0) {
  ------------------
  |  Branch (427:7): [True: 9.45k, False: 753]
  ------------------
  428|  9.45k|    return 0;
  429|  9.45k|  }
  430|  1.59k|  for (p = &buf[i+9]; isspace(*p & 0xff); ++p) ;
  ------------------
  |  Branch (430:23): [True: 844, False: 753]
  ------------------
  431|    753|  lastXRefPos = strToFileOffset(p);
  432|    753|  lastStartxrefPos = str->getPos() - n + i;
  433|       |
  434|    753|  return lastXRefPos;
  435|  10.2k|}
_ZN4XRef8readXRefEPlP10XRefPosSeti:
  441|    599|GBool XRef::readXRef(GFileOffset *pos, XRefPosSet *posSet, GBool hybrid) {
  442|    599|  Parser *parser;
  443|    599|  Object obj;
  444|    599|  GBool more;
  445|    599|  char buf[100];
  446|    599|  int n, i;
  447|       |
  448|       |  // check for a loop in the xref tables
  449|    599|  if (posSet->check(*pos)) {
  ------------------
  |  Branch (449:7): [True: 15, False: 584]
  ------------------
  450|     15|    error(errSyntaxWarning, -1, "Infinite loop in xref table");
  451|     15|    return gFalse;
  ------------------
  |  |   18|     15|#define gFalse 0
  ------------------
  452|     15|  }
  453|    584|  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|    584|  str->setPos(start + *pos);
  459|    584|  n = str->getBlock(buf, 100);
  460|  1.74k|  for (i = 0; i < n && Lexer::isSpace(buf[i]); ++i) ;
  ------------------
  |  Branch (460:15): [True: 1.69k, False: 47]
  |  Branch (460:24): [True: 1.15k, False: 537]
  ------------------
  461|       |
  462|       |  // parse an old-style xref table
  463|    584|  if (!hybrid &&
  ------------------
  |  Branch (463:7): [True: 581, False: 3]
  ------------------
  464|    581|      i + 4 < n &&
  ------------------
  |  Branch (464:7): [True: 534, False: 47]
  ------------------
  465|    534|      buf[i] == 'x' && buf[i+1] == 'r' && buf[i+2] == 'e' && buf[i+3] == 'f' &&
  ------------------
  |  Branch (465:7): [True: 99, False: 435]
  |  Branch (465:24): [True: 99, False: 0]
  |  Branch (465:43): [True: 98, False: 1]
  |  Branch (465:62): [True: 96, False: 2]
  ------------------
  466|     96|      Lexer::isSpace(buf[i+4])) {
  ------------------
  |  Branch (466:7): [True: 96, False: 0]
  ------------------
  467|     96|    more = readXRefTable(pos, i + 5, posSet);
  468|       |
  469|       |  // parse an xref stream
  470|    488|  } else {
  471|    488|    obj.initNull();
  472|    488|    parser = new Parser(NULL,
  473|    488|	       new Lexer(NULL,
  474|    488|		 str->makeSubStream(start + *pos, gFalse, 0, &obj)),
  ------------------
  |  |   18|    488|#define gFalse 0
  ------------------
  475|    488|	       gTrue);
  ------------------
  |  |   17|    488|#define gTrue 1
  ------------------
  476|    488|    if (!parser->getObj(&obj, gTrue)->isInt()) {
  ------------------
  |  |   17|    488|#define gTrue 1
  ------------------
  |  Branch (476:9): [True: 169, False: 319]
  ------------------
  477|    169|      goto err;
  478|    169|    }
  479|    319|    obj.free();
  480|    319|    if (!parser->getObj(&obj, gTrue)->isInt()) {
  ------------------
  |  |   17|    319|#define gTrue 1
  ------------------
  |  Branch (480:9): [True: 30, False: 289]
  ------------------
  481|     30|      goto err;
  482|     30|    }
  483|    289|    obj.free();
  484|    289|    if (!parser->getObj(&obj, gTrue)->isCmd("obj")) {
  ------------------
  |  |   17|    289|#define gTrue 1
  ------------------
  |  Branch (484:9): [True: 23, False: 266]
  ------------------
  485|     23|      goto err;
  486|     23|    }
  487|    266|    obj.free();
  488|    266|    if (!parser->getObj(&obj)->isStream()) {
  ------------------
  |  Branch (488:9): [True: 18, False: 248]
  ------------------
  489|     18|      goto err;
  490|     18|    }
  491|    248|    more = readXRefStream(obj.getStream(), pos);
  492|    248|    obj.free();
  493|    248|    delete parser;
  494|    248|  }
  495|       |
  496|    344|  return more;
  497|       |
  498|    240| err:
  499|    240|  obj.free();
  500|    240|  delete parser;
  501|    240|  if (hybrid) {
  ------------------
  |  Branch (501:7): [True: 2, False: 238]
  ------------------
  502|      2|    error(errSyntaxError, -1, "Invalid XRefStm link in trailer");
  503|    238|  } else {
  504|    238|    ok = gFalse;
  ------------------
  |  |   18|    238|#define gFalse 0
  ------------------
  505|    238|  }
  506|    240|  return gFalse;
  ------------------
  |  |   18|    240|#define gFalse 0
  ------------------
  507|    584|}
_ZN4XRef13readXRefTableEPliP10XRefPosSet:
  509|     96|GBool XRef::readXRefTable(GFileOffset *pos, int offset, XRefPosSet *posSet) {
  510|     96|  XRefEntry entry;
  511|     96|  Parser *parser;
  512|     96|  Object obj, obj2;
  513|     96|  char buf[6];
  514|     96|  GFileOffset off, pos2;
  515|     96|  GBool more;
  516|     96|  int first, n, digit, newSize, gen, i, c;
  517|       |
  518|     96|  str->setPos(start + *pos + offset);
  519|       |
  520|    172|  while (1) {
  ------------------
  |  Branch (520:10): [True: 172, Folded]
  ------------------
  521|    265|    do {
  522|    265|      c = str->getChar();
  523|    265|    } while (Lexer::isSpace(c));
  ------------------
  |  Branch (523:14): [True: 93, False: 172]
  ------------------
  524|    172|    if (c == 't') {
  ------------------
  |  Branch (524:9): [True: 47, False: 125]
  ------------------
  525|     47|      if (str->getBlock(buf, 6) != 6 || memcmp(buf, "railer", 6)) {
  ------------------
  |  Branch (525:11): [True: 0, False: 47]
  |  Branch (525:41): [True: 2, False: 45]
  ------------------
  526|      2|	goto err1;
  527|      2|      }
  528|     45|      break;
  529|     47|    }
  530|    125|    if (c < '0' || c > '9') {
  ------------------
  |  Branch (530:9): [True: 0, False: 125]
  |  Branch (530:20): [True: 6, False: 119]
  ------------------
  531|      6|      goto err1;
  532|      6|    }
  533|    119|    first = 0;
  534|    926|    do {
  535|    926|      digit = c - '0';
  536|    926|      if (first > (INT_MAX - digit) / 10) {
  ------------------
  |  Branch (536:11): [True: 0, False: 926]
  ------------------
  537|      0|	goto err1;
  538|      0|      }
  539|    926|      first = (first * 10) + digit;
  540|    926|      c = str->getChar();
  541|    926|    } while (c >= '0' && c <= '9');
  ------------------
  |  Branch (541:14): [True: 810, False: 116]
  |  Branch (541:26): [True: 807, False: 3]
  ------------------
  542|    119|    if (!Lexer::isSpace(c)) {
  ------------------
  |  Branch (542:9): [True: 7, False: 112]
  ------------------
  543|      7|      goto err1;
  544|      7|    }
  545|    133|    do {
  546|    133|      c = str->getChar();
  547|    133|    } while (Lexer::isSpace(c));
  ------------------
  |  Branch (547:14): [True: 21, False: 112]
  ------------------
  548|    112|    n = 0;
  549|    156|    do {
  550|    156|      digit = c - '0';
  551|    156|      if (n > (INT_MAX - digit) / 10) {
  ------------------
  |  Branch (551:11): [True: 0, False: 156]
  ------------------
  552|      0|	goto err1;
  553|      0|      }
  554|    156|      n = (n * 10) + digit;
  555|    156|      c = str->getChar();
  556|    156|    } while (c >= '0' && c <= '9');
  ------------------
  |  Branch (556:14): [True: 45, False: 111]
  |  Branch (556:26): [True: 44, False: 1]
  ------------------
  557|    112|    if (!Lexer::isSpace(c)) {
  ------------------
  |  Branch (557:9): [True: 15, False: 97]
  ------------------
  558|     15|      goto err1;
  559|     15|    }
  560|     97|    if (first > INT_MAX - n) {
  ------------------
  |  Branch (560:9): [True: 0, False: 97]
  ------------------
  561|      0|      goto err1;
  562|      0|    }
  563|     97|    if (first + n > size) {
  ------------------
  |  Branch (563:9): [True: 85, False: 12]
  ------------------
  564|     85|      newSize = size ? size : 512;
  ------------------
  |  Branch (564:17): [True: 4, False: 81]
  ------------------
  565|     98|      do {
  566|     98|	if (newSize > INT_MAX / 2) {
  ------------------
  |  Branch (566:6): [True: 0, False: 98]
  ------------------
  567|      0|	  goto err1;
  568|      0|	}
  569|     98|	newSize <<= 1;
  570|     98|      } while (first + n > newSize);
  ------------------
  |  Branch (570:16): [True: 13, False: 85]
  ------------------
  571|     85|      entries = (XRefEntry *)greallocn(entries, newSize, sizeof(XRefEntry));
  572|  33.6M|      for (i = size; i < newSize; ++i) {
  ------------------
  |  Branch (572:22): [True: 33.6M, False: 85]
  ------------------
  573|  33.6M|	entries[i].offset = (GFileOffset)-1;
  574|  33.6M|	entries[i].type = xrefEntryFree;
  575|  33.6M|      }
  576|     85|      size = newSize;
  577|     85|    }
  578|    205|    for (i = first; i < first + n; ++i) {
  ------------------
  |  Branch (578:21): [True: 129, False: 76]
  ------------------
  579|    192|      do {
  580|    192|	c = str->getChar();
  581|    192|      } while (Lexer::isSpace(c));
  ------------------
  |  Branch (581:16): [True: 63, False: 129]
  ------------------
  582|    129|      off = 0;
  583|    504|      do {
  584|    504|	off = (off * 10) + (c - '0');
  585|    504|	c = str->getChar();
  586|    504|      } while (c >= '0' && c <= '9');
  ------------------
  |  Branch (586:16): [True: 377, False: 127]
  |  Branch (586:28): [True: 375, False: 2]
  ------------------
  587|    129|      if (!Lexer::isSpace(c)) {
  ------------------
  |  Branch (587:11): [True: 5, False: 124]
  ------------------
  588|      5|	goto err1;
  589|      5|      }
  590|    124|      entry.offset = off;
  591|    146|      do {
  592|    146|	c = str->getChar();
  593|    146|      } while (Lexer::isSpace(c));
  ------------------
  |  Branch (593:16): [True: 22, False: 124]
  ------------------
  594|    124|      gen = 0;
  595|    362|      do {
  596|    362|	gen = (gen * 10) + (c - '0');
  597|    362|	c = str->getChar();
  598|    362|      } while (c >= '0' && c <= '9');
  ------------------
  |  Branch (598:16): [True: 243, False: 119]
  |  Branch (598:28): [True: 238, False: 5]
  ------------------
  599|    124|      if (!Lexer::isSpace(c)) {
  ------------------
  |  Branch (599:11): [True: 14, False: 110]
  ------------------
  600|     14|	goto err1;
  601|     14|      }
  602|    110|      entry.gen = gen;
  603|    136|      do {
  604|    136|	c = str->getChar();
  605|    136|      } while (Lexer::isSpace(c));
  ------------------
  |  Branch (605:16): [True: 26, False: 110]
  ------------------
  606|    110|      if (c == 'n') {
  ------------------
  |  Branch (606:11): [True: 100, False: 10]
  ------------------
  607|    100|	entry.type = xrefEntryUncompressed;
  608|    100|      } else if (c == 'f') {
  ------------------
  |  Branch (608:18): [True: 8, False: 2]
  ------------------
  609|      8|	entry.type = xrefEntryFree;
  610|      8|      } else {
  611|      2|	goto err1;
  612|      2|      }
  613|    108|      c = str->getChar();
  614|    108|      if (!Lexer::isSpace(c)) {
  ------------------
  |  Branch (614:11): [True: 0, False: 108]
  ------------------
  615|      0|	goto err1;
  616|      0|      }
  617|    108|      if (entries[i].offset == (GFileOffset)-1) {
  ------------------
  |  Branch (617:11): [True: 108, False: 0]
  ------------------
  618|    108|	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|    108|	if (i == 1 && first == 1 &&
  ------------------
  |  Branch (622:6): [True: 10, False: 98]
  |  Branch (622:16): [True: 3, False: 7]
  ------------------
  623|      3|	    entries[1].offset == 0 && entries[1].gen == 65535 &&
  ------------------
  |  Branch (623:6): [True: 3, False: 0]
  |  Branch (623:32): [True: 2, False: 1]
  ------------------
  624|      2|	    entries[1].type == xrefEntryFree) {
  ------------------
  |  Branch (624:6): [True: 1, False: 1]
  ------------------
  625|      1|	  i = first = 0;
  626|      1|	  entries[0] = entries[1];
  627|      1|	  entries[1].offset = (GFileOffset)-1;
  628|      1|	}
  629|    108|	if (i > last) {
  ------------------
  |  Branch (629:6): [True: 107, False: 1]
  ------------------
  630|    107|	  last = i;
  631|    107|	}
  632|    108|      }
  633|    108|    }
  634|     97|  }
  635|       |
  636|       |  // read the trailer dictionary
  637|     45|  obj.initNull();
  638|     45|  parser = new Parser(NULL,
  639|     45|	     new Lexer(NULL,
  640|     45|	       str->makeSubStream(str->getPos(), gFalse, 0, &obj)),
  ------------------
  |  |   18|     45|#define gFalse 0
  ------------------
  641|     45|	     gTrue);
  ------------------
  |  |   17|     45|#define gTrue 1
  ------------------
  642|     45|  parser->getObj(&obj);
  643|     45|  delete parser;
  644|     45|  if (!obj.isDict()) {
  ------------------
  |  Branch (644:7): [True: 3, False: 42]
  ------------------
  645|      3|    obj.free();
  646|      3|    goto err1;
  647|      3|  }
  648|       |
  649|       |  // get the 'Prev' pointer
  650|       |  //~ this can be a 64-bit int (?)
  651|     42|  obj.getDict()->lookupNF("Prev", &obj2);
  652|     42|  if (obj2.isInt()) {
  ------------------
  |  Branch (652:7): [True: 3, False: 39]
  ------------------
  653|      3|    *pos = (GFileOffset)(Guint)obj2.getInt();
  654|      3|    more = gTrue;
  ------------------
  |  |   17|      3|#define gTrue 1
  ------------------
  655|     39|  } else if (obj2.isRef()) {
  ------------------
  |  Branch (655:14): [True: 0, False: 39]
  ------------------
  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|     39|  } else {
  661|     39|    more = gFalse;
  ------------------
  |  |   18|     39|#define gFalse 0
  ------------------
  662|     39|  }
  663|     42|  obj2.free();
  664|       |
  665|       |  // save the first trailer dictionary
  666|     42|  if (trailerDict.isNone()) {
  ------------------
  |  Branch (666:7): [True: 41, False: 1]
  ------------------
  667|     41|    obj.copy(&trailerDict);
  668|     41|  }
  669|       |
  670|       |  // check for an 'XRefStm' key
  671|       |  //~ this can be a 64-bit int (?)
  672|     42|  if (obj.getDict()->lookup("XRefStm", &obj2)->isInt()) {
  ------------------
  |  Branch (672:7): [True: 3, False: 39]
  ------------------
  673|      3|    pos2 = (GFileOffset)(Guint)obj2.getInt();
  674|      3|    readXRef(&pos2, posSet, gTrue);
  ------------------
  |  |   17|      3|#define gTrue 1
  ------------------
  675|      3|    if (!ok) {
  ------------------
  |  Branch (675:9): [True: 0, False: 3]
  ------------------
  676|      0|      obj2.free();
  677|      0|      obj.free();
  678|      0|      goto err1;
  679|      0|    }
  680|      3|  }
  681|     42|  obj2.free();
  682|       |
  683|     42|  obj.free();
  684|     42|  return more;
  685|       |
  686|     54| err1:
  687|     54|  ok = gFalse;
  ------------------
  |  |   18|     54|#define gFalse 0
  ------------------
  688|     54|  return gFalse;
  ------------------
  |  |   18|     54|#define gFalse 0
  ------------------
  689|     42|}
_ZN4XRef14readXRefStreamEP6StreamPl:
  691|    248|GBool XRef::readXRefStream(Stream *xrefStr, GFileOffset *pos) {
  692|    248|  Dict *dict;
  693|    248|  int w[3];
  694|    248|  GBool more;
  695|    248|  Object obj, obj2, idx;
  696|    248|  int newSize, first, n, i;
  697|       |
  698|    248|  dict = xrefStr->getDict();
  699|       |
  700|    248|  if (!dict->lookupNF("Size", &obj)->isInt()) {
  ------------------
  |  Branch (700:7): [True: 13, False: 235]
  ------------------
  701|     13|    goto err1;
  702|     13|  }
  703|    235|  newSize = obj.getInt();
  704|    235|  obj.free();
  705|    235|  if (newSize < 0) {
  ------------------
  |  Branch (705:7): [True: 1, False: 234]
  ------------------
  706|      1|    goto err1;
  707|      1|  }
  708|    234|  if (newSize > size) {
  ------------------
  |  Branch (708:7): [True: 164, False: 70]
  ------------------
  709|    164|    entries = (XRefEntry *)greallocn(entries, newSize, sizeof(XRefEntry));
  710|  1.31M|    for (i = size; i < newSize; ++i) {
  ------------------
  |  Branch (710:20): [True: 1.31M, False: 164]
  ------------------
  711|  1.31M|      entries[i].offset = (GFileOffset)-1;
  712|  1.31M|      entries[i].type = xrefEntryFree;
  713|  1.31M|    }
  714|    164|    size = newSize;
  715|    164|  }
  716|       |
  717|    234|  if (!dict->lookupNF("W", &obj)->isArray() ||
  ------------------
  |  Branch (717:7): [True: 2, False: 232]
  ------------------
  718|    232|      obj.arrayGetLength() < 3) {
  ------------------
  |  Branch (718:7): [True: 2, False: 230]
  ------------------
  719|      4|    goto err1;
  720|      4|  }
  721|    913|  for (i = 0; i < 3; ++i) {
  ------------------
  |  Branch (721:15): [True: 686, False: 227]
  ------------------
  722|    686|    if (!obj.arrayGet(i, &obj2)->isInt()) {
  ------------------
  |  Branch (722:9): [True: 3, False: 683]
  ------------------
  723|      3|      obj2.free();
  724|      3|      goto err1;
  725|      3|    }
  726|    683|    w[i] = obj2.getInt();
  727|    683|    obj2.free();
  728|    683|  }
  729|    227|  obj.free();
  730|    227|  if (w[0] < 0 || w[0] > 8 ||
  ------------------
  |  Branch (730:7): [True: 1, False: 226]
  |  Branch (730:19): [True: 1, False: 225]
  ------------------
  731|    225|      w[1] < 0 || w[1] > 8 ||
  ------------------
  |  Branch (731:7): [True: 0, False: 225]
  |  Branch (731:19): [True: 0, False: 225]
  ------------------
  732|    225|      w[2] < 0 || w[2] > 8) {
  ------------------
  |  Branch (732:7): [True: 0, False: 225]
  |  Branch (732:19): [True: 1, False: 224]
  ------------------
  733|      3|    goto err0;
  734|      3|  }
  735|       |
  736|    224|  xrefStr->reset();
  737|    224|  dict->lookupNF("Index", &idx);
  738|    224|  if (idx.isArray()) {
  ------------------
  |  Branch (738:7): [True: 128, False: 96]
  ------------------
  739|    564|    for (i = 0; i+1 < idx.arrayGetLength(); i += 2) {
  ------------------
  |  Branch (739:17): [True: 453, False: 111]
  ------------------
  740|    453|      if (!idx.arrayGet(i, &obj)->isInt()) {
  ------------------
  |  Branch (740:11): [True: 0, False: 453]
  ------------------
  741|      0|	idx.free();
  742|      0|	goto err1;
  743|      0|      }
  744|    453|      first = obj.getInt();
  745|    453|      obj.free();
  746|    453|      if (!idx.arrayGet(i+1, &obj)->isInt()) {
  ------------------
  |  Branch (746:11): [True: 2, False: 451]
  ------------------
  747|      2|	idx.free();
  748|      2|	goto err1;
  749|      2|      }
  750|    451|      n = obj.getInt();
  751|    451|      obj.free();
  752|    451|      if (first < 0 || n < 0 ||
  ------------------
  |  Branch (752:11): [True: 0, False: 451]
  |  Branch (752:24): [True: 1, False: 450]
  ------------------
  753|    450|	  !readXRefStreamSection(xrefStr, w, first, n)) {
  ------------------
  |  Branch (753:4): [True: 15, False: 435]
  ------------------
  754|     15|	idx.free();
  755|     15|	goto err0;
  756|     15|      }
  757|    451|    }
  758|    128|  } else {
  759|     96|    if (!readXRefStreamSection(xrefStr, w, 0, newSize)) {
  ------------------
  |  Branch (759:9): [True: 36, False: 60]
  ------------------
  760|     36|      idx.free();
  761|     36|      goto err0;
  762|     36|    }
  763|     96|  }
  764|    171|  idx.free();
  765|       |
  766|       |  //~ this can be a 64-bit int (?)
  767|    171|  dict->lookupNF("Prev", &obj);
  768|    171|  if (obj.isInt()) {
  ------------------
  |  Branch (768:7): [True: 95, False: 76]
  ------------------
  769|     95|    *pos = (GFileOffset)(Guint)obj.getInt();
  770|     95|    more = gTrue;
  ------------------
  |  |   17|     95|#define gTrue 1
  ------------------
  771|     95|  } else {
  772|     76|    more = gFalse;
  ------------------
  |  |   18|     76|#define gFalse 0
  ------------------
  773|     76|  }
  774|    171|  obj.free();
  775|    171|  if (trailerDict.isNone()) {
  ------------------
  |  Branch (775:7): [True: 104, False: 67]
  ------------------
  776|    104|    trailerDict.initDict(dict);
  777|    104|  }
  778|       |
  779|    171|  return more;
  780|       |
  781|     23| err1:
  782|     23|  obj.free();
  783|     77| err0:
  784|     77|  ok = gFalse;
  ------------------
  |  |   18|     77|#define gFalse 0
  ------------------
  785|     77|  return gFalse;
  ------------------
  |  |   18|     77|#define gFalse 0
  ------------------
  786|     23|}
_ZN4XRef21readXRefStreamSectionEP6StreamPiii:
  788|    546|GBool XRef::readXRefStreamSection(Stream *xrefStr, int *w, int first, int n) {
  789|    546|  long long type, gen, offset;
  790|    546|  int c, newSize, i, j;
  791|       |
  792|    546|  if (first + n < 0) {
  ------------------
  |  Branch (792:7): [True: 1, False: 545]
  ------------------
  793|      1|    return gFalse;
  ------------------
  |  |   18|      1|#define gFalse 0
  ------------------
  794|      1|  }
  795|    545|  if (first + n > size) {
  ------------------
  |  Branch (795:7): [True: 54, False: 491]
  ------------------
  796|     54|    for (newSize = size ? 2 * size : 1024;
  ------------------
  |  Branch (796:20): [True: 52, False: 2]
  ------------------
  797|    152|	 first + n > newSize && newSize > 0;
  ------------------
  |  Branch (797:3): [True: 99, False: 53]
  |  Branch (797:26): [True: 98, False: 1]
  ------------------
  798|     98|	 newSize <<= 1) ;
  799|     54|    if (newSize < 0) {
  ------------------
  |  Branch (799:9): [True: 1, False: 53]
  ------------------
  800|      1|      return gFalse;
  ------------------
  |  |   18|      1|#define gFalse 0
  ------------------
  801|      1|    }
  802|     53|    entries = (XRefEntry *)greallocn(entries, newSize, sizeof(XRefEntry));
  803|   397k|    for (i = size; i < newSize; ++i) {
  ------------------
  |  Branch (803:20): [True: 397k, False: 53]
  ------------------
  804|   397k|      entries[i].offset = (GFileOffset)-1;
  805|   397k|      entries[i].type = xrefEntryFree;
  806|   397k|    }
  807|     53|    size = newSize;
  808|     53|  }
  809|  6.94k|  for (i = first; i < first + n; ++i) {
  ------------------
  |  Branch (809:19): [True: 6.45k, False: 496]
  ------------------
  810|  6.45k|    if (w[0] == 0) {
  ------------------
  |  Branch (810:9): [True: 3.26k, False: 3.18k]
  ------------------
  811|  3.26k|      type = 1;
  812|  3.26k|    } else {
  813|  6.70k|      for (type = 0, j = 0; j < w[0]; ++j) {
  ------------------
  |  Branch (813:29): [True: 3.52k, False: 3.18k]
  ------------------
  814|  3.52k|	if ((c = xrefStr->getChar()) == EOF) {
  ------------------
  |  Branch (814:6): [True: 5, False: 3.52k]
  ------------------
  815|      5|	  return gFalse;
  ------------------
  |  |   18|      5|#define gFalse 0
  ------------------
  816|      5|	}
  817|  3.52k|	type = (type << 8) + c;
  818|  3.52k|      }
  819|  3.18k|    }
  820|  21.2k|    for (offset = 0, j = 0; j < w[1]; ++j) {
  ------------------
  |  Branch (820:29): [True: 14.7k, False: 6.43k]
  ------------------
  821|  14.7k|      if ((c = xrefStr->getChar()) == EOF) {
  ------------------
  |  Branch (821:11): [True: 10, False: 14.7k]
  ------------------
  822|     10|	return gFalse;
  ------------------
  |  |   18|     10|#define gFalse 0
  ------------------
  823|     10|      }
  824|  14.7k|      offset = (offset << 8) + c;
  825|  14.7k|    }
  826|  6.43k|    if (offset < 0 || offset > GFILEOFFSET_MAX) {
  ------------------
  |  |  128|  6.43k|#define GFILEOFFSET_MAX 0x7fffffffffffffffLL
  ------------------
  |  Branch (826:9): [True: 2, False: 6.43k]
  |  Branch (826:23): [True: 0, False: 6.43k]
  ------------------
  827|      1|      return gFalse;
  ------------------
  |  |   18|      1|#define gFalse 0
  ------------------
  828|      1|    }
  829|  13.8k|    for (gen = 0, j = 0; j < w[2]; ++j) {
  ------------------
  |  Branch (829:26): [True: 7.42k, False: 6.42k]
  ------------------
  830|  7.42k|      if ((c = xrefStr->getChar()) == EOF) {
  ------------------
  |  Branch (830:11): [True: 11, False: 7.41k]
  ------------------
  831|     11|	return gFalse;
  ------------------
  |  |   18|     11|#define gFalse 0
  ------------------
  832|     11|      }
  833|  7.41k|      gen = (gen << 8) + c;
  834|  7.41k|    }
  835|       |    // some PDF generators include a free entry with gen=0xffffffff
  836|  6.42k|    if ((gen < 0 || gen > INT_MAX) && type != 0) {
  ------------------
  |  Branch (836:10): [True: 7, False: 6.41k]
  |  Branch (836:21): [True: 3, False: 6.41k]
  |  Branch (836:39): [True: 3, False: 6]
  ------------------
  837|      3|      return gFalse;
  ------------------
  |  |   18|      3|#define gFalse 0
  ------------------
  838|      3|    }
  839|  6.42k|    if (entries[i].offset == (GFileOffset)-1) {
  ------------------
  |  Branch (839:9): [True: 5.66k, False: 757]
  ------------------
  840|  5.66k|      switch (type) {
  841|    366|      case 0:
  ------------------
  |  Branch (841:7): [True: 366, False: 5.29k]
  ------------------
  842|    366|	entries[i].offset = (GFileOffset)offset;
  843|    366|	entries[i].gen = (int)gen;
  844|    366|	entries[i].type = xrefEntryFree;
  845|    366|	break;
  846|  3.70k|      case 1:
  ------------------
  |  Branch (846:7): [True: 3.70k, False: 1.95k]
  ------------------
  847|  3.70k|	entries[i].offset = (GFileOffset)offset;
  848|  3.70k|	entries[i].gen = (int)gen;
  849|  3.70k|	entries[i].type = xrefEntryUncompressed;
  850|  3.70k|	break;
  851|  1.57k|      case 2:
  ------------------
  |  Branch (851:7): [True: 1.57k, False: 4.09k]
  ------------------
  852|  1.57k|	entries[i].offset = (GFileOffset)offset;
  853|  1.57k|	entries[i].gen = (int)gen;
  854|  1.57k|	entries[i].type = xrefEntryCompressed;
  855|  1.57k|	break;
  856|     18|      default:
  ------------------
  |  Branch (856:7): [True: 18, False: 5.64k]
  ------------------
  857|     18|	return gFalse;
  ------------------
  |  |   18|     18|#define gFalse 0
  ------------------
  858|  5.66k|      }
  859|  5.64k|      if (i > last) {
  ------------------
  |  Branch (859:11): [True: 4.20k, False: 1.44k]
  ------------------
  860|  4.20k|	last = i;
  861|  4.20k|      }
  862|  5.64k|    }
  863|  6.42k|  }
  864|       |
  865|    496|  return gTrue;
  ------------------
  |  |   17|    496|#define gTrue 1
  ------------------
  866|    544|}
_ZN4XRef13constructXRefEv:
  869|  10.2k|GBool XRef::constructXRef() {
  870|  10.2k|  int *streamObjNums = NULL;
  871|  10.2k|  int streamObjNumsLen = 0;
  872|  10.2k|  int streamObjNumsSize = 0;
  873|  10.2k|  int lastObjNum = -1;
  874|  10.2k|  rootNum = -1;
  875|  10.2k|  int streamEndsSize = 0;
  876|  10.2k|  streamEndsLen = 0;
  877|  10.2k|  char buf[4096 + 1];
  878|  10.2k|  str->reset();
  879|  10.2k|  GFileOffset bufPos = start;
  880|  10.2k|  char *p = buf;
  881|  10.2k|  char *end = buf;
  882|  10.2k|  GBool startOfLine = gTrue;
  ------------------
  |  |   17|  10.2k|#define gTrue 1
  ------------------
  883|  10.2k|  GBool space = gTrue;
  ------------------
  |  |   17|  10.2k|#define gTrue 1
  ------------------
  884|  10.2k|  GBool eof = gFalse;
  ------------------
  |  |   18|  10.2k|#define gFalse 0
  ------------------
  885|  39.2M|  while (1) {
  ------------------
  |  Branch (885:10): [True: 39.2M, Folded]
  ------------------
  886|  39.2M|    if (end - p < 256 && !eof) {
  ------------------
  |  Branch (886:9): [True: 2.29M, False: 36.9M]
  |  Branch (886:26): [True: 18.0k, False: 2.27M]
  ------------------
  887|  18.0k|      memcpy(buf, p, end - p);
  888|  18.0k|      bufPos += p - buf;
  889|  18.0k|      p = buf + (end - p);
  890|  18.0k|      int n = (int)(buf + 4096 - p);
  891|  18.0k|      int m = str->getBlock(p, n);
  892|  18.0k|      end = p + m;
  893|  18.0k|      *end = '\0';
  894|  18.0k|      p = buf;
  895|  18.0k|      eof = m < n;
  896|  18.0k|    }
  897|  39.2M|    if (p == end && eof) {
  ------------------
  |  Branch (897:9): [True: 10.2k, False: 39.2M]
  |  Branch (897:21): [True: 10.2k, False: 0]
  ------------------
  898|  10.2k|      break;
  899|  10.2k|    }
  900|  39.2M|    if (startOfLine && !strncmp(p, "trailer", 7)) {
  ------------------
  |  Branch (900:9): [True: 2.84M, False: 36.3M]
  |  Branch (900:24): [True: 22.2k, False: 2.81M]
  ------------------
  901|  22.2k|      constructTrailerDict((GFileOffset)(bufPos + (p + 7 - buf)));
  902|  22.2k|      p += 7;
  903|  22.2k|      startOfLine = gFalse;
  ------------------
  |  |   18|  22.2k|#define gFalse 0
  ------------------
  904|  22.2k|      space = gFalse;
  ------------------
  |  |   18|  22.2k|#define gFalse 0
  ------------------
  905|  39.1M|    } else if (startOfLine && !strncmp(p, "endstream", 9)) {
  ------------------
  |  Branch (905:16): [True: 2.81M, False: 36.3M]
  |  Branch (905:31): [True: 16.3k, False: 2.80M]
  ------------------
  906|  16.3k|      if (streamEndsLen == streamEndsSize) {
  ------------------
  |  Branch (906:11): [True: 2.19k, False: 14.1k]
  ------------------
  907|  2.19k|	streamEndsSize += 64;
  908|  2.19k|	streamEnds = (GFileOffset *)greallocn(streamEnds, streamEndsSize,
  909|  2.19k|					      sizeof(GFileOffset));
  910|  2.19k|      }
  911|  16.3k|      streamEnds[streamEndsLen++] = (GFileOffset)(bufPos + (p - buf));
  912|  16.3k|      p += 9;
  913|  16.3k|      startOfLine = gFalse;
  ------------------
  |  |   18|  16.3k|#define gFalse 0
  ------------------
  914|  16.3k|      space = gFalse;
  ------------------
  |  |   18|  16.3k|#define gFalse 0
  ------------------
  915|  39.1M|    } else if (space && *p >= '0' && *p <= '9') {
  ------------------
  |  Branch (915:16): [True: 9.38M, False: 29.7M]
  |  Branch (915:25): [True: 1.83M, False: 7.54M]
  |  Branch (915:38): [True: 872k, False: 958k]
  ------------------
  916|   872k|      p = constructObjectEntry(p, (GFileOffset)(bufPos + (p - buf)),
  917|   872k|			       &lastObjNum);
  918|   872k|      startOfLine = gFalse;
  ------------------
  |  |   18|   872k|#define gFalse 0
  ------------------
  919|   872k|      space = gFalse;
  ------------------
  |  |   18|   872k|#define gFalse 0
  ------------------
  920|  38.2M|    } else if (p[0] == '>' && p[1] == '>') {
  ------------------
  |  Branch (920:16): [True: 773k, False: 37.5M]
  |  Branch (920:31): [True: 497k, False: 275k]
  ------------------
  921|   497k|      p += 2;
  922|   497k|      startOfLine = gFalse;
  ------------------
  |  |   18|   497k|#define gFalse 0
  ------------------
  923|   497k|      space = gFalse;
  ------------------
  |  |   18|   497k|#define gFalse 0
  ------------------
  924|       |      // skip any PDF whitespace except for '\0'
  925|   740k|      while (*p == '\t' || *p == '\n' || *p == '\x0c' ||
  ------------------
  |  Branch (925:14): [True: 1.06k, False: 739k]
  |  Branch (925:28): [True: 27.5k, False: 712k]
  |  Branch (925:42): [True: 185k, False: 526k]
  ------------------
  926|   526k|	     *p == '\r' || *p == ' ') {
  ------------------
  |  Branch (926:7): [True: 20.0k, False: 506k]
  |  Branch (926:21): [True: 8.97k, False: 497k]
  ------------------
  927|   243k|	if (*p == '\n' || *p == '\r') {
  ------------------
  |  Branch (927:6): [True: 27.5k, False: 215k]
  |  Branch (927:20): [True: 20.0k, False: 195k]
  ------------------
  928|  47.5k|	  startOfLine = gTrue;
  ------------------
  |  |   17|  47.5k|#define gTrue 1
  ------------------
  929|  47.5k|	}
  930|   243k|	space = gTrue;
  ------------------
  |  |   17|   243k|#define gTrue 1
  ------------------
  931|   243k|	++p;
  932|   243k|      }
  933|   497k|      if (!strncmp(p, "stream", 6)) {
  ------------------
  |  Branch (933:11): [True: 270k, False: 226k]
  ------------------
  934|   270k|	if (lastObjNum >= 0) {
  ------------------
  |  Branch (934:6): [True: 266k, False: 3.70k]
  ------------------
  935|   266k|	  if (streamObjNumsLen == streamObjNumsSize) {
  ------------------
  |  Branch (935:8): [True: 11.7k, False: 255k]
  ------------------
  936|  11.7k|	    streamObjNumsSize += 64;
  937|  11.7k|	    streamObjNums = (int *)greallocn(streamObjNums, streamObjNumsSize,
  938|  11.7k|					     sizeof(int));
  939|  11.7k|	  }
  940|   266k|	  streamObjNums[streamObjNumsLen++] = lastObjNum;
  941|   266k|	}
  942|   270k|	p += 6;
  943|   270k|	startOfLine = gFalse;
  ------------------
  |  |   18|   270k|#define gFalse 0
  ------------------
  944|   270k|	space = gFalse;
  ------------------
  |  |   18|   270k|#define gFalse 0
  ------------------
  945|   270k|      }
  946|  37.7M|    } else {
  947|  37.7M|      if (*p == '\n' || *p == '\r') {
  ------------------
  |  Branch (947:11): [True: 800k, False: 36.9M]
  |  Branch (947:25): [True: 462k, False: 36.5M]
  ------------------
  948|  1.26M|	startOfLine = gTrue;
  ------------------
  |  |   17|  1.26M|#define gTrue 1
  ------------------
  949|  1.26M|	space = gTrue;
  ------------------
  |  |   17|  1.26M|#define gTrue 1
  ------------------
  950|  36.5M|      } else if (Lexer::isSpace(*p & 0xff)) {
  ------------------
  |  Branch (950:18): [True: 8.06M, False: 28.4M]
  ------------------
  951|  8.06M|	space = gTrue;
  ------------------
  |  |   17|  8.06M|#define gTrue 1
  ------------------
  952|  28.4M|      } else {
  953|  28.4M|	startOfLine = gFalse;
  ------------------
  |  |   18|  28.4M|#define gFalse 0
  ------------------
  954|  28.4M|	space = gFalse;
  ------------------
  |  |   18|  28.4M|#define gFalse 0
  ------------------
  955|  28.4M|      }
  956|  37.7M|      ++p;
  957|  37.7M|    }
  958|  39.2M|  }
  959|       |
  960|       |  // read each stream object, check for xref or object stream
  961|   276k|  for (int i = 0; i < streamObjNumsLen; ++i) {
  ------------------
  |  Branch (961:19): [True: 266k, False: 10.2k]
  ------------------
  962|   266k|    Object obj;
  963|   266k|    fetch(streamObjNums[i], entries[streamObjNums[i]].gen, &obj);
  964|   266k|    if (obj.isStream()) {
  ------------------
  |  Branch (964:9): [True: 224k, False: 42.0k]
  ------------------
  965|   224k|      Dict *dict = obj.streamGetDict();
  966|   224k|      Object type;
  967|   224k|      dict->lookup("Type", &type);
  968|   224k|      if (type.isName("XRef")) {
  ------------------
  |  Branch (968:11): [True: 2.97k, False: 221k]
  ------------------
  969|  2.97k|	saveTrailerDict(dict, gTrue);
  ------------------
  |  |   17|  2.97k|#define gTrue 1
  ------------------
  970|   221k|      } else if (type.isName("ObjStm")) {
  ------------------
  |  Branch (970:18): [True: 203k, False: 17.3k]
  ------------------
  971|   203k|	constructObjectStreamEntries(&obj, streamObjNums[i]);
  972|   203k|      }
  973|   224k|      type.free();
  974|   224k|    }
  975|   266k|    obj.free();
  976|   266k|  }
  977|       |
  978|  10.2k|  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|   173k|  for (int i = 0; i < xrefCacheSize; ++i) {
  ------------------
  |  |   49|   173k|#define xrefCacheSize 16
  ------------------
  |  Branch (983:19): [True: 162k, False: 10.2k]
  ------------------
  984|   162k|    if (cache[i].num >= 0) {
  ------------------
  |  Branch (984:9): [True: 25.0k, False: 137k]
  ------------------
  985|  25.0k|      cache[i].obj.free();
  986|  25.0k|      cache[i].num = -1;
  987|  25.0k|    }
  988|   162k|  }
  989|       |
  990|  10.2k|  if (rootNum < 0) {
  ------------------
  |  Branch (990:7): [True: 7.16k, False: 3.10k]
  ------------------
  991|  7.16k|    error(errSyntaxError, -1, "Couldn't find trailer dictionary");
  992|  7.16k|    return gFalse;
  ------------------
  |  |   18|  7.16k|#define gFalse 0
  ------------------
  993|  7.16k|  }
  994|  3.10k|  return gTrue;
  ------------------
  |  |   17|  3.10k|#define gTrue 1
  ------------------
  995|  10.2k|}
_ZN4XRef20constructTrailerDictEl:
  998|  22.2k|void XRef::constructTrailerDict(GFileOffset pos) {
  999|  22.2k|  Object newTrailerDict, obj;
 1000|  22.2k|  obj.initNull();
 1001|  22.2k|  Parser *parser =
 1002|  22.2k|      new Parser(NULL,
 1003|  22.2k|		 new Lexer(NULL,
 1004|  22.2k|			   str->makeSubStream(pos, gFalse, 0, &obj)),
  ------------------
  |  |   18|  22.2k|#define gFalse 0
  ------------------
 1005|  22.2k|		 gFalse);
  ------------------
  |  |   18|  22.2k|#define gFalse 0
  ------------------
 1006|  22.2k|  parser->getObj(&newTrailerDict);
 1007|  22.2k|  if (newTrailerDict.isDict()) {
  ------------------
  |  Branch (1007:7): [True: 15.7k, False: 6.52k]
  ------------------
 1008|  15.7k|    saveTrailerDict(newTrailerDict.getDict(), gFalse);
  ------------------
  |  |   18|  15.7k|#define gFalse 0
  ------------------
 1009|  15.7k|  }
 1010|  22.2k|  newTrailerDict.free();
 1011|  22.2k|  delete parser;
 1012|  22.2k|}
_ZN4XRef15saveTrailerDictEP4Dicti:
 1016|  18.7k|void XRef::saveTrailerDict(Dict *dict, GBool isXRefStream) {
 1017|  18.7k|  Object obj;
 1018|  18.7k|  dict->lookupNF("Root", &obj);
 1019|  18.7k|  if (obj.isRef()) {
  ------------------
  |  Branch (1019:7): [True: 4.77k, False: 13.9k]
  ------------------
 1020|  4.77k|    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.77k|    if (!isXRefStream || newRootNum <= last) {
  ------------------
  |  Branch (1023:9): [True: 2.24k, False: 2.53k]
  |  Branch (1023:26): [True: 2.43k, False: 93]
  ------------------
 1024|  4.68k|      rootNum = newRootNum;
 1025|  4.68k|      rootGen = obj.getRefGen();
 1026|  4.68k|      if (!trailerDict.isNone()) {
  ------------------
  |  Branch (1026:11): [True: 1.73k, False: 2.94k]
  ------------------
 1027|  1.73k|	trailerDict.free();
 1028|  1.73k|      }
 1029|  4.68k|      trailerDict.initDict(dict);
 1030|  4.68k|    }
 1031|  4.77k|  }
 1032|  18.7k|  obj.free();
 1033|  18.7k|}
_ZN4XRef20constructObjectEntryEPclPi:
 1037|   872k|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|   872k|  int num = 0;
 1045|  2.34M|  do {
 1046|  2.34M|    num = (num * 10) + (*p - '0');
 1047|  2.34M|    ++p;
 1048|  2.34M|  } while (*p >= '0' && *p <= '9' && num < 100000000);
  ------------------
  |  Branch (1048:12): [True: 1.64M, False: 703k]
  |  Branch (1048:25): [True: 1.47M, False: 163k]
  |  Branch (1048:38): [True: 1.47M, False: 5.40k]
  ------------------
 1049|   872k|  if (*p != '\t' && *p != '\x0c' && *p != ' ') {
  ------------------
  |  Branch (1049:7): [True: 871k, False: 1.32k]
  |  Branch (1049:21): [True: 809k, False: 61.8k]
  |  Branch (1049:37): [True: 475k, False: 334k]
  ------------------
 1050|   475k|    return p;
 1051|   475k|  }
 1052|   428k|  do {
 1053|   428k|    ++p;
 1054|   428k|  } while (*p == '\t' || *p == '\x0c' || *p == ' ');
  ------------------
  |  Branch (1054:12): [True: 4.16k, False: 424k]
  |  Branch (1054:26): [True: 5.58k, False: 418k]
  |  Branch (1054:42): [True: 20.7k, False: 397k]
  ------------------
 1055|   397k|  if (!(*p >= '0' && *p <= '9')) {
  ------------------
  |  Branch (1055:9): [True: 374k, False: 22.9k]
  |  Branch (1055:22): [True: 272k, False: 102k]
  ------------------
 1056|   125k|    return p;
 1057|   125k|  }
 1058|   272k|  int gen = 0;
 1059|   468k|  do {
 1060|   468k|    gen = (gen * 10) + (*p - '0');
 1061|   468k|    ++p;
 1062|   468k|  } while (*p >= '0' && *p <= '9' && gen < 100000000);
  ------------------
  |  Branch (1062:12): [True: 204k, False: 263k]
  |  Branch (1062:25): [True: 196k, False: 8.39k]
  |  Branch (1062:38): [True: 195k, False: 455]
  ------------------
 1063|   272k|  if (*p != '\t' && *p != '\x0c' && *p != ' ') {
  ------------------
  |  Branch (1063:7): [True: 272k, False: 472]
  |  Branch (1063:21): [True: 269k, False: 2.95k]
  |  Branch (1063:37): [True: 17.2k, False: 252k]
  ------------------
 1064|  17.2k|    return p;
 1065|  17.2k|  }
 1066|   264k|  do {
 1067|   264k|    ++p;
 1068|   264k|  } while (*p == '\t' || *p == '\x0c' || *p == ' ');
  ------------------
  |  Branch (1068:12): [True: 1.53k, False: 263k]
  |  Branch (1068:26): [True: 3.25k, False: 259k]
  |  Branch (1068:42): [True: 4.42k, False: 255k]
  ------------------
 1069|   255k|  if (strncmp(p, "obj", 3)) {
  ------------------
  |  Branch (1069:7): [True: 184k, False: 70.6k]
  ------------------
 1070|   184k|    return p;
 1071|   184k|  }
 1072|       |
 1073|  70.6k|  if (constructXRefEntry(num, gen, pos - start, xrefEntryUncompressed)) {
  ------------------
  |  Branch (1073:7): [True: 70.6k, False: 0]
  ------------------
 1074|  70.6k|    *objNum = num;
 1075|  70.6k|  }
 1076|       |
 1077|  70.6k|  return p;
 1078|   255k|}
_ZN4XRef28constructObjectStreamEntriesEP6Objecti:
 1082|   203k|void XRef::constructObjectStreamEntries(Object *objStr, int objStrObjNum) {
 1083|   203k|  Object obj1, obj2;
 1084|       |
 1085|       |  // get the object count
 1086|   203k|  if (!objStr->streamGetDict()->lookup("N", &obj1)->isInt()) {
  ------------------
  |  Branch (1086:7): [True: 548, False: 203k]
  ------------------
 1087|    548|    obj1.free();
 1088|    548|    return;
 1089|    548|  }
 1090|   203k|  int nObjects = obj1.getInt();
 1091|   203k|  obj1.free();
 1092|   203k|  if (nObjects <= 0 || nObjects > 1000000) {
  ------------------
  |  Branch (1092:7): [True: 300, False: 203k]
  |  Branch (1092:24): [True: 270, False: 202k]
  ------------------
 1093|    570|    return;
 1094|    570|  }
 1095|       |
 1096|       |  // parse the header: object numbers and offsets
 1097|   202k|  Parser *parser = new Parser(NULL,
 1098|   202k|			      new Lexer(NULL, objStr->getStream()->copy()),
 1099|   202k|			      gFalse);
  ------------------
  |  |   18|   202k|#define gFalse 0
  ------------------
 1100|  62.8M|  for (int i = 0; i < nObjects; ++i) {
  ------------------
  |  Branch (1100:19): [True: 62.6M, False: 202k]
  ------------------
 1101|  62.6M|    parser->getObj(&obj1, gTrue);
  ------------------
  |  |   17|  62.6M|#define gTrue 1
  ------------------
 1102|  62.6M|    parser->getObj(&obj2, gTrue);
  ------------------
  |  |   17|  62.6M|#define gTrue 1
  ------------------
 1103|  62.6M|    if (obj1.isInt() && obj2.isInt()) {
  ------------------
  |  Branch (1103:9): [True: 115k, False: 62.5M]
  |  Branch (1103:25): [True: 55.1k, False: 60.4k]
  ------------------
 1104|  55.1k|      int num = obj1.getInt();
 1105|  55.1k|      if (num >= 0 && num < 1000000) {
  ------------------
  |  Branch (1105:11): [True: 54.7k, False: 460]
  |  Branch (1105:23): [True: 53.9k, False: 794]
  ------------------
 1106|  53.9k|	constructXRefEntry(num, i, objStrObjNum, xrefEntryCompressed);
 1107|  53.9k|      }
 1108|  55.1k|    }
 1109|  62.6M|    obj2.free();
 1110|  62.6M|    obj1.free();
 1111|  62.6M|  }
 1112|   202k|  delete parser;
 1113|   202k|}
_ZN4XRef18constructXRefEntryEiil13XRefEntryType:
 1116|   124k|			       XRefEntryType type) {
 1117|   124k|  if (num >= size) {
  ------------------
  |  Branch (1117:7): [True: 10.9k, False: 113k]
  ------------------
 1118|  10.9k|    int newSize = (num + 1 + 255) & ~255;
 1119|  10.9k|    if (newSize < 0) {
  ------------------
  |  Branch (1119:9): [True: 0, False: 10.9k]
  ------------------
 1120|      0|      return gFalse;
  ------------------
  |  |   18|      0|#define gFalse 0
  ------------------
 1121|      0|    }
 1122|  10.9k|    entries = (XRefEntry *)greallocn(entries, newSize, sizeof(XRefEntry));
 1123|   452M|    for (int i = size; i < newSize; ++i) {
  ------------------
  |  Branch (1123:24): [True: 452M, False: 10.9k]
  ------------------
 1124|   452M|      entries[i].offset = (GFileOffset)-1;
 1125|   452M|      entries[i].type = xrefEntryFree;
 1126|   452M|    }
 1127|  10.9k|    size = newSize;
 1128|  10.9k|  }
 1129|       |
 1130|   124k|  if (entries[num].type == xrefEntryFree ||
  ------------------
  |  Branch (1130:7): [True: 82.4k, False: 42.0k]
  ------------------
 1131|   121k|      gen >= entries[num].gen) {
  ------------------
  |  Branch (1131:7): [True: 38.7k, False: 3.30k]
  ------------------
 1132|   121k|    entries[num].offset = pos;
 1133|   121k|    entries[num].gen = gen;
 1134|   121k|    entries[num].type = type;
 1135|   121k|    if (num > last) {
  ------------------
  |  Branch (1135:9): [True: 30.1k, False: 91.1k]
  ------------------
 1136|  30.1k|      last = num;
 1137|  30.1k|    }
 1138|   121k|  }
 1139|       |
 1140|   124k|  return gTrue;
  ------------------
  |  |   17|   124k|#define gTrue 1
  ------------------
 1141|   124k|}
_ZN4XRef13setEncryptionEiiPhii14CryptAlgorithm:
 1145|    297|			 CryptAlgorithm encAlgorithmA) {
 1146|    297|  int i;
 1147|       |
 1148|    297|  encrypted = gTrue;
  ------------------
  |  |   17|    297|#define gTrue 1
  ------------------
 1149|    297|  permFlags = permFlagsA;
 1150|    297|  ownerPasswordOk = ownerPasswordOkA;
 1151|    297|  if (keyLengthA <= 32) {
  ------------------
  |  Branch (1151:7): [True: 297, False: 0]
  ------------------
 1152|    297|    keyLength = keyLengthA;
 1153|    297|  } else {
 1154|      0|    keyLength = 32;
 1155|      0|  }
 1156|  6.81k|  for (i = 0; i < keyLength; ++i) {
  ------------------
  |  Branch (1156:15): [True: 6.51k, False: 297]
  ------------------
 1157|  6.51k|    fileKey[i] = fileKeyA[i];
 1158|  6.51k|  }
 1159|    297|  encVersion = encVersionA;
 1160|    297|  encAlgorithm = encAlgorithmA;
 1161|    297|}
_ZN4XRef5fetchEiiP6Objecti:
 1193|  52.9M|Object *XRef::fetch(int num, int gen, Object *obj, int recursion) {
 1194|  52.9M|  XRefEntry *e;
 1195|  52.9M|  Parser *parser;
 1196|  52.9M|  Object obj1, obj2, obj3;
 1197|  52.9M|  XRefCacheEntry tmp;
 1198|  52.9M|  int i, j;
 1199|       |
 1200|       |  // check for bogus ref - this can happen in corrupted PDF files
 1201|  52.9M|  if (num < 0 || num >= size) {
  ------------------
  |  Branch (1201:7): [True: 0, False: 52.9M]
  |  Branch (1201:18): [True: 166k, False: 52.7M]
  ------------------
 1202|   166k|    goto err;
 1203|   166k|  }
 1204|       |
 1205|       |  // check the cache
 1206|  52.7M|#if MULTITHREADED
 1207|  52.7M|  gLockMutex(&cacheMutex);
  ------------------
  |  |   53|  52.7M|#define gLockMutex(m) pthread_mutex_lock(m)
  ------------------
 1208|  52.7M|#endif
 1209|  52.7M|  if (cache[0].num == num && cache[0].gen == gen) {
  ------------------
  |  Branch (1209:7): [True: 732k, False: 52.0M]
  |  Branch (1209:30): [True: 675k, False: 56.5k]
  ------------------
 1210|   675k|    cache[0].obj.copy(obj);
 1211|   675k|#if MULTITHREADED
 1212|   675k|    gUnlockMutex(&cacheMutex);
  ------------------
  |  |   54|   675k|#define gUnlockMutex(m) pthread_mutex_unlock(m)
  ------------------
 1213|   675k|#endif
 1214|   675k|    return obj;
 1215|   675k|  }
 1216|   831M|  for (i = 1; i < xrefCacheSize; ++i) {
  ------------------
  |  |   49|   831M|#define xrefCacheSize 16
  ------------------
  |  Branch (1216:15): [True: 779M, False: 51.9M]
  ------------------
 1217|   779M|    if (cache[i].num == num && cache[i].gen == gen) {
  ------------------
  |  Branch (1217:9): [True: 162k, False: 779M]
  |  Branch (1217:32): [True: 110k, False: 51.7k]
  ------------------
 1218|   110k|      tmp = cache[i];
 1219|   397k|      for (j = i; j > 0; --j) {
  ------------------
  |  Branch (1219:19): [True: 286k, False: 110k]
  ------------------
 1220|   286k|	cache[j] = cache[j - 1];
 1221|   286k|      }
 1222|   110k|      cache[0] = tmp;
 1223|   110k|      cache[0].obj.copy(obj);
 1224|   110k|#if MULTITHREADED
 1225|   110k|      gUnlockMutex(&cacheMutex);
  ------------------
  |  |   54|   110k|#define gUnlockMutex(m) pthread_mutex_unlock(m)
  ------------------
 1226|   110k|#endif
 1227|   110k|      return obj;
 1228|   110k|    }
 1229|   779M|  }
 1230|  51.9M|#if MULTITHREADED
 1231|  51.9M|  gUnlockMutex(&cacheMutex);
  ------------------
  |  |   54|  51.9M|#define gUnlockMutex(m) pthread_mutex_unlock(m)
  ------------------
 1232|  51.9M|#endif
 1233|       |
 1234|  51.9M|  e = &entries[num];
 1235|  51.9M|  switch (e->type) {
 1236|       |
 1237|   189k|  case xrefEntryUncompressed:
  ------------------
  |  Branch (1237:3): [True: 189k, False: 51.7M]
  ------------------
 1238|   189k|    if (e->gen != gen) {
  ------------------
  |  Branch (1238:9): [True: 104k, False: 84.7k]
  ------------------
 1239|   104k|      goto err;
 1240|   104k|    }
 1241|  84.7k|    obj1.initNull();
 1242|  84.7k|    parser = new Parser(this,
 1243|  84.7k|	       new Lexer(this,
 1244|  84.7k|		 str->makeSubStream(start + e->offset, gFalse, 0, &obj1)),
  ------------------
  |  |   18|  84.7k|#define gFalse 0
  ------------------
 1245|  84.7k|	       gTrue);
  ------------------
  |  |   17|  84.7k|#define gTrue 1
  ------------------
 1246|  84.7k|    parser->getObj(&obj1, gTrue);
  ------------------
  |  |   17|  84.7k|#define gTrue 1
  ------------------
 1247|  84.7k|    parser->getObj(&obj2, gTrue);
  ------------------
  |  |   17|  84.7k|#define gTrue 1
  ------------------
 1248|  84.7k|    parser->getObj(&obj3, gTrue);
  ------------------
  |  |   17|  84.7k|#define gTrue 1
  ------------------
 1249|  84.7k|    if (!obj1.isInt() || obj1.getInt() != num ||
  ------------------
  |  Branch (1249:9): [True: 426, False: 84.3k]
  |  Branch (1249:26): [True: 751, False: 83.5k]
  ------------------
 1250|  83.5k|	!obj2.isInt() || obj2.getInt() != gen ||
  ------------------
  |  Branch (1250:2): [True: 151, False: 83.4k]
  |  Branch (1250:19): [True: 297, False: 83.1k]
  ------------------
 1251|  83.1k|	!obj3.isCmd("obj")) {
  ------------------
  |  Branch (1251:2): [True: 2.70k, False: 80.4k]
  ------------------
 1252|  4.32k|      obj1.free();
 1253|  4.32k|      obj2.free();
 1254|  4.32k|      obj3.free();
 1255|  4.32k|      delete parser;
 1256|  4.32k|      goto err;
 1257|  4.32k|    }
 1258|  80.4k|    parser->getObj(obj, gFalse, encrypted ? fileKey : (Guchar *)NULL,
  ------------------
  |  |   18|  80.4k|#define gFalse 0
  ------------------
  |  Branch (1258:33): [True: 2.96k, False: 77.4k]
  ------------------
 1259|  80.4k|		   encAlgorithm, keyLength, num, gen, recursion);
 1260|  80.4k|    obj1.free();
 1261|  80.4k|    obj2.free();
 1262|  80.4k|    obj3.free();
 1263|  80.4k|    delete parser;
 1264|  80.4k|    break;
 1265|       |
 1266|   137k|  case xrefEntryCompressed:
  ------------------
  |  Branch (1266:3): [True: 137k, False: 51.8M]
  ------------------
 1267|       |#if 0 // Adobe apparently ignores the generation number on compressed objects
 1268|       |    if (gen != 0) {
 1269|       |      goto err;
 1270|       |    }
 1271|       |#endif
 1272|   137k|    if (e->offset >= (GFileOffset)size ||
  ------------------
  |  Branch (1272:9): [True: 456, False: 137k]
  ------------------
 1273|   137k|	entries[e->offset].type != xrefEntryUncompressed) {
  ------------------
  |  Branch (1273:2): [True: 342, False: 136k]
  ------------------
 1274|    798|      error(errSyntaxError, -1, "Invalid object stream");
 1275|    798|      goto err;
 1276|    798|    }
 1277|   136k|    if (!getObjectStreamObject((int)e->offset, e->gen, num, obj, recursion)) {
  ------------------
  |  Branch (1277:9): [True: 107k, False: 28.9k]
  ------------------
 1278|   107k|      goto err;
 1279|   107k|    }
 1280|  28.9k|    break;
 1281|       |
 1282|  51.6M|  default:
  ------------------
  |  Branch (1282:3): [True: 51.6M, False: 327k]
  ------------------
 1283|  51.6M|    goto err;
 1284|  51.9M|  }
 1285|       |
 1286|       |  // put the new object in the cache, throwing away the oldest object
 1287|       |  // currently in the cache
 1288|   109k|#if MULTITHREADED
 1289|   109k|  gLockMutex(&cacheMutex);
  ------------------
  |  |   53|   109k|#define gLockMutex(m) pthread_mutex_lock(m)
  ------------------
 1290|   109k|#endif
 1291|   109k|  if (cache[xrefCacheSize - 1].num >= 0) {
  ------------------
  |  |   49|   109k|#define xrefCacheSize 16
  ------------------
  |  Branch (1291:7): [True: 55.1k, False: 54.3k]
  ------------------
 1292|  55.1k|    cache[xrefCacheSize - 1].obj.free();
  ------------------
  |  |   49|  55.1k|#define xrefCacheSize 16
  ------------------
 1293|  55.1k|  }
 1294|  1.75M|  for (i = xrefCacheSize - 1; i > 0; --i) {
  ------------------
  |  |   49|   109k|#define xrefCacheSize 16
  ------------------
  |  Branch (1294:31): [True: 1.64M, False: 109k]
  ------------------
 1295|  1.64M|    cache[i] = cache[i - 1];
 1296|  1.64M|  }
 1297|   109k|  cache[0].num = num;
 1298|   109k|  cache[0].gen = gen;
 1299|   109k|  obj->copy(&cache[0].obj);
 1300|   109k|#if MULTITHREADED
 1301|   109k|  gUnlockMutex(&cacheMutex);
  ------------------
  |  |   54|   109k|#define gUnlockMutex(m) pthread_mutex_unlock(m)
  ------------------
 1302|   109k|#endif
 1303|       |
 1304|   109k|  return obj;
 1305|       |
 1306|  52.0M| err:
 1307|  52.0M|  return obj->initNull();
 1308|  51.9M|}
_ZN4XRef21getObjectStreamObjectEiiiP6Objecti:
 1311|   136k|				  int objNum, Object *obj, int recursion) {
 1312|   136k|  if (recursion >= objectRecursionLimit) {
  ------------------
  |  |   20|   136k|#define objectRecursionLimit 500
  ------------------
  |  Branch (1312:7): [True: 204, False: 136k]
  ------------------
 1313|    204|    return gFalse;
  ------------------
  |  |   18|    204|#define gFalse 0
  ------------------
 1314|    204|  }
 1315|       |
 1316|       |  // check for a cached ObjectStream
 1317|   136k|#if MULTITHREADED
 1318|   136k|  gLockMutex(&objStrsMutex);
  ------------------
  |  |   53|   136k|#define gLockMutex(m) pthread_mutex_lock(m)
  ------------------
 1319|   136k|#endif
 1320|   136k|  ObjectStream *objStr = getObjectStreamFromCache(objStrNum);
 1321|   136k|  GBool found = gFalse;
  ------------------
  |  |   18|   136k|#define gFalse 0
  ------------------
 1322|   136k|  if (objStr) {
  ------------------
  |  Branch (1322:7): [True: 25.3k, False: 111k]
  ------------------
 1323|  25.3k|    objStr->getObject(objIdx, objNum, obj);
 1324|  25.3k|    cleanObjectStreamCache();
 1325|  25.3k|    found = gTrue;
  ------------------
  |  |   17|  25.3k|#define gTrue 1
  ------------------
 1326|  25.3k|  }
 1327|   136k|#if MULTITHREADED
 1328|   136k|  gUnlockMutex(&objStrsMutex);
  ------------------
  |  |   54|   136k|#define gUnlockMutex(m) pthread_mutex_unlock(m)
  ------------------
 1329|   136k|#endif
 1330|   136k|  if (found) {
  ------------------
  |  Branch (1330:7): [True: 25.3k, False: 111k]
  ------------------
 1331|  25.3k|    return gTrue;
  ------------------
  |  |   17|  25.3k|#define gTrue 1
  ------------------
 1332|  25.3k|  }
 1333|       |
 1334|       |  // load a new ObjectStream
 1335|   111k|  objStr = new ObjectStream(this, objStrNum, recursion + 1);
 1336|   111k|  if (!objStr->isOk()) {
  ------------------
  |  Branch (1336:7): [True: 107k, False: 3.56k]
  ------------------
 1337|   107k|    delete objStr;
 1338|   107k|    return gFalse;
  ------------------
  |  |   18|   107k|#define gFalse 0
  ------------------
 1339|   107k|  }
 1340|  3.56k|  objStr->getObject(objIdx, objNum, obj);
 1341|  3.56k|#if MULTITHREADED
 1342|  3.56k|  gLockMutex(&objStrsMutex);
  ------------------
  |  |   53|  3.56k|#define gLockMutex(m) pthread_mutex_lock(m)
  ------------------
 1343|  3.56k|#endif
 1344|  3.56k|  addObjectStreamToCache(objStr);
 1345|  3.56k|  cleanObjectStreamCache();
 1346|  3.56k|#if MULTITHREADED
 1347|  3.56k|  gUnlockMutex(&objStrsMutex);
  ------------------
  |  |   54|  3.56k|#define gUnlockMutex(m) pthread_mutex_unlock(m)
  ------------------
 1348|  3.56k|#endif
 1349|  3.56k|  return gTrue;
  ------------------
  |  |   17|  3.56k|#define gTrue 1
  ------------------
 1350|   111k|}
_ZN4XRef24getObjectStreamFromCacheEi:
 1353|   136k|ObjectStream *XRef::getObjectStreamFromCache(int objStrNum) {
 1354|       |  // check the MRU entry in the cache
 1355|   136k|  if (objStrs[0] && objStrs[0]->getObjStrNum() == objStrNum) {
  ------------------
  |  Branch (1355:7): [True: 30.0k, False: 106k]
  |  Branch (1355:21): [True: 25.1k, False: 4.93k]
  ------------------
 1356|  25.1k|    ObjectStream *objStr = objStrs[0];
 1357|  25.1k|    objStrLastUse[0] = objStrTime++;
 1358|  25.1k|    return objStr;
 1359|  25.1k|  }
 1360|       |
 1361|       |  // check the rest of the cache
 1362|   119k|  for (int i = 1; i < objStrCacheLength; ++i) {
  ------------------
  |  Branch (1362:19): [True: 8.51k, False: 111k]
  ------------------
 1363|  8.51k|    if (objStrs[i] && objStrs[i]->getObjStrNum() == objStrNum) {
  ------------------
  |  Branch (1363:9): [True: 8.51k, False: 0]
  |  Branch (1363:23): [True: 283, False: 8.22k]
  ------------------
 1364|    283|      ObjectStream *objStr = objStrs[i];
 1365|    711|      for (int j = i; j > 0; --j) {
  ------------------
  |  Branch (1365:23): [True: 428, False: 283]
  ------------------
 1366|    428|	objStrs[j] = objStrs[j - 1];
 1367|    428|	objStrLastUse[j] = objStrLastUse[j - 1];
 1368|    428|      }
 1369|    283|      objStrs[0] = objStr;
 1370|    283|      objStrLastUse[0] = objStrTime++;
 1371|    283|      return objStr;
 1372|    283|    }
 1373|  8.51k|  }
 1374|       |
 1375|   111k|  return NULL;
 1376|   111k|}
_ZN4XRef22addObjectStreamToCacheEP12ObjectStream:
 1379|  3.56k|void XRef::addObjectStreamToCache(ObjectStream *objStr) {
 1380|       |  // add to the cache
 1381|  3.56k|  if (objStrCacheLength == objStrCacheSize) {
  ------------------
  |  |   51|  3.56k|#define objStrCacheSize 128
  ------------------
  |  Branch (1381:7): [True: 486, False: 3.07k]
  ------------------
 1382|    486|    delete objStrs[objStrCacheSize - 1];
  ------------------
  |  |   51|    486|#define objStrCacheSize 128
  ------------------
 1383|    486|    --objStrCacheLength;
 1384|    486|  }
 1385|  99.4k|  for (int j = objStrCacheLength; j > 0; --j) {
  ------------------
  |  Branch (1385:35): [True: 95.8k, False: 3.56k]
  ------------------
 1386|  95.8k|    objStrs[j] = objStrs[j - 1];
 1387|  95.8k|    objStrLastUse[j] = objStrLastUse[j - 1];
 1388|  95.8k|  }
 1389|  3.56k|  ++objStrCacheLength;
 1390|  3.56k|  objStrs[0] = objStr;
 1391|  3.56k|  objStrLastUse[0] = objStrTime++;
 1392|  3.56k|}
_ZN4XRef22cleanObjectStreamCacheEv:
 1399|  28.9k|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|  28.9k|  if (objStrCacheLength > 1 &&
  ------------------
  |  Branch (1403:7): [True: 25.0k, False: 3.87k]
  ------------------
 1404|  25.0k|      objStrTime - objStrLastUse[objStrCacheLength - 1]
  ------------------
  |  Branch (1404:7): [True: 1, False: 25.0k]
  ------------------
 1405|  25.0k|        > objStrCacheTimeout) {
  ------------------
  |  |   52|  25.0k|#define objStrCacheTimeout 1000
  ------------------
 1406|      1|    delete objStrs[objStrCacheLength - 1];
 1407|       |    objStrs[objStrCacheLength - 1] = NULL;
 1408|      1|    --objStrCacheLength;
 1409|      1|  }
 1410|  28.9k|}
_ZN4XRef12getStreamEndElPl:
 1421|  90.8k|GBool XRef::getStreamEnd(GFileOffset streamStart, GFileOffset *streamEnd) {
 1422|  90.8k|  int a, b, m;
 1423|       |
 1424|  90.8k|  if (streamEndsLen == 0 ||
  ------------------
  |  Branch (1424:7): [True: 25.5k, False: 65.3k]
  ------------------
 1425|  65.3k|      streamStart > streamEnds[streamEndsLen - 1]) {
  ------------------
  |  Branch (1425:7): [True: 21.6k, False: 43.7k]
  ------------------
 1426|  47.1k|    return gFalse;
  ------------------
  |  |   18|  47.1k|#define gFalse 0
  ------------------
 1427|  47.1k|  }
 1428|       |
 1429|  43.7k|  a = -1;
 1430|  43.7k|  b = streamEndsLen - 1;
 1431|       |  // invariant: streamEnds[a] < streamStart <= streamEnds[b]
 1432|   207k|  while (b - a > 1) {
  ------------------
  |  Branch (1432:10): [True: 164k, False: 43.7k]
  ------------------
 1433|   164k|    m = (a + b) / 2;
 1434|   164k|    if (streamStart <= streamEnds[m]) {
  ------------------
  |  Branch (1434:9): [True: 72.2k, False: 91.8k]
  ------------------
 1435|  72.2k|      b = m;
 1436|  91.8k|    } else {
 1437|  91.8k|      a = m;
 1438|  91.8k|    }
 1439|   164k|  }
 1440|  43.7k|  *streamEnd = streamEnds[b];
 1441|  43.7k|  return gTrue;
  ------------------
  |  |   17|  43.7k|#define gTrue 1
  ------------------
 1442|  90.8k|}
_ZN4XRef15strToFileOffsetEPc:
 1444|    753|GFileOffset XRef::strToFileOffset(char *s) {
 1445|    753|  GFileOffset x, d;
 1446|    753|  char *p;
 1447|       |
 1448|    753|  x = 0;
 1449|  3.24k|  for (p = s; *p && isdigit(*p & 0xff); ++p) {
  ------------------
  |  Branch (1449:15): [True: 3.20k, False: 44]
  |  Branch (1449:21): [True: 2.50k, False: 700]
  ------------------
 1450|  2.50k|    d = *p - '0';
 1451|  2.50k|    if (x > (GFILEOFFSET_MAX - d) / 10) {
  ------------------
  |  |  128|  2.50k|#define GFILEOFFSET_MAX 0x7fffffffffffffffLL
  ------------------
  |  Branch (1451:9): [True: 9, False: 2.49k]
  ------------------
 1452|      9|      break;
 1453|      9|    }
 1454|  2.49k|    x = 10 * x + d;
 1455|  2.49k|  }
 1456|    753|  return x;
 1457|    753|}
_ZN10XRefPosSet9getLengthEv:
   54|    498|  int getLength() { return len; }
_ZN10XRefPosSet3getEi:
   55|    583|  GFileOffset get(int idx) { return tab[idx]; }
_ZN12ObjectStream4isOkEv:
  134|   111k|  GBool isOk() { return ok; }
_ZN12ObjectStream12getObjStrNumEv:
  139|  38.5k|  int getObjStrNum() { return objStrNum; }

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

_ZN6ZxNodeC2Ev:
   64|  1.88M|ZxNode::ZxNode() {
   65|  1.88M|  next = NULL;
   66|  1.88M|  parent = NULL;
   67|       |  firstChild = lastChild = NULL;
   68|  1.88M|}
_ZN6ZxNodeD2Ev:
   70|  1.88M|ZxNode::~ZxNode() {
   71|  1.88M|  ZxNode *child;
   72|       |
   73|  3.76M|  while (firstChild) {
  ------------------
  |  Branch (73:10): [True: 1.88M, False: 1.88M]
  ------------------
   74|  1.88M|    child = firstChild;
   75|  1.88M|    firstChild = firstChild->next;
   76|  1.88M|    delete child;
   77|  1.88M|  }
   78|  1.88M|}
_ZN6ZxNode21findFirstChildElementEPKc:
  143|   166k|ZxElement *ZxNode::findFirstChildElement(const char *type) {
  144|   166k|  ZxNode *child;
  145|       |
  146|   554k|  for (child = firstChild; child; child = child->next) {
  ------------------
  |  Branch (146:28): [True: 397k, False: 156k]
  ------------------
  147|   397k|    if (child->isElement(type)) {
  ------------------
  |  Branch (147:9): [True: 9.84k, False: 388k]
  ------------------
  148|  9.84k|      return (ZxElement *)child;
  149|  9.84k|    }
  150|   397k|  }
  151|   156k|  return NULL;
  152|   166k|}
_ZN6ZxNode8addChildEPS_:
  186|  1.88M|void ZxNode::addChild(ZxNode *child) {
  187|  1.88M|  if (lastChild) {
  ------------------
  |  Branch (187:7): [True: 1.59M, False: 292k]
  ------------------
  188|  1.59M|    lastChild->next = child;
  189|  1.59M|    lastChild = child;
  190|  1.59M|  } else {
  191|   292k|    firstChild = lastChild = child;
  192|   292k|  }
  193|  1.88M|  child->parent = this;
  194|       |  child->next = NULL;
  195|  1.88M|}
_ZN5ZxDocC2Ev:
  199|  1.03k|ZxDoc::ZxDoc() {
  200|  1.03k|  xmlDecl = NULL;
  201|  1.03k|  docTypeDecl = NULL;
  202|       |  root = NULL;
  203|  1.03k|}
_ZN5ZxDoc7loadMemEPKcj:
  205|  1.03k|ZxDoc *ZxDoc::loadMem(const char *data, Guint dataLen) {
  206|  1.03k|  ZxDoc *doc;
  207|       |
  208|  1.03k|  doc = new ZxDoc();
  209|  1.03k|  if (!doc->parse(data, dataLen)) {
  ------------------
  |  Branch (209:7): [True: 360, False: 670]
  ------------------
  210|    360|    delete doc;
  211|    360|    return NULL;
  212|    360|  }
  213|    670|  return doc;
  214|  1.03k|}
_ZN5ZxDoc8addChildEP6ZxNode:
  262|  1.53k|void ZxDoc::addChild(ZxNode *node) {
  263|  1.53k|  if (node->isXMLDecl() && !xmlDecl) {
  ------------------
  |  Branch (263:7): [True: 403, False: 1.12k]
  |  Branch (263:28): [True: 403, False: 0]
  ------------------
  264|    403|    xmlDecl = (ZxXMLDecl *)node;
  265|  1.12k|  } else if (node->isDocTypeDecl() && !docTypeDecl) {
  ------------------
  |  Branch (265:14): [True: 71, False: 1.05k]
  |  Branch (265:39): [True: 71, False: 0]
  ------------------
  266|     71|    docTypeDecl = (ZxDocTypeDecl *)node;
  267|  1.05k|  } else if (node->isElement() && !root) {
  ------------------
  |  Branch (267:14): [True: 670, False: 388]
  |  Branch (267:35): [True: 670, False: 0]
  ------------------
  268|    670|    root = (ZxElement *)node;
  269|    670|  }
  270|  1.53k|  ZxNode::addChild(node);
  271|  1.53k|}
_ZN5ZxDoc5parseEPKcj:
  273|  1.03k|bool ZxDoc::parse(const char *data, Guint dataLen) {
  274|  1.03k|  parsePtr = data;
  275|  1.03k|  parseEnd = data + dataLen;
  276|       |  
  277|  1.03k|  parseSpace();
  278|  1.03k|  parseBOM();
  279|  1.03k|  parseSpace();
  280|  1.03k|  parseXMLDecl(this);
  281|  1.03k|  parseMisc(this);
  282|  1.03k|  parseDocTypeDecl(this);
  283|  1.03k|  parseMisc(this);
  284|  1.03k|  if (match("<")) {
  ------------------
  |  Branch (284:7): [True: 670, False: 360]
  ------------------
  285|    670|    parseElement(this);
  286|    670|  }
  287|  1.03k|  parseMisc(this);
  288|       |  return root != NULL;
  289|  1.03k|}
_ZN5ZxDoc12parseXMLDeclEP6ZxNode:
  291|  1.03k|void ZxDoc::parseXMLDecl(ZxNode *par) {
  292|  1.03k|  GString *version, *encoding, *s;
  293|  1.03k|  bool standalone;
  294|       |
  295|  1.03k|  if (!match("<?xml")) {
  ------------------
  |  Branch (295:7): [True: 627, False: 403]
  ------------------
  296|    627|    return;
  297|    627|  }
  298|    403|  parsePtr += 5;
  299|    403|  parseSpace();
  300|       |
  301|       |  // version
  302|    403|  version = NULL;
  303|    403|  if (match("version")) {
  ------------------
  |  Branch (303:7): [True: 379, False: 24]
  ------------------
  304|    379|    parsePtr += 7;
  305|    379|    parseSpace();
  306|    379|    if (match("=")) {
  ------------------
  |  Branch (306:9): [True: 361, False: 18]
  ------------------
  307|    361|      ++parsePtr;
  308|    361|      parseSpace();
  309|    361|      version = parseQuotedString();
  310|    361|    }
  311|    379|  }
  312|    403|  if (!version) {
  ------------------
  |  Branch (312:7): [True: 42, False: 361]
  ------------------
  313|     42|    version = new GString("1.0");
  314|     42|  }
  315|    403|  parseSpace();
  316|       |	
  317|       |  // encoding
  318|    403|  encoding = NULL;
  319|    403|  if (match("encoding")) {
  ------------------
  |  Branch (319:7): [True: 260, False: 143]
  ------------------
  320|    260|    parsePtr += 8;
  321|    260|    parseSpace();
  322|    260|    if (match("=")) {
  ------------------
  |  Branch (322:9): [True: 243, False: 17]
  ------------------
  323|    243|      ++parsePtr;
  324|    243|      parseSpace();
  325|    243|      encoding = parseQuotedString();
  326|    243|    }
  327|    260|  }
  328|    403|  parseSpace();
  329|       |
  330|       |  // standalone
  331|    403|  standalone = false;
  332|    403|  if (match("standalone")) {
  ------------------
  |  Branch (332:7): [True: 58, False: 345]
  ------------------
  333|     58|    parsePtr += 10;
  334|     58|    parseSpace();
  335|     58|    if (match("=")) {
  ------------------
  |  Branch (335:9): [True: 39, False: 19]
  ------------------
  336|     39|      ++parsePtr;
  337|     39|      parseSpace();
  338|     39|      s = parseQuotedString();
  339|     39|      standalone = !s->cmp("yes");
  340|     39|      delete s;
  341|     39|    }
  342|     58|  }
  343|    403|  parseSpace();
  344|       |
  345|    403|  if (match("?>")) {
  ------------------
  |  Branch (345:7): [True: 207, False: 196]
  ------------------
  346|    207|    parsePtr += 2;
  347|    207|  }
  348|       |
  349|    403|  par->addChild(new ZxXMLDecl(version, encoding, standalone));
  350|    403|}
_ZN5ZxDoc16parseDocTypeDeclEP6ZxNode:
  353|  1.03k|void ZxDoc::parseDocTypeDecl(ZxNode *par) {
  354|  1.03k|  GString *name;
  355|  1.03k|  int state;
  356|  1.03k|  char c, quote;
  357|       |
  358|  1.03k|  if (!match("<!DOCTYPE")) {
  ------------------
  |  Branch (358:7): [True: 959, False: 71]
  ------------------
  359|    959|    return;
  360|    959|  }
  361|     71|  parsePtr += 9;
  362|     71|  parseSpace();
  363|       |
  364|     71|  name = parseName();
  365|     71|  parseSpace();
  366|       |
  367|     71|  state = 0;
  368|     71|  quote = '\0';
  369|   190k|  while (parsePtr < parseEnd && state < 4) {
  ------------------
  |  Branch (369:10): [True: 190k, False: 29]
  |  Branch (369:33): [True: 190k, False: 42]
  ------------------
  370|   190k|    c = *parsePtr++;
  371|   190k|    switch (state) {
  ------------------
  |  Branch (371:13): [True: 190k, False: 0]
  ------------------
  372|  20.1k|    case 0: // not in square brackets; not in quotes
  ------------------
  |  Branch (372:5): [True: 20.1k, False: 170k]
  ------------------
  373|  20.1k|      if (c == '>') {
  ------------------
  |  Branch (373:11): [True: 42, False: 20.1k]
  ------------------
  374|     42|	state = 4;
  375|  20.1k|      } else if (c == '"' || c == '\'') {
  ------------------
  |  Branch (375:18): [True: 152, False: 19.9k]
  |  Branch (375:30): [True: 52, False: 19.8k]
  ------------------
  376|    204|	state = 1;
  377|  19.8k|      } else if (c == '[') {
  ------------------
  |  Branch (377:18): [True: 409, False: 19.4k]
  ------------------
  378|    409|	state = 2;
  379|    409|      }
  380|  20.1k|      break;
  381|  22.9k|    case 1: // not in square brackets; in quotes
  ------------------
  |  Branch (381:5): [True: 22.9k, False: 167k]
  ------------------
  382|  22.9k|      if (c == quote) {
  ------------------
  |  Branch (382:11): [True: 200, False: 22.7k]
  ------------------
  383|    200|	state = 0;
  384|    200|      }
  385|  22.9k|      break;
  386|   107k|    case 2: // in square brackets; not in quotes
  ------------------
  |  Branch (386:5): [True: 107k, False: 83.4k]
  ------------------
  387|   107k|      if (c == ']') {
  ------------------
  |  Branch (387:11): [True: 392, False: 106k]
  ------------------
  388|    392|	state = 0;
  389|   106k|      } else if (c == '"' || c == '\'') {
  ------------------
  |  Branch (389:18): [True: 396, False: 106k]
  |  Branch (389:30): [True: 201, False: 106k]
  ------------------
  390|    597|	state = 3;
  391|    597|      }
  392|   107k|      break;
  393|  40.3k|    case 3: // in square brackets; in quotes
  ------------------
  |  Branch (393:5): [True: 40.3k, False: 150k]
  ------------------
  394|  40.3k|      if (c == quote) {
  ------------------
  |  Branch (394:11): [True: 593, False: 39.7k]
  ------------------
  395|    593|	state = 2;
  396|    593|      }
  397|  40.3k|      break;
  398|   190k|    }
  399|   190k|  }
  400|       |
  401|     71|  par->addChild(new ZxDocTypeDecl(name));
  402|     71|}
_ZN5ZxDoc12parseElementEP6ZxNode:
  405|  1.11M|void ZxDoc::parseElement(ZxNode *par) {
  406|  1.11M|  GString *type;
  407|  1.11M|  ZxElement *elem;
  408|  1.11M|  ZxAttr *attr;
  409|       |
  410|  1.11M|  ++parsePtr;
  411|  1.11M|  type = parseName();
  412|  1.11M|  elem = new ZxElement(type);
  413|  1.11M|  parseSpace();
  414|  1.22M|  while ((attr = parseAttr())) {
  ------------------
  |  Branch (414:10): [True: 113k, False: 1.11M]
  ------------------
  415|   113k|    elem->addAttr(attr);
  416|   113k|    parseSpace();
  417|   113k|  }
  418|  1.11M|  if (match("/>")) {
  ------------------
  |  Branch (418:7): [True: 28.9k, False: 1.08M]
  ------------------
  419|  28.9k|    parsePtr += 2;
  420|  1.08M|  } else if (match(">")) {
  ------------------
  |  Branch (420:14): [True: 291k, False: 790k]
  ------------------
  421|   291k|    ++parsePtr;
  422|   291k|    parseContent(elem);
  423|   291k|  }
  424|  1.11M|  par->addChild(elem);
  425|  1.11M|}
_ZN5ZxDoc9parseAttrEv:
  427|  1.22M|ZxAttr *ZxDoc::parseAttr() {
  428|  1.22M|  GString *name, *value;
  429|  1.22M|  const char *start;
  430|  1.22M|  char quote, c;
  431|  1.22M|  unsigned int x;
  432|  1.22M|  int n;
  433|       |
  434|  1.22M|  name = parseName();
  435|  1.22M|  parseSpace();
  436|  1.22M|  if (!match("=")) {
  ------------------
  |  Branch (436:7): [True: 1.09M, False: 131k]
  ------------------
  437|  1.09M|    delete name;
  438|  1.09M|    return NULL;
  439|  1.09M|  }
  440|   131k|  ++parsePtr;
  441|   131k|  parseSpace();
  442|   131k|  if (!(parsePtr < parseEnd && (*parsePtr == '"' || *parsePtr == '\''))) {
  ------------------
  |  Branch (442:9): [True: 131k, False: 3]
  |  Branch (442:33): [True: 112k, False: 18.2k]
  |  Branch (442:53): [True: 397, False: 17.8k]
  ------------------
  443|  17.8k|    delete name;
  444|  17.8k|    return NULL;
  445|  17.8k|  }
  446|   113k|  quote = *parsePtr++;
  447|   113k|  value = new GString();
  448|   281k|  while (parsePtr < parseEnd && *parsePtr != quote) {
  ------------------
  |  Branch (448:10): [True: 281k, False: 88]
  |  Branch (448:33): [True: 168k, False: 113k]
  ------------------
  449|   168k|    if (*parsePtr == '&') {
  ------------------
  |  Branch (449:9): [True: 36.3k, False: 131k]
  ------------------
  450|  36.3k|      ++parsePtr;
  451|  36.3k|      if (parsePtr < parseEnd && *parsePtr == '#') {
  ------------------
  |  Branch (451:11): [True: 36.3k, False: 5]
  |  Branch (451:34): [True: 19.0k, False: 17.2k]
  ------------------
  452|  19.0k|	++parsePtr;
  453|  19.0k|	if (parsePtr < parseEnd && *parsePtr == 'x') {
  ------------------
  |  Branch (453:6): [True: 19.0k, False: 2]
  |  Branch (453:29): [True: 9.09k, False: 10.0k]
  ------------------
  454|  9.09k|	  ++parsePtr;
  455|  9.09k|	  x = 0;
  456|  16.7k|	  while (parsePtr < parseEnd) {
  ------------------
  |  Branch (456:11): [True: 16.7k, False: 2]
  ------------------
  457|  16.7k|	    c = *parsePtr;
  458|  16.7k|	    if (c >= '0' && c <= '9') {
  ------------------
  |  Branch (458:10): [True: 13.4k, False: 3.28k]
  |  Branch (458:22): [True: 1.90k, False: 11.5k]
  ------------------
  459|  1.90k|	      x = (x << 4) + (c - '0');
  460|  14.8k|	    } else if (c >= 'a' && c <= 'f') {
  ------------------
  |  Branch (460:17): [True: 6.29k, False: 8.50k]
  |  Branch (460:29): [True: 2.50k, False: 3.79k]
  ------------------
  461|  2.50k|	      x = (x << 4) + (10 + c - 'a');
  462|  12.2k|	    } else if (c >= 'A' && c <= 'F') {
  ------------------
  |  Branch (462:17): [True: 7.62k, False: 4.67k]
  |  Branch (462:29): [True: 3.20k, False: 4.41k]
  ------------------
  463|  3.20k|	      x = (x << 4) + (10 + c - 'A');
  464|  9.09k|	    } else {
  465|  9.09k|	      break;
  466|  9.09k|	    }
  467|  7.61k|	    ++parsePtr;
  468|  7.61k|	  }
  469|  9.09k|	  if (parsePtr < parseEnd && *parsePtr == ';') {
  ------------------
  |  Branch (469:8): [True: 9.09k, False: 2]
  |  Branch (469:31): [True: 344, False: 8.74k]
  ------------------
  470|    344|	    ++parsePtr;
  471|    344|	  }
  472|  9.09k|	  appendUTF8(value, x);
  473|  10.0k|	} else {
  474|  10.0k|	  x = 0;
  475|  11.0k|	  while (parsePtr < parseEnd) {
  ------------------
  |  Branch (475:11): [True: 11.0k, False: 3]
  ------------------
  476|  11.0k|	    c = *parsePtr;
  477|  11.0k|	    if (c >= '0' && c <= '9') {
  ------------------
  |  Branch (477:10): [True: 6.48k, False: 4.53k]
  |  Branch (477:22): [True: 1.01k, False: 5.47k]
  ------------------
  478|  1.01k|	      x = x * 10 + (c - '0');
  479|  10.0k|	    } else {
  480|  10.0k|	      break;
  481|  10.0k|	    }
  482|  1.01k|	    ++parsePtr;
  483|  1.01k|	  }
  484|  10.0k|	  if (parsePtr < parseEnd && *parsePtr == ';') {
  ------------------
  |  Branch (484:8): [True: 10.0k, False: 3]
  |  Branch (484:31): [True: 251, False: 9.75k]
  ------------------
  485|    251|	    ++parsePtr;
  486|    251|	  }
  487|  10.0k|	  appendUTF8(value, x);
  488|  10.0k|	}
  489|  19.0k|      } else {
  490|  17.2k|	start = parsePtr;
  491|  17.2k|	for (++parsePtr;
  492|  1.25M|	     parsePtr < parseEnd && *parsePtr != ';' &&
  ------------------
  |  Branch (492:7): [True: 1.25M, False: 22]
  |  Branch (492:30): [True: 1.25M, False: 364]
  ------------------
  493|  1.25M|	       *parsePtr != quote && *parsePtr != '&';
  ------------------
  |  Branch (493:9): [True: 1.25M, False: 4.02k]
  |  Branch (493:31): [True: 1.23M, False: 12.8k]
  ------------------
  494|  1.23M|	     ++parsePtr) ;
  495|  17.2k|	n = (int)(parsePtr - start);
  496|  17.2k|	if (parsePtr < parseEnd && *parsePtr == ';') {
  ------------------
  |  Branch (496:6): [True: 17.2k, False: 22]
  |  Branch (496:29): [True: 364, False: 16.8k]
  ------------------
  497|    364|	  ++parsePtr;
  498|    364|	}
  499|  17.2k|	if (n == 2 && !strncmp(start, "lt", 2)) {
  ------------------
  |  Branch (499:6): [True: 1.70k, False: 15.5k]
  |  Branch (499:16): [True: 197, False: 1.50k]
  ------------------
  500|    197|	  value->append('<');
  501|  17.0k|	} else if (n == 2 && !strncmp(start, "gt", 2)) {
  ------------------
  |  Branch (501:13): [True: 1.50k, False: 15.5k]
  |  Branch (501:23): [True: 272, False: 1.23k]
  ------------------
  502|    272|	  value->append('>');
  503|  16.8k|	} else if (n == 3 && !strncmp(start, "amp", 3)) {
  ------------------
  |  Branch (503:13): [True: 562, False: 16.2k]
  |  Branch (503:23): [True: 81, False: 481]
  ------------------
  504|     81|	  value->append('&');
  505|  16.7k|	} else if (n == 4 && !strncmp(start, "apos", 4)) {
  ------------------
  |  Branch (505:13): [True: 617, False: 16.1k]
  |  Branch (505:23): [True: 0, False: 617]
  ------------------
  506|      0|	  value->append('\'');
  507|  16.7k|	} else if (n == 4 && !strncmp(start, "quot", 4)) {
  ------------------
  |  Branch (507:13): [True: 617, False: 16.1k]
  |  Branch (507:23): [True: 0, False: 617]
  ------------------
  508|      0|	  value->append('"');
  509|  16.7k|	} else {
  510|  16.7k|	  value->append(start - 1, (int)(parsePtr - start) + 1);
  511|  16.7k|	}
  512|  17.2k|      }
  513|   131k|    } else {
  514|   131k|      start = parsePtr;
  515|   131k|      for (++parsePtr;
  516|  16.9M|	   parsePtr < parseEnd && *parsePtr != quote && *parsePtr != '&';
  ------------------
  |  Branch (516:5): [True: 16.9M, False: 60]
  |  Branch (516:28): [True: 16.8M, False: 108k]
  |  Branch (516:50): [True: 16.7M, False: 23.3k]
  ------------------
  517|  16.7M|	   ++parsePtr) ;
  518|   131k|      value->append(start, (int)(parsePtr - start));
  519|   131k|    }
  520|   168k|  }
  521|   113k|  if (parsePtr < parseEnd && *parsePtr == quote) {
  ------------------
  |  Branch (521:7): [True: 113k, False: 88]
  |  Branch (521:30): [True: 113k, False: 0]
  ------------------
  522|   113k|    ++parsePtr;
  523|   113k|  }
  524|   113k|  return new ZxAttr(name, value);
  525|   131k|}
_ZN5ZxDoc12parseContentEP9ZxElement:
  528|   291k|void ZxDoc::parseContent(ZxElement *par) {
  529|   291k|  GString *endType;
  530|       |
  531|   291k|  endType = (new GString("</"))->append(par->getType());
  532|       |
  533|  2.17M|  while (parsePtr < parseEnd) {
  ------------------
  |  Branch (533:10): [True: 1.94M, False: 230k]
  ------------------
  534|  1.94M|    if (match(endType->getCString())) {
  ------------------
  |  Branch (534:9): [True: 61.4k, False: 1.88M]
  ------------------
  535|  61.4k|      parsePtr += endType->getLength();
  536|  61.4k|      parseSpace();
  537|  61.4k|      if (match(">")) {
  ------------------
  |  Branch (537:11): [True: 39.2k, False: 22.2k]
  ------------------
  538|  39.2k|	++parsePtr;
  539|  39.2k|      }
  540|  61.4k|      break;
  541|  1.88M|    } else if (match("<?")) {
  ------------------
  |  Branch (541:16): [True: 14.3k, False: 1.86M]
  ------------------
  542|  14.3k|      parsePI(par);
  543|  1.86M|    } else if (match("<![CDATA[")) {
  ------------------
  |  Branch (543:16): [True: 40, False: 1.86M]
  ------------------
  544|     40|      parseCDSect(par);
  545|  1.86M|    } else if (match("<!--")) {
  ------------------
  |  Branch (545:16): [True: 1.53k, False: 1.86M]
  ------------------
  546|  1.53k|      parseComment(par);
  547|  1.86M|    } else if (match("<")) {
  ------------------
  |  Branch (547:16): [True: 1.11M, False: 754k]
  ------------------
  548|  1.11M|      parseElement(par);
  549|  1.11M|    } else {
  550|   754k|      parseCharData(par);
  551|   754k|    }
  552|  1.94M|  }
  553|       |
  554|   291k|  delete endType;
  555|   291k|}
_ZN5ZxDoc13parseCharDataEP9ZxElement:
  557|   754k|void ZxDoc::parseCharData(ZxElement *par) {
  558|   754k|  GString *data;
  559|   754k|  const char *start;
  560|   754k|  char c;
  561|   754k|  unsigned int x;
  562|   754k|  int n;
  563|       |
  564|   754k|  data = new GString();
  565|  1.73M|  while (parsePtr < parseEnd && *parsePtr != '<') {
  ------------------
  |  Branch (565:10): [True: 1.73M, False: 421]
  |  Branch (565:33): [True: 976k, False: 754k]
  ------------------
  566|   976k|    if (*parsePtr == '&') {
  ------------------
  |  Branch (566:9): [True: 139k, False: 837k]
  ------------------
  567|   139k|      ++parsePtr;
  568|   139k|      if (parsePtr < parseEnd && *parsePtr == '#') {
  ------------------
  |  Branch (568:11): [True: 139k, False: 7]
  |  Branch (568:34): [True: 90.8k, False: 48.4k]
  ------------------
  569|  90.8k|	++parsePtr;
  570|  90.8k|	if (parsePtr < parseEnd && *parsePtr == 'x') {
  ------------------
  |  Branch (570:6): [True: 90.8k, False: 2]
  |  Branch (570:29): [True: 10.5k, False: 80.2k]
  ------------------
  571|  10.5k|	  ++parsePtr;
  572|  10.5k|	  x = 0;
  573|  19.3k|	  while (parsePtr < parseEnd) {
  ------------------
  |  Branch (573:11): [True: 19.3k, False: 7]
  ------------------
  574|  19.3k|	    c = *parsePtr;
  575|  19.3k|	    if (c >= '0' && c <= '9') {
  ------------------
  |  Branch (575:10): [True: 14.6k, False: 4.73k]
  |  Branch (575:22): [True: 1.66k, False: 12.9k]
  ------------------
  576|  1.66k|	      x = (x << 4) + (c - '0');
  577|  17.6k|	    } else if (c >= 'a' && c <= 'f') {
  ------------------
  |  Branch (577:17): [True: 5.37k, False: 12.2k]
  |  Branch (577:29): [True: 2.15k, False: 3.22k]
  ------------------
  578|  2.15k|	      x = (x << 4) + (10 + c - 'a');
  579|  15.5k|	    } else if (c >= 'A' && c <= 'F') {
  ------------------
  |  Branch (579:17): [True: 8.99k, False: 6.52k]
  |  Branch (579:29): [True: 4.97k, False: 4.02k]
  ------------------
  580|  4.97k|	      x = (x << 4) + (10 + c - 'A');
  581|  10.5k|	    } else {
  582|  10.5k|	      break;
  583|  10.5k|	    }
  584|  8.79k|	    ++parsePtr;
  585|  8.79k|	  }
  586|  10.5k|	  if (parsePtr < parseEnd && *parsePtr == ';') {
  ------------------
  |  Branch (586:8): [True: 10.5k, False: 7]
  |  Branch (586:31): [True: 244, False: 10.3k]
  ------------------
  587|    244|	    ++parsePtr;
  588|    244|	  }
  589|  10.5k|	  appendUTF8(data, x);
  590|  80.2k|	} else {
  591|  80.2k|	  x = 0;
  592|  90.8k|	  while (parsePtr < parseEnd) {
  ------------------
  |  Branch (592:11): [True: 90.8k, False: 4]
  ------------------
  593|  90.8k|	    c = *parsePtr;
  594|  90.8k|	    if (c >= '0' && c <= '9') {
  ------------------
  |  Branch (594:10): [True: 39.3k, False: 51.5k]
  |  Branch (594:22): [True: 10.5k, False: 28.7k]
  ------------------
  595|  10.5k|	      x = x * 10 + (c - '0');
  596|  80.2k|	    } else {
  597|  80.2k|	      break;
  598|  80.2k|	    }
  599|  10.5k|	    ++parsePtr;
  600|  10.5k|	  }
  601|  80.2k|	  if (parsePtr < parseEnd && *parsePtr == ';') {
  ------------------
  |  Branch (601:8): [True: 80.2k, False: 4]
  |  Branch (601:31): [True: 332, False: 79.9k]
  ------------------
  602|    332|	    ++parsePtr;
  603|    332|	  }
  604|  80.2k|	  appendUTF8(data, x);
  605|  80.2k|	}
  606|  90.8k|      } else {
  607|  48.4k|	start = parsePtr;
  608|  48.4k|	for (++parsePtr;
  609|  3.88M|	     parsePtr < parseEnd && *parsePtr != ';' &&
  ------------------
  |  Branch (609:7): [True: 3.88M, False: 57]
  |  Branch (609:30): [True: 3.88M, False: 616]
  ------------------
  610|  3.88M|	       *parsePtr != '<' && *parsePtr != '&';
  ------------------
  |  Branch (610:9): [True: 3.86M, False: 19.6k]
  |  Branch (610:29): [True: 3.83M, False: 28.1k]
  ------------------
  611|  3.83M|	     ++parsePtr) ;
  612|  48.4k|	n = (int)(parsePtr - start);
  613|  48.4k|	if (parsePtr < parseEnd && *parsePtr == ';') {
  ------------------
  |  Branch (613:6): [True: 48.3k, False: 57]
  |  Branch (613:29): [True: 616, False: 47.7k]
  ------------------
  614|    616|	  ++parsePtr;
  615|    616|	}
  616|  48.4k|	if (n == 2 && !strncmp(start, "lt", 2)) {
  ------------------
  |  Branch (616:6): [True: 2.28k, False: 46.1k]
  |  Branch (616:16): [True: 473, False: 1.81k]
  ------------------
  617|    473|	  data->append('<');
  618|  47.9k|	} else if (n == 2 && !strncmp(start, "gt", 2)) {
  ------------------
  |  Branch (618:13): [True: 1.81k, False: 46.1k]
  |  Branch (618:23): [True: 325, False: 1.48k]
  ------------------
  619|    325|	  data->append('>');
  620|  47.6k|	} else if (n == 3 && !strncmp(start, "amp", 3)) {
  ------------------
  |  Branch (620:13): [True: 1.27k, False: 46.3k]
  |  Branch (620:23): [True: 109, False: 1.16k]
  ------------------
  621|    109|	  data->append('&');
  622|  47.5k|	} else if (n == 4 && !strncmp(start, "apos", 4)) {
  ------------------
  |  Branch (622:13): [True: 1.56k, False: 45.9k]
  |  Branch (622:23): [True: 0, False: 1.56k]
  ------------------
  623|      0|	  data->append('\'');
  624|  47.5k|	} else if (n == 4 && !strncmp(start, "quot", 4)) {
  ------------------
  |  Branch (624:13): [True: 1.56k, False: 45.9k]
  |  Branch (624:23): [True: 0, False: 1.56k]
  ------------------
  625|      0|	  data->append('"');
  626|  47.5k|	} else {
  627|  47.5k|	  data->append(start - 1, (int)(parsePtr - start) + 1);
  628|  47.5k|	}
  629|  48.4k|      }
  630|   837k|    } else {
  631|   837k|      start = parsePtr;
  632|   837k|      for (++parsePtr;
  633|  27.5M|	   parsePtr < parseEnd && *parsePtr != '<' && *parsePtr != '&';
  ------------------
  |  Branch (633:5): [True: 27.5M, False: 352]
  |  Branch (633:28): [True: 26.8M, False: 733k]
  |  Branch (633:48): [True: 26.7M, False: 103k]
  ------------------
  634|  26.7M|	   ++parsePtr) ;
  635|   837k|      data->append(start, (int)(parsePtr - start));
  636|   837k|    }
  637|   976k|  }
  638|   754k|  par->addChild(new ZxCharData(data, true));
  639|   754k|}
_ZN5ZxDoc10appendUTF8EP7GStringj:
  641|   109k|void ZxDoc::appendUTF8(GString *s, unsigned int c) {
  642|   109k|  if (c <= 0x7f) {
  ------------------
  |  Branch (642:7): [True: 104k, False: 4.95k]
  ------------------
  643|   104k|    s->append((char)c);
  644|   104k|  } else if (c <= 0x7ff) {
  ------------------
  |  Branch (644:14): [True: 1.47k, False: 3.48k]
  ------------------
  645|  1.47k|    s->append((char)(0xc0 + (c >> 6)));
  646|  1.47k|    s->append((char)(0x80 + (c & 0x3f)));
  647|  3.48k|  } else if (c <= 0xffff) {
  ------------------
  |  Branch (647:14): [True: 1.22k, False: 2.26k]
  ------------------
  648|  1.22k|    s->append((char)(0xe0 + (c >> 12)));
  649|  1.22k|    s->append((char)(0x80 + ((c >> 6) & 0x3f)));
  650|  1.22k|    s->append((char)(0x80 + (c & 0x3f)));
  651|  2.26k|  } else if (c <= 0x1fffff) {
  ------------------
  |  Branch (651:14): [True: 974, False: 1.29k]
  ------------------
  652|    974|    s->append((char)(0xf0 + (c >> 18)));
  653|    974|    s->append((char)(0x80 + ((c >> 12) & 0x3f)));
  654|    974|    s->append((char)(0x80 + ((c >> 6) & 0x3f)));
  655|    974|    s->append((char)(0x80 + (c & 0x3f)));
  656|  1.29k|  } else if (c <= 0x3ffffff) {
  ------------------
  |  Branch (656:14): [True: 299, False: 991]
  ------------------
  657|    299|    s->append((char)(0xf8 + (c >> 24)));
  658|    299|    s->append((char)(0x80 + ((c >> 18) & 0x3f)));
  659|    299|    s->append((char)(0x80 + ((c >> 12) & 0x3f)));
  660|    299|    s->append((char)(0x80 + ((c >> 6) & 0x3f)));
  661|    299|    s->append((char)(0x80 + (c & 0x3f)));
  662|    991|  } else if (c <= 0x7fffffff) {
  ------------------
  |  Branch (662:14): [True: 395, False: 596]
  ------------------
  663|    395|    s->append((char)(0xfc + (c >> 30)));
  664|    395|    s->append((char)(0x80 + ((c >> 24) & 0x3f)));
  665|    395|    s->append((char)(0x80 + ((c >> 18) & 0x3f)));
  666|    395|    s->append((char)(0x80 + ((c >> 12) & 0x3f)));
  667|    395|    s->append((char)(0x80 + ((c >> 6) & 0x3f)));
  668|    395|    s->append((char)(0x80 + (c & 0x3f)));
  669|    395|  }
  670|   109k|}
_ZN5ZxDoc11parseCDSectEP6ZxNode:
  673|     40|void ZxDoc::parseCDSect(ZxNode *par) {
  674|     40|  const char *start;
  675|       |
  676|     40|  parsePtr += 9;
  677|     40|  start = parsePtr;
  678|  90.2k|  while (parsePtr < parseEnd - 3) {
  ------------------
  |  Branch (678:10): [True: 90.2k, False: 5]
  ------------------
  679|  90.2k|    if (!strncmp(parsePtr, "]]>", 3)) {
  ------------------
  |  Branch (679:9): [True: 35, False: 90.1k]
  ------------------
  680|     35|      par->addChild(new ZxCharData(new GString(start, (int)(parsePtr - start)),
  681|     35|				   false));
  682|     35|      parsePtr += 3;
  683|     35|      return;
  684|     35|    }
  685|  90.1k|    ++parsePtr;
  686|  90.1k|  }
  687|      5|  parsePtr = parseEnd;
  688|      5|  par->addChild(new ZxCharData(new GString(start, (int)(parsePtr - start)),
  689|      5|			       false));
  690|      5|}
_ZN5ZxDoc9parseMiscEP6ZxNode:
  692|  3.09k|void ZxDoc::parseMisc(ZxNode *par) {
  693|  12.5k|  while (1) {
  ------------------
  |  Branch (693:10): [True: 12.5k, Folded]
  ------------------
  694|  12.5k|    if (match("<!--")) {
  ------------------
  |  Branch (694:9): [True: 121, False: 12.3k]
  ------------------
  695|    121|      parseComment(par);
  696|  12.3k|    } else if (match("<?")) {
  ------------------
  |  Branch (696:16): [True: 282, False: 12.1k]
  ------------------
  697|    282|      parsePI(par);
  698|  12.1k|    } else if (parsePtr < parseEnd && (*parsePtr == '\x20' ||
  ------------------
  |  Branch (698:16): [True: 11.2k, False: 806]
  |  Branch (698:40): [True: 2.91k, False: 8.38k]
  ------------------
  699|  8.38k|				       *parsePtr == '\x09' ||
  ------------------
  |  Branch (699:12): [True: 3.24k, False: 5.13k]
  ------------------
  700|  5.13k|				       *parsePtr == '\x0d' ||
  ------------------
  |  Branch (700:12): [True: 1.01k, False: 4.12k]
  ------------------
  701|  9.01k|				       *parsePtr == '\x0a')) {
  ------------------
  |  Branch (701:12): [True: 1.83k, False: 2.28k]
  ------------------
  702|  9.01k|      ++parsePtr;
  703|  9.01k|    } else {
  704|  3.09k|      break;
  705|  3.09k|    }
  706|  12.5k|  }
  707|  3.09k|}
_ZN5ZxDoc12parseCommentEP6ZxNode:
  710|  1.65k|void ZxDoc::parseComment(ZxNode *par) {
  711|  1.65k|  const char *start;
  712|       |
  713|  1.65k|  parsePtr += 4;
  714|  1.65k|  start = parsePtr;
  715|   223k|  while (parsePtr <= parseEnd - 3) {
  ------------------
  |  Branch (715:10): [True: 223k, False: 22]
  ------------------
  716|   223k|    if (!strncmp(parsePtr, "-->", 3)) {
  ------------------
  |  Branch (716:9): [True: 1.63k, False: 221k]
  ------------------
  717|  1.63k|      par->addChild(new ZxComment(new GString(start, (int)(parsePtr - start))));
  718|  1.63k|      parsePtr += 3;
  719|  1.63k|      return;
  720|  1.63k|    }
  721|   221k|    ++parsePtr;
  722|   221k|  }
  723|     22|  parsePtr = parseEnd;
  724|     22|}
_ZN5ZxDoc7parsePIEP6ZxNode:
  727|  14.6k|void ZxDoc::parsePI(ZxNode *par) {
  728|  14.6k|  GString *target;
  729|  14.6k|  const char *start;
  730|       |
  731|  14.6k|  parsePtr += 2;
  732|  14.6k|  target = parseName();
  733|  14.6k|  parseSpace();
  734|  14.6k|  start = parsePtr;
  735|  1.55M|  while (parsePtr <= parseEnd - 2) {
  ------------------
  |  Branch (735:10): [True: 1.55M, False: 70]
  ------------------
  736|  1.55M|    if (!strncmp(parsePtr, "?>", 2)) {
  ------------------
  |  Branch (736:9): [True: 14.6k, False: 1.53M]
  ------------------
  737|  14.6k|      par->addChild(new ZxPI(target, new GString(start,
  738|  14.6k|						 (int)(parsePtr - start))));
  739|  14.6k|      parsePtr += 2;
  740|  14.6k|      return;
  741|  14.6k|    }
  742|  1.53M|    ++parsePtr;
  743|  1.53M|  }
  744|     70|  parsePtr = parseEnd;
  745|     70|  par->addChild(new ZxPI(target, new GString(start, (int)(parsePtr - start))));
  746|     70|}
_ZN5ZxDoc9parseNameEv:
  750|  2.35M|GString *ZxDoc::parseName() {
  751|  2.35M|  GString *name;
  752|       |
  753|  2.35M|  name = new GString();
  754|  2.35M|  if (parsePtr < parseEnd && nameStartChar[*parsePtr & 0xff]) {
  ------------------
  |  Branch (754:7): [True: 2.35M, False: 114]
  |  Branch (754:30): [True: 1.14M, False: 1.20M]
  ------------------
  755|  1.14M|    name->append(*parsePtr++);
  756|  4.21M|    while (parsePtr < parseEnd && nameChar[*parsePtr & 0xff]) {
  ------------------
  |  Branch (756:12): [True: 4.21M, False: 12]
  |  Branch (756:35): [True: 3.06M, False: 1.14M]
  ------------------
  757|  3.06M|      name->append(*parsePtr++);
  758|  3.06M|    }
  759|  1.14M|  }
  760|  2.35M|  return name;
  761|  2.35M|}
_ZN5ZxDoc17parseQuotedStringEv:
  763|    643|GString *ZxDoc::parseQuotedString() {
  764|    643|  GString *s;
  765|    643|  const char *start;
  766|    643|  char quote;
  767|       |
  768|    643|  if (parsePtr < parseEnd && (*parsePtr == '"' || *parsePtr == '\'')) {
  ------------------
  |  Branch (768:7): [True: 639, False: 4]
  |  Branch (768:31): [True: 548, False: 91]
  |  Branch (768:51): [True: 40, False: 51]
  ------------------
  769|    588|    quote = *parsePtr++;
  770|    588|    start = parsePtr;
  771|  31.3k|    while (parsePtr < parseEnd && *parsePtr != quote) {
  ------------------
  |  Branch (771:12): [True: 31.3k, False: 1]
  |  Branch (771:35): [True: 30.7k, False: 587]
  ------------------
  772|  30.7k|      ++parsePtr;
  773|  30.7k|    }
  774|    588|    s = new GString(start, (int)(parsePtr - start));
  775|    588|    if (parsePtr < parseEnd && *parsePtr == quote) {
  ------------------
  |  Branch (775:9): [True: 587, False: 1]
  |  Branch (775:32): [True: 587, False: 0]
  ------------------
  776|    587|      ++parsePtr;
  777|    587|    }
  778|    588|  } else {
  779|     55|    s = new GString();
  780|     55|  }
  781|    643|  return s;
  782|    643|}
_ZN5ZxDoc8parseBOMEv:
  784|  1.03k|void ZxDoc::parseBOM() {
  785|  1.03k|  if (match("\xef\xbb\xbf")) {
  ------------------
  |  Branch (785:7): [True: 25, False: 1.00k]
  ------------------
  786|     25|    parsePtr += 3;
  787|     25|  }
  788|  1.03k|}
_ZN5ZxDoc10parseSpaceEv:
  790|  2.66M|void ZxDoc::parseSpace() {
  791|  3.91M|  while (parsePtr < parseEnd && (*parsePtr == '\x20' ||
  ------------------
  |  Branch (791:10): [True: 3.91M, False: 289]
  |  Branch (791:34): [True: 1.01M, False: 2.90M]
  ------------------
  792|  2.90M|				 *parsePtr == '\x09' ||
  ------------------
  |  Branch (792:6): [True: 14.8k, False: 2.88M]
  ------------------
  793|  2.88M|				 *parsePtr == '\x0d' ||
  ------------------
  |  Branch (793:6): [True: 51.1k, False: 2.83M]
  ------------------
  794|  2.83M|				 *parsePtr == '\x0a')) {
  ------------------
  |  Branch (794:6): [True: 176k, False: 2.66M]
  ------------------
  795|  1.25M|    ++parsePtr;
  796|  1.25M|  }
  797|  2.66M|}
_ZN5ZxDoc5matchEPKc:
  799|  12.9M|bool ZxDoc::match(const char *s) {
  800|  12.9M|  int n;
  801|       |
  802|  12.9M|  n = (int)strlen(s);
  803|  12.9M|  return parseEnd - parsePtr >= n && !strncmp(parsePtr, s, n);
  ------------------
  |  Branch (803:10): [True: 12.9M, False: 2.92k]
  |  Branch (803:38): [True: 1.68M, False: 11.2M]
  ------------------
  804|  12.9M|}
_ZN9ZxXMLDeclC2EP7GStringS1_b:
  822|    403|ZxXMLDecl::ZxXMLDecl(GString *versionA, GString *encodingA, bool standaloneA) {
  823|    403|  version = versionA;
  824|    403|  encoding = encodingA;
  825|    403|  standalone = standaloneA;
  826|    403|}
_ZN9ZxXMLDeclD2Ev:
  828|    403|ZxXMLDecl::~ZxXMLDecl() {
  829|    403|  delete version;
  830|    403|  if (encoding) {
  ------------------
  |  Branch (830:7): [True: 243, False: 160]
  ------------------
  831|    243|    delete encoding;
  832|    243|  }
  833|    403|}
_ZN13ZxDocTypeDeclC2EP7GString:
  858|     71|ZxDocTypeDecl::ZxDocTypeDecl(GString *nameA) {
  859|     71|  name = nameA;
  860|     71|}
_ZN13ZxDocTypeDeclD2Ev:
  862|     71|ZxDocTypeDecl::~ZxDocTypeDecl() {
  863|     71|  delete name;
  864|     71|}
_ZN9ZxCommentC2EP7GString:
  880|  1.63k|ZxComment::ZxComment(GString *textA) {
  881|  1.63k|  text = textA;
  882|  1.63k|}
_ZN9ZxCommentD2Ev:
  884|  1.63k|ZxComment::~ZxComment() {
  885|  1.63k|  delete text;
  886|  1.63k|}
_ZN4ZxPIC2EP7GStringS1_:
  902|  14.6k|ZxPI::ZxPI(GString *targetA, GString *textA) {
  903|  14.6k|  target = targetA;
  904|  14.6k|  text = textA;
  905|  14.6k|}
_ZN4ZxPID2Ev:
  907|  14.6k|ZxPI::~ZxPI() {
  908|  14.6k|  delete target;
  909|  14.6k|  delete text;
  910|  14.6k|}
_ZN9ZxElementC2EP7GString:
  928|  1.11M|ZxElement::ZxElement(GString *typeA) {
  929|  1.11M|  type = typeA;
  930|  1.11M|  attrs = new GHash();
  931|       |  firstAttr = lastAttr = NULL;
  932|  1.11M|}
_ZN9ZxElementD2Ev:
  934|  1.11M|ZxElement::~ZxElement() {
  935|  1.11M|  delete type;
  936|  1.11M|  deleteGHash(attrs, ZxAttr);
  ------------------
  |  |   60|  1.11M|  do {                                             \
  |  |   61|  1.11M|    GHash *_hash = (hash);                         \
  |  |   62|  1.11M|    {                                              \
  |  |   63|  1.11M|      GHashIter *_iter;                            \
  |  |   64|  1.11M|      GString *_key;                               \
  |  |   65|  1.11M|      void *_p;                                    \
  |  |   66|  1.11M|      _hash->startIter(&_iter);                    \
  |  |   67|  1.22M|      while (_hash->getNext(&_iter, &_key, &_p)) { \
  |  |  ------------------
  |  |  |  Branch (67:14): [True: 113k, False: 1.11M]
  |  |  ------------------
  |  |   68|   113k|        delete (T*)_p;                             \
  |  |   69|   113k|      }                                            \
  |  |   70|  1.11M|      delete _hash;                                \
  |  |   71|  1.11M|    }                                              \
  |  |   72|  1.11M|  } while(0)
  |  |  ------------------
  |  |  |  Branch (72:11): [Folded, False: 1.11M]
  |  |  ------------------
  ------------------
  937|  1.11M|}
_ZN9ZxElement9isElementEPKc:
  939|  1.31M|bool ZxElement::isElement(const char *typeA) {
  940|  1.31M|  return !type->cmp(typeA);
  941|  1.31M|}
_ZN9ZxElement8findAttrEPKc:
  943|   278k|ZxAttr *ZxElement::findAttr(const char *attrName) {
  944|   278k|  return (ZxAttr *)attrs->lookup(attrName);
  945|   278k|}
_ZN9ZxElement7addAttrEP6ZxAttr:
  947|   113k|void ZxElement::addAttr(ZxAttr *attr) {
  948|   113k|  attrs->add(attr->getName(), attr);
  949|   113k|  if (lastAttr) {
  ------------------
  |  Branch (949:7): [True: 37.7k, False: 75.3k]
  ------------------
  950|  37.7k|    lastAttr->next = attr;
  951|  37.7k|    lastAttr= attr;
  952|  75.3k|  } else {
  953|  75.3k|    firstAttr = lastAttr = attr;
  954|  75.3k|  }
  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|   754k|ZxCharData::ZxCharData(GString *dataA, bool parsedA) {
 1040|   754k|  data = dataA;
 1041|   754k|  parsed = parsedA;
 1042|   754k|}
_ZN10ZxCharDataD2Ev:
 1044|   754k|ZxCharData::~ZxCharData() {
 1045|   754k|  delete data;
 1046|   754k|}

_ZN5ZxDoc7getRootEv:
   88|  2.68k|  ZxElement *getRoot() { return root; }
_ZN10ZxCharData7getDataEv:
  257|  1.51k|  GString *getData() { return data; }
_ZN6ZxAttr8getValueEv:
  234|  33.2k|  GString *getValue() { return value; }
_ZN9ZxElement7getTypeEv:
  209|   324k|  GString *getType() { return type; }
_ZN6ZxNode9isXMLDeclEv:
   36|  1.12k|  virtual bool isXMLDecl()  { return false; }
_ZN6ZxNode13isDocTypeDeclEv:
   37|  1.05k|  virtual bool isDocTypeDecl() { return false; }
_ZN6ZxNode9isElementEv:
   40|   121k|  virtual bool isElement() { return false; }
_ZN6ZxNode9isElementEPKc:
   41|   174k|  virtual bool isElement(const char *type) { return false; }
_ZN6ZxNode10isCharDataEv:
   42|    796|  virtual bool isCharData() { return false; }
_ZN6ZxNode13getFirstChildEv:
   43|   144k|  virtual ZxNode *getFirstChild() { return firstChild; }
_ZN6ZxNode12getNextChildEv:
   44|   299k|  virtual ZxNode *getNextChild() { return next; }
_ZN9ZxXMLDecl9isXMLDeclEv:
  129|    403|  virtual bool isXMLDecl() { return true; }
_ZN13ZxDocTypeDecl13isDocTypeDeclEv:
  151|     71|  virtual bool isDocTypeDecl() { return true; }
_ZN9ZxElement9isElementEv:
  207|   181k|  virtual bool isElement() { return true; }
_ZN6ZxAttr7getNameEv:
  233|   113k|  GString *getName() { return name; }
_ZN10ZxCharData10isCharDataEv:
  256|  1.51k|  virtual bool isCharData() { return true; }

