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

_ZN5GHashC2Ei:
   34|  1.47M|GHash::GHash(GBool deleteKeysA) {
   35|  1.47M|  int h;
   36|       |
   37|  1.47M|  deleteKeys = deleteKeysA;
   38|  1.47M|  size = 7;
   39|  1.47M|  tab = (GHashBucket **)gmallocn(size, sizeof(GHashBucket *));
   40|  11.8M|  for (h = 0; h < size; ++h) {
  ------------------
  |  Branch (40:15): [True: 10.3M, False: 1.47M]
  ------------------
   41|       |    tab[h] = NULL;
   42|  10.3M|  }
   43|  1.47M|  len = 0;
   44|  1.47M|}
_ZN5GHashD2Ev:
   46|  1.47M|GHash::~GHash() {
   47|  1.47M|  GHashBucket *p;
   48|  1.47M|  int h;
   49|       |
   50|  11.8M|  for (h = 0; h < size; ++h) {
  ------------------
  |  Branch (50:15): [True: 10.3M, False: 1.47M]
  ------------------
   51|  10.6M|    while (tab[h]) {
  ------------------
  |  Branch (51:12): [True: 295k, False: 10.3M]
  ------------------
   52|   295k|      p = tab[h];
   53|   295k|      tab[h] = p->next;
   54|   295k|      if (deleteKeys) {
  ------------------
  |  Branch (54:11): [True: 10.8k, False: 284k]
  ------------------
   55|  10.8k|	delete p->key;
   56|  10.8k|      }
   57|   295k|      delete p;
   58|   295k|    }
   59|  10.3M|  }
   60|  1.47M|  gfree(tab);
   61|  1.47M|}
_ZN5GHash3addEP7GStringPv:
   63|   256k|void GHash::add(GString *key, void *val) {
   64|   256k|  GHashBucket *p;
   65|   256k|  int h;
   66|       |
   67|       |  // expand the table if necessary
   68|   256k|  if (len >= size) {
  ------------------
  |  Branch (68:7): [True: 1.00k, False: 255k]
  ------------------
   69|  1.00k|    expand();
   70|  1.00k|  }
   71|       |
   72|       |  // add the new symbol
   73|   256k|  p = new GHashBucket;
   74|   256k|  p->key = key;
   75|   256k|  p->val.p = val;
   76|   256k|  h = hash(key);
   77|   256k|  p->next = tab[h];
   78|   256k|  tab[h] = p;
   79|   256k|  ++len;
   80|   256k|}
_ZN5GHash3addEP7GStringi:
   82|  38.9k|void GHash::add(GString *key, int val) {
   83|  38.9k|  GHashBucket *p;
   84|  38.9k|  int h;
   85|       |
   86|       |  // expand the table if necessary
   87|  38.9k|  if (len >= size) {
  ------------------
  |  Branch (87:7): [True: 287, False: 38.6k]
  ------------------
   88|    287|    expand();
   89|    287|  }
   90|       |
   91|       |  // add the new symbol
   92|  38.9k|  p = new GHashBucket;
   93|  38.9k|  p->key = key;
   94|  38.9k|  p->val.i = val;
   95|  38.9k|  h = hash(key);
   96|  38.9k|  p->next = tab[h];
   97|  38.9k|  tab[h] = p;
   98|  38.9k|  ++len;
   99|  38.9k|}
_ZN5GHash7replaceEP7GStringi:
  115|  47.5k|void GHash::replace(GString *key, int val) {
  116|  47.5k|  GHashBucket *p;
  117|  47.5k|  int h;
  118|       |
  119|  47.5k|  if ((p = find(key, &h))) {
  ------------------
  |  Branch (119:7): [True: 8.61k, False: 38.9k]
  ------------------
  120|  8.61k|    p->val.i = val;
  121|  8.61k|    if (deleteKeys) {
  ------------------
  |  Branch (121:9): [True: 0, False: 8.61k]
  ------------------
  122|      0|      delete key;
  123|      0|    }
  124|  38.9k|  } else {
  125|  38.9k|    add(key, val);
  126|  38.9k|  }
  127|  47.5k|}
_ZN5GHash6lookupEP7GString:
  129|  9.18k|void *GHash::lookup(GString *key) {
  130|  9.18k|  GHashBucket *p;
  131|  9.18k|  int h;
  132|       |
  133|  9.18k|  if (!(p = find(key, &h))) {
  ------------------
  |  Branch (133:7): [True: 9.18k, False: 6]
  ------------------
  134|  9.18k|    return NULL;
  135|  9.18k|  }
  136|      6|  return p->val.p;
  137|  9.18k|}
_ZN5GHash9lookupIntEP7GString:
  139|  47.5k|int GHash::lookupInt(GString *key) {
  140|  47.5k|  GHashBucket *p;
  141|  47.5k|  int h;
  142|       |
  143|  47.5k|  if (!(p = find(key, &h))) {
  ------------------
  |  Branch (143:7): [True: 38.9k, False: 8.61k]
  ------------------
  144|  38.9k|    return 0;
  145|  38.9k|  }
  146|  8.61k|  return p->val.i;
  147|  47.5k|}
_ZN5GHash6lookupEPKc:
  149|   870k|void *GHash::lookup(const char *key) {
  150|   870k|  GHashBucket *p;
  151|   870k|  int h;
  152|       |
  153|   870k|  if (!(p = find(key, &h))) {
  ------------------
  |  Branch (153:7): [True: 819k, False: 50.7k]
  ------------------
  154|   819k|    return NULL;
  155|   819k|  }
  156|  50.7k|  return p->val.p;
  157|   870k|}
_ZN5GHash9startIterEPP9GHashIter:
  261|  1.41M|void GHash::startIter(GHashIter **iter) {
  262|  1.41M|  *iter = new GHashIter;
  263|  1.41M|  (*iter)->h = -1;
  264|       |  (*iter)->p = NULL;
  265|  1.41M|}
_ZN5GHash7getNextEPP9GHashIterPP7GStringPPv:
  267|  1.67M|GBool GHash::getNext(GHashIter **iter, GString **key, void **val) {
  268|  1.67M|  if (!*iter) {
  ------------------
  |  Branch (268:7): [True: 0, False: 1.67M]
  ------------------
  269|      0|    return gFalse;
  ------------------
  |  |   18|      0|#define gFalse 0
  ------------------
  270|      0|  }
  271|  1.67M|  if ((*iter)->p) {
  ------------------
  |  Branch (271:7): [True: 256k, False: 1.41M]
  ------------------
  272|   256k|    (*iter)->p = (*iter)->p->next;
  273|   256k|  }
  274|  11.6M|  while (!(*iter)->p) {
  ------------------
  |  Branch (274:10): [True: 11.3M, False: 256k]
  ------------------
  275|  11.3M|    if (++(*iter)->h == size) {
  ------------------
  |  Branch (275:9): [True: 1.41M, False: 9.93M]
  ------------------
  276|  1.41M|      delete *iter;
  277|  1.41M|      *iter = NULL;
  278|  1.41M|      return gFalse;
  ------------------
  |  |   18|  1.41M|#define gFalse 0
  ------------------
  279|  1.41M|    }
  280|  9.93M|    (*iter)->p = tab[(*iter)->h];
  281|  9.93M|  }
  282|   256k|  *key = (*iter)->p->key;
  283|   256k|  *val = (*iter)->p->val.p;
  284|   256k|  return gTrue;
  ------------------
  |  |   17|   256k|#define gTrue 1
  ------------------
  285|  1.67M|}
_ZN5GHash6expandEv:
  312|  1.28k|void GHash::expand() {
  313|  1.28k|  GHashBucket **oldTab;
  314|  1.28k|  GHashBucket *p;
  315|  1.28k|  int oldSize, h, i;
  316|       |
  317|  1.28k|  oldSize = size;
  318|  1.28k|  oldTab = tab;
  319|  1.28k|  size = 2*size + 1;
  320|  1.28k|  tab = (GHashBucket **)gmallocn(size, sizeof(GHashBucket *));
  321|  48.7k|  for (h = 0; h < size; ++h) {
  ------------------
  |  Branch (321:15): [True: 47.4k, False: 1.28k]
  ------------------
  322|  47.4k|    tab[h] = NULL;
  323|  47.4k|  }
  324|  24.3k|  for (i = 0; i < oldSize; ++i) {
  ------------------
  |  Branch (324:15): [True: 23.1k, False: 1.28k]
  ------------------
  325|  46.2k|    while (oldTab[i]) {
  ------------------
  |  Branch (325:12): [True: 23.1k, False: 23.1k]
  ------------------
  326|  23.1k|      p = oldTab[i];
  327|  23.1k|      oldTab[i] = oldTab[i]->next;
  328|  23.1k|      h = hash(p->key);
  329|  23.1k|      p->next = tab[h];
  330|  23.1k|      tab[h] = p;
  331|  23.1k|    }
  332|  23.1k|  }
  333|  1.28k|  gfree(oldTab);
  334|  1.28k|}
_ZN5GHash4findEP7GStringPi:
  336|   104k|GHashBucket *GHash::find(GString *key, int *h) {
  337|   104k|  GHashBucket *p;
  338|       |
  339|   104k|  *h = hash(key);
  340|   117k|  for (p = tab[*h]; p; p = p->next) {
  ------------------
  |  Branch (340:21): [True: 30.4k, False: 87.0k]
  ------------------
  341|  30.4k|    if (!p->key->cmp(key)) {
  ------------------
  |  Branch (341:9): [True: 17.2k, False: 13.2k]
  ------------------
  342|  17.2k|      return p;
  343|  17.2k|    }
  344|  30.4k|  }
  345|  87.0k|  return NULL;
  346|   104k|}
_ZN5GHash4findEPKcPi:
  348|   870k|GHashBucket *GHash::find(const char *key, int *h) {
  349|   870k|  GHashBucket *p;
  350|       |
  351|   870k|  *h = hash(key);
  352|   887k|  for (p = tab[*h]; p; p = p->next) {
  ------------------
  |  Branch (352:21): [True: 67.8k, False: 819k]
  ------------------
  353|  67.8k|    if (!p->key->cmp(key)) {
  ------------------
  |  Branch (353:9): [True: 50.7k, False: 17.0k]
  ------------------
  354|  50.7k|      return p;
  355|  50.7k|    }
  356|  67.8k|  }
  357|   819k|  return NULL;
  358|   870k|}
_ZN5GHash4hashEP7GString:
  360|   422k|int GHash::hash(GString *key) {
  361|   422k|  const char *p;
  362|   422k|  unsigned int h;
  363|   422k|  int i;
  364|       |
  365|   422k|  h = 0;
  366|   168M|  for (p = key->getCString(), i = 0; i < key->getLength(); ++p, ++i) {
  ------------------
  |  Branch (366:38): [True: 167M, False: 422k]
  ------------------
  367|   167M|    h = 17 * h + (int)(*p & 0xff);
  368|   167M|  }
  369|   422k|  return (int)(h % size);
  370|   422k|}
_ZN5GHash4hashEPKc:
  372|   870k|int GHash::hash(const char *key) {
  373|   870k|  const char *p;
  374|   870k|  unsigned int h;
  375|       |
  376|   870k|  h = 0;
  377|  8.63M|  for (p = key; *p; ++p) {
  ------------------
  |  Branch (377:17): [True: 7.76M, False: 870k]
  ------------------
  378|  7.76M|    h = 17 * h + (int)(*p & 0xff);
  379|  7.76M|  }
  380|   870k|  return (int)(h % size);
  381|   870k|}

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

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

Object.cc:_ZL16gAtomicIncrementPl:
   67|  3.40M|static inline GAtomicCounter gAtomicIncrement(GAtomicCounter *counter) {
   68|  3.40M|  GAtomicCounter newVal;
   69|       |
   70|       |#if defined(_WIN32)
   71|       |  newVal = _InterlockedIncrement(counter);
   72|       |#elif defined(__GNUC__) || defined(__xlC__)
   73|       |  // __GNUC__ also covers LLVM/clang
   74|  3.40M|  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|  3.40M|  return newVal;
   81|  3.40M|}
Object.cc:_ZL16gAtomicDecrementPl:
   85|  4.74M|static inline GAtomicCounter gAtomicDecrement(GAtomicCounter *counter) {
   86|  4.74M|  GAtomicCounter newVal;
   87|       |
   88|       |#if defined(_WIN32)
   89|       |  newVal = _InterlockedDecrement(counter);
   90|       |#elif defined(__GNUC__) || defined(__xlC__)
   91|       |  // __GNUC__ also covers LLVM/clang
   92|  4.74M|  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|  4.74M|  return newVal;
   99|  4.74M|}

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

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

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

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

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

_ZN8AcroForm4loadEP6PDFDocP7CatalogP6Object:
  337|  2.92k|AcroForm *AcroForm::load(PDFDoc *docA, Catalog *catalog, Object *acroFormObjA) {
  338|  2.92k|  Object acroFormObj2;
  339|  2.92k|  AcroForm *acroForm;
  340|  2.92k|  AcroFormField *field;
  341|  2.92k|  Object xfaObj, fieldsObj, annotsObj, annotRef, annotObj, obj1, obj2;
  342|  2.92k|  char *touchedObjs;
  343|  2.92k|  int pageNum, i, j;
  344|       |
  345|  2.92k|  touchedObjs = (char *)gmalloc(docA->getXRef()->getNumObjects());
  346|  2.92k|  memset(touchedObjs, 0, docA->getXRef()->getNumObjects());
  347|       |
  348|       |  // this is the normal case: acroFormObj is a dictionary, as expected
  349|  2.92k|  if (acroFormObjA->isDict()) {
  ------------------
  |  Branch (349:7): [True: 1.50k, False: 1.42k]
  ------------------
  350|  1.50k|    acroForm = new AcroForm(docA, acroFormObjA);
  351|       |
  352|  1.50k|    if (globalParams->getEnableXFA()) {
  ------------------
  |  Branch (352:9): [True: 1.50k, False: 0]
  ------------------
  353|  1.50k|      if (!acroFormObjA->dictLookup("XFA", &xfaObj)->isNull()) {
  ------------------
  |  Branch (353:11): [True: 1.26k, False: 241]
  ------------------
  354|  1.26k|	acroForm->xfaScanner = XFAScanner::load(&xfaObj);
  355|  1.26k|	if (!catalog->getNeedsRendering()) {
  ------------------
  |  Branch (355:6): [True: 1.25k, False: 8]
  ------------------
  356|  1.25k|	  acroForm->isStaticXFA = gTrue;
  ------------------
  |  |   17|  1.25k|#define gTrue 1
  ------------------
  357|  1.25k|	}
  358|  1.26k|      }
  359|  1.50k|      xfaObj.free();
  360|  1.50k|    }
  361|       |
  362|  1.50k|    if (acroFormObjA->dictLookup("NeedAppearances", &obj1)->isBool()) {
  ------------------
  |  Branch (362:9): [True: 34, False: 1.47k]
  ------------------
  363|     34|      acroForm->needAppearances = obj1.getBool();
  364|     34|    }
  365|  1.50k|    obj1.free();
  366|       |
  367|  1.50k|    acroForm->buildAnnotPageList(catalog);
  368|       |
  369|  1.50k|    if (!acroFormObjA->dictLookup("Fields", &obj1)->isArray()) {
  ------------------
  |  Branch (369:9): [True: 11, False: 1.49k]
  ------------------
  370|     11|      if (!obj1.isNull()) {
  ------------------
  |  Branch (370:11): [True: 2, False: 9]
  ------------------
  371|      2|	error(errSyntaxError, -1, "AcroForm Fields entry is wrong type");
  372|      2|      }
  373|     11|      obj1.free();
  374|     11|      delete acroForm;
  375|     11|      gfree(touchedObjs);
  376|     11|      return NULL;
  377|     11|    }
  378|  35.4k|    for (i = 0; i < obj1.arrayGetLength(); ++i) {
  ------------------
  |  Branch (378:17): [True: 33.9k, False: 1.49k]
  ------------------
  379|  33.9k|      obj1.arrayGetNF(i, &obj2);
  380|  33.9k|      acroForm->scanField(&obj2, touchedObjs);
  381|  33.9k|      obj2.free();
  382|  33.9k|    }
  383|  1.49k|    obj1.free();
  384|       |
  385|       |    // scan the annotations, looking for Widget-type annots that are
  386|       |    // not attached to the AcroForm object
  387|   128k|    for (pageNum = 1; pageNum <= catalog->getNumPages(); ++pageNum) {
  ------------------
  |  Branch (387:23): [True: 127k, False: 1.49k]
  ------------------
  388|   127k|      if (catalog->getPage(pageNum)->getAnnots(&annotsObj)->isArray()) {
  ------------------
  |  Branch (388:11): [True: 100k, False: 26.1k]
  ------------------
  389|  3.46M|	for (i = 0; i < annotsObj.arrayGetLength(); ++i) {
  ------------------
  |  Branch (389:14): [True: 3.36M, False: 100k]
  ------------------
  390|  3.36M|	  if (annotsObj.arrayGetNF(i, &annotRef)->isRef()) {
  ------------------
  |  Branch (390:8): [True: 838k, False: 2.52M]
  ------------------
  391|  1.20M|	    for (j = 0; j < acroForm->fields->getLength(); ++j) {
  ------------------
  |  Branch (391:18): [True: 501k, False: 704k]
  ------------------
  392|   501k|	      field = (AcroFormField *)acroForm->fields->get(j);
  393|   501k|	      if (field->fieldRef.isRef()) {
  ------------------
  |  Branch (393:12): [True: 464k, False: 37.1k]
  ------------------
  394|   464k|		if (field->fieldRef.getRefNum() == annotRef.getRefNum() &&
  ------------------
  |  Branch (394:7): [True: 199k, False: 264k]
  ------------------
  395|   199k|		    field->fieldRef.getRefGen() == annotRef.getRefGen()) {
  ------------------
  |  Branch (395:7): [True: 133k, False: 66.6k]
  ------------------
  396|   133k|		  break;
  397|   133k|		}
  398|   464k|	      }
  399|   501k|	    }
  400|   838k|	    if (j == acroForm->fields->getLength()) {
  ------------------
  |  Branch (400:10): [True: 704k, False: 133k]
  ------------------
  401|   704k|	      annotRef.fetch(acroForm->doc->getXRef(), &annotObj);
  402|   704k|	      if (annotObj.isDict()) {
  ------------------
  |  Branch (402:12): [True: 145k, False: 559k]
  ------------------
  403|   145k|		if (annotObj.dictLookup("Subtype", &obj1)->isName("Widget")) {
  ------------------
  |  Branch (403:7): [True: 612, False: 144k]
  ------------------
  404|    612|		  acroForm->scanField(&annotRef, touchedObjs);
  405|    612|		}
  406|   145k|		obj1.free();
  407|   145k|	      }
  408|   704k|	      annotObj.free();
  409|   704k|	    }
  410|   838k|	  }
  411|  3.36M|	  annotRef.free();
  412|  3.36M|	}
  413|   100k|      }
  414|   127k|      annotsObj.free();
  415|   127k|    }
  416|       |
  417|       |  // if acroFormObjA is a null object, but there are Widget-type
  418|       |  // annots, we still create an AcroForm
  419|  1.49k|  } else {
  420|       |    // create an empty dict for acroFormObj
  421|  1.42k|    acroFormObj2.initDict(docA->getXRef());
  422|  1.42k|    acroForm = new AcroForm(docA, &acroFormObj2);
  423|  1.42k|    acroFormObj2.free();
  424|       |
  425|  1.42k|    acroForm->buildAnnotPageList(catalog);
  426|       |
  427|       |    // scan the annotations, looking for any Widget-type annots
  428|  40.0k|    for (pageNum = 1; pageNum <= catalog->getNumPages(); ++pageNum) {
  ------------------
  |  Branch (428:23): [True: 38.6k, False: 1.42k]
  ------------------
  429|  38.6k|      if (catalog->getPage(pageNum)->getAnnots(&annotsObj)->isArray()) {
  ------------------
  |  Branch (429:11): [True: 13.1k, False: 25.5k]
  ------------------
  430|   376k|	for (i = 0; i < annotsObj.arrayGetLength(); ++i) {
  ------------------
  |  Branch (430:14): [True: 363k, False: 13.1k]
  ------------------
  431|   363k|	  if (annotsObj.arrayGetNF(i, &annotRef)->isRef()) {
  ------------------
  |  Branch (431:8): [True: 73.5k, False: 290k]
  ------------------
  432|  73.5k|	    annotRef.fetch(acroForm->doc->getXRef(), &annotObj);
  433|  73.5k|	    if (annotObj.isDict()) {
  ------------------
  |  Branch (433:10): [True: 36.2k, False: 37.2k]
  ------------------
  434|  36.2k|	      if (annotObj.dictLookup("Subtype", &obj1)->isName("Widget")) {
  ------------------
  |  Branch (434:12): [True: 22.2k, False: 13.9k]
  ------------------
  435|  22.2k|		acroForm->scanField(&annotRef, touchedObjs);
  436|  22.2k|	      }
  437|  36.2k|	      obj1.free();
  438|  36.2k|	    }
  439|  73.5k|	    annotObj.free();
  440|  73.5k|	  }
  441|   363k|	  annotRef.free();
  442|   363k|	}
  443|  13.1k|      }
  444|  38.6k|      annotsObj.free();
  445|  38.6k|    }
  446|       |
  447|  1.42k|    if (acroForm->fields->getLength() == 0) {
  ------------------
  |  Branch (447:9): [True: 1.40k, False: 18]
  ------------------
  448|  1.40k|      delete acroForm;
  449|  1.40k|      acroForm = NULL;
  450|  1.40k|    }
  451|  1.42k|  }
  452|       |
  453|  2.91k|  gfree(touchedObjs);
  454|       |
  455|  2.91k|  return acroForm;
  456|  2.92k|}
_ZN8AcroFormC2EP6PDFDocP6Object:
  458|  2.92k|AcroForm::AcroForm(PDFDoc *docA, Object *acroFormObjA) {
  459|  2.92k|  doc = docA;
  460|  2.92k|  acroFormObjA->copy(&acroFormObj);
  461|  2.92k|  needAppearances = gFalse;
  ------------------
  |  |   18|  2.92k|#define gFalse 0
  ------------------
  462|  2.92k|  annotPages = new GList();
  463|  2.92k|  fields = new GList();
  464|  2.92k|  xfaScanner = NULL;
  465|  2.92k|  isStaticXFA = gFalse;
  ------------------
  |  |   18|  2.92k|#define gFalse 0
  ------------------
  466|  2.92k|}
_ZN8AcroFormD2Ev:
  468|  2.92k|AcroForm::~AcroForm() {
  469|  2.92k|  acroFormObj.free();
  470|  2.92k|  deleteGList(annotPages, AcroFormAnnotPage);
  ------------------
  |  |   94|  2.92k|  do {                                              \
  |  |   95|  2.92k|    GList *_list = (list);                          \
  |  |   96|  2.92k|    {                                               \
  |  |   97|  2.92k|      int _i;                                       \
  |  |   98|   914k|      for (_i = 0; _i < _list->getLength(); ++_i) { \
  |  |  ------------------
  |  |  |  Branch (98:20): [True: 911k, False: 2.92k]
  |  |  ------------------
  |  |   99|   911k|        delete (T*)_list->get(_i);                  \
  |  |  100|   911k|      }                                             \
  |  |  101|  2.92k|      delete _list;                                 \
  |  |  102|  2.92k|    }                                               \
  |  |  103|  2.92k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (103:12): [Folded, False: 2.92k]
  |  |  ------------------
  ------------------
  471|  2.92k|  deleteGList(fields, AcroFormField);
  ------------------
  |  |   94|  2.92k|  do {                                              \
  |  |   95|  2.92k|    GList *_list = (list);                          \
  |  |   96|  2.92k|    {                                               \
  |  |   97|  2.92k|      int _i;                                       \
  |  |   98|  5.77k|      for (_i = 0; _i < _list->getLength(); ++_i) { \
  |  |  ------------------
  |  |  |  Branch (98:20): [True: 2.84k, False: 2.92k]
  |  |  ------------------
  |  |   99|  2.84k|        delete (T*)_list->get(_i);                  \
  |  |  100|  2.84k|      }                                             \
  |  |  101|  2.92k|      delete _list;                                 \
  |  |  102|  2.92k|    }                                               \
  |  |  103|  2.92k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (103:12): [Folded, False: 2.92k]
  |  |  ------------------
  ------------------
  472|  2.92k|  delete xfaScanner;
  473|  2.92k|}
_ZN8AcroForm18buildAnnotPageListEP7Catalog:
  479|  2.92k|void AcroForm::buildAnnotPageList(Catalog *catalog) {
  480|  2.92k|  Object annotsObj, annotObj;
  481|  2.92k|  int pageNum, i;
  482|       |
  483|   168k|  for (pageNum = 1; pageNum <= catalog->getNumPages(); ++pageNum) {
  ------------------
  |  Branch (483:21): [True: 165k, False: 2.92k]
  ------------------
  484|   165k|    if (catalog->getPage(pageNum)->getAnnots(&annotsObj)->isArray()) {
  ------------------
  |  Branch (484:9): [True: 114k, False: 51.7k]
  ------------------
  485|  3.84M|      for (i = 0; i < annotsObj.arrayGetLength(); ++i) {
  ------------------
  |  Branch (485:19): [True: 3.72M, False: 114k]
  ------------------
  486|  3.72M|	if (annotsObj.arrayGetNF(i, &annotObj)->isRef()) {
  ------------------
  |  Branch (486:6): [True: 911k, False: 2.81M]
  ------------------
  487|   911k|	  annotPages->append(new AcroFormAnnotPage(annotObj.getRefNum(),
  488|   911k|						   annotObj.getRefGen(),
  489|   911k|						   pageNum));
  490|   911k|	}
  491|  3.72M|	annotObj.free();
  492|  3.72M|      }
  493|   114k|    }
  494|   165k|    annotsObj.free();
  495|   165k|  }
  496|       |  //~ sort the list
  497|  2.92k|}
_ZN8AcroForm9scanFieldEP6ObjectPc:
  518|  59.9k|void AcroForm::scanField(Object *fieldRef, char *touchedObjs) {
  519|  59.9k|  AcroFormField *field;
  520|  59.9k|  Object fieldObj, kidsRef, kidsObj, kidRef, kidObj, subtypeObj;
  521|  59.9k|  GBool isTerminal;
  522|  59.9k|  int i;
  523|       |
  524|       |  // check for an object loop
  525|  59.9k|  if (fieldRef->isRef()) {
  ------------------
  |  Branch (525:7): [True: 29.0k, False: 30.8k]
  ------------------
  526|  29.0k|    if (fieldRef->getRefNum() < 0 ||
  ------------------
  |  Branch (526:9): [True: 0, False: 29.0k]
  ------------------
  527|  29.0k|	fieldRef->getRefNum() >= doc->getXRef()->getNumObjects() ||
  ------------------
  |  Branch (527:2): [True: 548, False: 28.5k]
  ------------------
  528|  28.5k|	touchedObjs[fieldRef->getRefNum()]) {
  ------------------
  |  Branch (528:2): [True: 23.0k, False: 5.52k]
  ------------------
  529|  23.5k|      return;
  530|  23.5k|    }
  531|  5.52k|    touchedObjs[fieldRef->getRefNum()] = 1;
  532|  5.52k|  }
  533|       |
  534|  36.3k|  fieldRef->fetch(doc->getXRef(), &fieldObj);
  535|  36.3k|  if (!fieldObj.isDict()) {
  ------------------
  |  Branch (535:7): [True: 31.7k, False: 4.68k]
  ------------------
  536|  31.7k|    error(errSyntaxError, -1, "AcroForm field object is wrong type");
  537|  31.7k|    fieldObj.free();
  538|  31.7k|    return;
  539|  31.7k|  }
  540|       |
  541|       |  // look for a Kids entry, and check for an object loop there
  542|  4.68k|  if (fieldObj.dictLookupNF("Kids", &kidsRef)->isRef()) {
  ------------------
  |  Branch (542:7): [True: 179, False: 4.50k]
  ------------------
  543|    179|    if (kidsRef.getRefNum() < 0 ||
  ------------------
  |  Branch (543:9): [True: 0, False: 179]
  ------------------
  544|    179|	kidsRef.getRefNum() >= doc->getXRef()->getNumObjects() ||
  ------------------
  |  Branch (544:2): [True: 75, False: 104]
  ------------------
  545|    160|	touchedObjs[kidsRef.getRefNum()]) {
  ------------------
  |  Branch (545:2): [True: 85, False: 19]
  ------------------
  546|    160|      kidsRef.free();
  547|    160|      fieldObj.free();
  548|    160|      return;
  549|    160|    }
  550|     19|    touchedObjs[kidsRef.getRefNum()] = 1;
  551|     19|    kidsRef.fetch(doc->getXRef(), &kidsObj);
  552|  4.50k|  } else {
  553|  4.50k|    kidsRef.copy(&kidsObj);
  554|  4.50k|  }
  555|  4.52k|  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.52k|  isTerminal = gTrue;
  ------------------
  |  |   17|  4.52k|#define gTrue 1
  ------------------
  562|  4.52k|  if (kidsObj.isArray()) {
  ------------------
  |  Branch (562:7): [True: 364, False: 4.16k]
  ------------------
  563|    364|    isTerminal = gFalse;
  ------------------
  |  |   18|    364|#define gFalse 0
  ------------------
  564|  6.83k|    for (i = 0; !isTerminal && i < kidsObj.arrayGetLength(); ++i) {
  ------------------
  |  Branch (564:17): [True: 6.71k, False: 119]
  |  Branch (564:32): [True: 6.47k, False: 245]
  ------------------
  565|  6.47k|      kidsObj.arrayGet(i, &kidObj);
  566|  6.47k|      if (kidObj.isDict()) {
  ------------------
  |  Branch (566:11): [True: 585, False: 5.88k]
  ------------------
  567|    585|	if (kidObj.dictLookup("Parent", &subtypeObj)->isNull()) {
  ------------------
  |  Branch (567:6): [True: 119, False: 466]
  ------------------
  568|    119|	  isTerminal = gTrue;
  ------------------
  |  |   17|    119|#define gTrue 1
  ------------------
  569|    119|	}
  570|    585|	subtypeObj.free();
  571|    585|      }
  572|  6.47k|      kidObj.free();
  573|  6.47k|    }
  574|    364|    if (!isTerminal) {
  ------------------
  |  Branch (574:9): [True: 245, False: 119]
  ------------------
  575|  3.31k|      for (i = 0; !isTerminal && i < kidsObj.arrayGetLength(); ++i) {
  ------------------
  |  Branch (575:19): [True: 3.31k, False: 0]
  |  Branch (575:34): [True: 3.07k, False: 245]
  ------------------
  576|  3.07k|	kidsObj.arrayGetNF(i, &kidRef);
  577|  3.07k|	scanField(&kidRef, touchedObjs);
  578|  3.07k|	kidRef.free();
  579|  3.07k|      }
  580|    245|    }
  581|    364|  }
  582|  4.52k|  kidsObj.free();
  583|       |
  584|  4.52k|  if (isTerminal) {
  ------------------
  |  Branch (584:7): [True: 4.27k, False: 245]
  ------------------
  585|  4.27k|    if ((field = AcroFormField::load(this, fieldRef))) {
  ------------------
  |  Branch (585:9): [True: 2.84k, False: 1.43k]
  ------------------
  586|  2.84k|      fields->append(field);
  587|  2.84k|    }
  588|  4.27k|  }
  589|       |
  590|  4.52k|  fieldObj.free();
  591|  4.52k|}
_ZN13AcroFormField4loadEP8AcroFormP6Object:
  647|  4.27k|AcroFormField *AcroFormField::load(AcroForm *acroFormA, Object *fieldRefA) {
  648|  4.27k|  GString *typeStr;
  649|  4.27k|  TextString *nameA;
  650|  4.27k|  GString *xfaName;
  651|  4.27k|  Guint flagsA;
  652|  4.27k|  GBool haveFlags, typeFromParentA;
  653|  4.27k|  Object fieldObjA, parentObj, parentObj2, obj1, obj2;
  654|  4.27k|  AcroFormFieldType typeA;
  655|  4.27k|  XFAField *xfaFieldA;
  656|  4.27k|  AcroFormField *field;
  657|  4.27k|  int depth, i0, i1;
  658|       |
  659|  4.27k|  fieldRefA->fetch(acroFormA->doc->getXRef(), &fieldObjA);
  660|       |
  661|       |  //----- get field info
  662|       |
  663|  4.27k|  if (fieldObjA.dictLookup("T", &obj1)->isString()) {
  ------------------
  |  Branch (663:7): [True: 2.83k, False: 1.44k]
  ------------------
  664|  2.83k|    nameA = new TextString(obj1.getString());
  665|  2.83k|  } else {
  666|  1.44k|    nameA = new TextString();
  667|  1.44k|  }
  668|  4.27k|  obj1.free();
  669|       |
  670|  4.27k|  if (fieldObjA.dictLookup("FT", &obj1)->isName()) {
  ------------------
  |  Branch (670:7): [True: 2.67k, False: 1.60k]
  ------------------
  671|  2.67k|    typeStr = new GString(obj1.getName());
  672|  2.67k|    typeFromParentA = gFalse;
  ------------------
  |  |   18|  2.67k|#define gFalse 0
  ------------------
  673|  2.67k|  } else {
  674|  1.60k|    typeStr = NULL;
  675|  1.60k|    typeFromParentA = gTrue;
  ------------------
  |  |   17|  1.60k|#define gTrue 1
  ------------------
  676|  1.60k|  }
  677|  4.27k|  obj1.free();
  678|       |
  679|  4.27k|  if (fieldObjA.dictLookup("Ff", &obj1)->isInt()) {
  ------------------
  |  Branch (679:7): [True: 1.96k, False: 2.31k]
  ------------------
  680|  1.96k|    flagsA = (Guint)obj1.getInt();
  681|  1.96k|    haveFlags = gTrue;
  ------------------
  |  |   17|  1.96k|#define gTrue 1
  ------------------
  682|  2.31k|  } else {
  683|  2.31k|    flagsA = 0;
  684|  2.31k|    haveFlags = gFalse;
  ------------------
  |  |   18|  2.31k|#define gFalse 0
  ------------------
  685|  2.31k|  }
  686|  4.27k|  obj1.free();
  687|       |
  688|       |  //----- get info from parent non-terminal fields
  689|       |
  690|  4.27k|  fieldObjA.dictLookup("Parent", &parentObj);
  691|  4.27k|  depth = 0;
  692|  39.3k|  while (parentObj.isDict() && depth < maxFieldObjectDepth) {
  ------------------
  |  |   72|  35.7k|#define maxFieldObjectDepth 50
  ------------------
  |  Branch (692:10): [True: 35.7k, False: 3.60k]
  |  Branch (692:32): [True: 35.0k, False: 672]
  ------------------
  693|       |
  694|  35.0k|    if (parentObj.dictLookup("T", &obj1)->isString()) {
  ------------------
  |  Branch (694:9): [True: 34.3k, False: 718]
  ------------------
  695|  34.3k|      if (nameA->getLength()) {
  ------------------
  |  Branch (695:11): [True: 33.8k, False: 515]
  ------------------
  696|  33.8k|	nameA->insert(0, (Unicode)'.');
  697|  33.8k|      }
  698|  34.3k|      nameA->insert(0, obj1.getString());
  699|  34.3k|    }
  700|  35.0k|    obj1.free();
  701|       |
  702|  35.0k|    if (!typeStr) {
  ------------------
  |  Branch (702:9): [True: 3.37k, False: 31.6k]
  ------------------
  703|  3.37k|      if (parentObj.dictLookup("FT", &obj1)->isName()) {
  ------------------
  |  Branch (703:11): [True: 322, False: 3.05k]
  ------------------
  704|    322|	typeStr = new GString(obj1.getName());
  705|    322|      }
  706|  3.37k|      obj1.free();
  707|  3.37k|    }
  708|       |
  709|  35.0k|    if (!haveFlags) {
  ------------------
  |  Branch (709:9): [True: 5.15k, False: 29.9k]
  ------------------
  710|  5.15k|      if (parentObj.dictLookup("Ff", &obj1)->isInt()) {
  ------------------
  |  Branch (710:11): [True: 420, False: 4.73k]
  ------------------
  711|    420|	flagsA = (Guint)obj1.getInt();
  712|    420|	haveFlags = gTrue;
  ------------------
  |  |   17|    420|#define gTrue 1
  ------------------
  713|    420|      }
  714|  5.15k|      obj1.free();
  715|  5.15k|    }
  716|       |
  717|  35.0k|    parentObj.dictLookup("Parent", &parentObj2);
  718|  35.0k|    parentObj.free();
  719|  35.0k|    parentObj = parentObj2;
  720|       |
  721|  35.0k|    ++depth;
  722|  35.0k|  }
  723|  4.27k|  parentObj.free();
  724|       |
  725|  4.27k|  if (!typeStr) {
  ------------------
  |  Branch (725:7): [True: 1.28k, False: 2.99k]
  ------------------
  726|  1.28k|    error(errSyntaxError, -1, "Missing type in AcroForm field");
  727|  1.28k|    goto err1;
  728|  1.28k|  }
  729|       |
  730|       |  //----- get static XFA info
  731|       |
  732|  2.99k|  xfaFieldA = NULL;
  733|  2.99k|  if (acroFormA->xfaScanner) {
  ------------------
  |  Branch (733:7): [True: 120, False: 2.87k]
  ------------------
  734|       |    // convert field name to UTF-8, and remove segments that start
  735|       |    // with '#' -- to match the XFA field name
  736|    120|    xfaName = nameA->toUTF8();
  737|    120|    i0 = 0;
  738|  1.02k|    while (i0 < xfaName->getLength()) {
  ------------------
  |  Branch (738:12): [True: 906, False: 120]
  ------------------
  739|    906|      i1 = i0;
  740|  57.0k|      while (i1 < xfaName->getLength()) {
  ------------------
  |  Branch (740:14): [True: 56.9k, False: 88]
  ------------------
  741|  56.9k|	if (xfaName->getChar(i1) == '.') {
  ------------------
  |  Branch (741:6): [True: 818, False: 56.1k]
  ------------------
  742|    818|	  ++i1;
  743|    818|	  break;
  744|    818|	}
  745|  56.1k|	++i1;
  746|  56.1k|      }
  747|    906|      if (xfaName->getChar(i0) == '#') {
  ------------------
  |  Branch (747:11): [True: 313, False: 593]
  ------------------
  748|    313|	xfaName->del(i0, i1 - i0);
  749|    593|      } else {
  750|    593|	i0 = i1;
  751|    593|      }
  752|    906|    }
  753|    120|    xfaFieldA = acroFormA->xfaScanner->findField(xfaName);
  754|    120|    delete xfaName;
  755|    120|  }
  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.99k|  if (typeFromParentA && !typeStr->cmp("Btn") && !haveFlags) {
  ------------------
  |  Branch (761:7): [True: 322, False: 2.67k]
  |  Branch (761:26): [True: 67, False: 255]
  |  Branch (761:50): [True: 8, False: 59]
  ------------------
  762|      8|    flagsA = acroFormFlagRadio;
  ------------------
  |  |   40|      8|#define acroFormFlagRadio              (1 << 15)  // button
  ------------------
  763|      8|  }
  764|       |
  765|       |  //----- determine field type
  766|       |
  767|  2.99k|  if (!typeStr->cmp("Btn")) {
  ------------------
  |  Branch (767:7): [True: 625, False: 2.37k]
  ------------------
  768|    625|    if (flagsA & acroFormFlagPushbutton) {
  ------------------
  |  |   41|    625|#define acroFormFlagPushbutton         (1 << 16)  // button
  ------------------
  |  Branch (768:9): [True: 20, False: 605]
  ------------------
  769|     20|      typeA = acroFormFieldPushbutton;
  770|    605|    } else if (flagsA & acroFormFlagRadio) {
  ------------------
  |  |   40|    605|#define acroFormFlagRadio              (1 << 15)  // button
  ------------------
  |  Branch (770:16): [True: 112, False: 493]
  ------------------
  771|    112|      typeA = acroFormFieldRadioButton;
  772|    493|    } else {
  773|    493|      typeA = acroFormFieldCheckbox;
  774|    493|    }
  775|  2.37k|  } else if (!typeStr->cmp("Tx")) {
  ------------------
  |  Branch (775:14): [True: 2.19k, False: 180]
  ------------------
  776|  2.19k|    if (xfaFieldA && xfaFieldA->getBarcodeInfo()) {
  ------------------
  |  Branch (776:9): [True: 0, False: 2.19k]
  |  Branch (776:22): [True: 0, False: 0]
  ------------------
  777|      0|      typeA = acroFormFieldBarcode;
  778|  2.19k|    } else if (flagsA & acroFormFlagFileSelect) {
  ------------------
  |  |   45|  2.19k|#define acroFormFlagFileSelect         (1 << 20)  // text
  ------------------
  |  Branch (778:16): [True: 137, False: 2.05k]
  ------------------
  779|    137|      typeA = acroFormFieldFileSelect;
  780|  2.05k|    } else if (flagsA & acroFormFlagMultiline) {
  ------------------
  |  |   37|  2.05k|#define acroFormFlagMultiline          (1 << 12)  // text
  ------------------
  |  Branch (780:16): [True: 155, False: 1.90k]
  ------------------
  781|    155|      typeA = acroFormFieldMultilineText;
  782|  1.90k|    } else {
  783|  1.90k|      typeA = acroFormFieldText;
  784|  1.90k|    }
  785|  2.19k|  } else if (!typeStr->cmp("Ch")) {
  ------------------
  |  Branch (785:14): [True: 27, False: 153]
  ------------------
  786|     27|    if (flagsA & acroFormFlagCombo) {
  ------------------
  |  |   42|     27|#define acroFormFlagCombo              (1 << 17)  // choice
  ------------------
  |  Branch (786:9): [True: 11, False: 16]
  ------------------
  787|     11|      typeA = acroFormFieldComboBox;
  788|     16|    } else {
  789|     16|      typeA = acroFormFieldListBox;
  790|     16|    }
  791|    153|  } else if (!typeStr->cmp("Sig")) {
  ------------------
  |  Branch (791:14): [True: 0, False: 153]
  ------------------
  792|      0|    typeA = acroFormFieldSignature;
  793|    153|  } else {
  794|    153|    error(errSyntaxError, -1, "Invalid type in AcroForm field");
  795|    153|    goto err1;
  796|    153|  }
  797|  2.84k|  delete typeStr;
  798|       |
  799|  2.84k|  field = new AcroFormField(acroFormA, fieldRefA, &fieldObjA,
  800|  2.84k|			    typeA, nameA, flagsA, typeFromParentA, xfaFieldA);
  801|  2.84k|  fieldObjA.free();
  802|  2.84k|  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.99k|}
_ZN13AcroFormFieldC2EP8AcroFormP6ObjectS3_17AcroFormFieldTypeP10TextStringjiP8XFAField:
  815|  2.84k|			     XFAField *xfaFieldA) {
  816|  2.84k|  acroForm = acroFormA;
  817|  2.84k|  fieldRefA->copy(&fieldRef);
  818|  2.84k|  fieldObjA->copy(&fieldObj);
  819|  2.84k|  type = typeA;
  820|  2.84k|  name = nameA;
  821|  2.84k|  flags = flagsA;
  822|  2.84k|  typeFromParent = typeFromParentA;
  823|  2.84k|  xfaField = xfaFieldA;
  824|  2.84k|}
_ZN13AcroFormFieldD2Ev:
  826|  2.84k|AcroFormField::~AcroFormField() {
  827|  2.84k|  fieldRef.free();
  828|  2.84k|  fieldObj.free();
  829|  2.84k|  delete name;
  830|  2.84k|}
_ZN17AcroFormAnnotPageC2Eiii:
  327|   911k|    { annotNum = annotNumA; annotGen = annotGenA; pageNum = pageNumA; }

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

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

_ZN5Array6incRefEv:
   36|  1.64M|  long incRef() { return gAtomicIncrement(&ref); }
_ZN5Array6decRefEv:
   37|  2.36M|  long decRef() { return gAtomicDecrement(&ref); }
_ZN5Array9getLengthEv:
   44|  14.0M|  int getLength() { return length; }

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

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

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

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

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

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

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

_ZN4DictC2EP4XRef:
   31|   624k|Dict::Dict(XRef *xrefA) {
   32|   624k|  xref = xrefA;
   33|   624k|  size = 8;
   34|   624k|  length = 0;
   35|   624k|  entries = (DictEntry *)gmallocn(size, sizeof(DictEntry));
   36|   624k|  hashTab = (DictEntry **)gmallocn(2 * size - 1, sizeof(DictEntry *));
   37|   624k|  memset(hashTab, 0, (2 * size - 1) * sizeof(DictEntry *));
   38|   624k|  ref = 1;
   39|   624k|}
_ZN4DictD2Ev:
   41|   624k|Dict::~Dict() {
   42|   624k|  int i;
   43|       |
   44|  2.76M|  for (i = 0; i < length; ++i) {
  ------------------
  |  Branch (44:15): [True: 2.14M, False: 624k]
  ------------------
   45|  2.14M|    gfree(entries[i].key);
   46|  2.14M|    entries[i].val.free();
   47|  2.14M|  }
   48|   624k|  gfree(entries);
   49|   624k|  gfree(hashTab);
   50|   624k|}
_ZN4Dict3addEPcP6Object:
   52|  2.67M|void Dict::add(char *key, Object *val) {
   53|  2.67M|  DictEntry *e;
   54|  2.67M|  int h;
   55|       |
   56|  2.67M|  if ((e = find(key))) {
  ------------------
  |  Branch (56:7): [True: 531k, False: 2.14M]
  ------------------
   57|   531k|    e->val.free();
   58|   531k|    e->val = *val;
   59|   531k|    gfree(key);
   60|  2.14M|  } else {
   61|  2.14M|    if (length == size) {
  ------------------
  |  Branch (61:9): [True: 67.8k, False: 2.07M]
  ------------------
   62|  67.8k|      expand();
   63|  67.8k|    }
   64|  2.14M|    h = hash(key);
   65|  2.14M|    entries[length].key = key;
   66|  2.14M|    entries[length].val = *val;
   67|  2.14M|    entries[length].next = hashTab[h];
   68|  2.14M|    hashTab[h] = &entries[length];
   69|  2.14M|    ++length;
   70|  2.14M|  }
   71|  2.67M|}
_ZN4Dict6expandEv:
   73|  67.8k|void Dict::expand() {
   74|  67.8k|  int h, i;
   75|       |
   76|  67.8k|  size *= 2;
   77|  67.8k|  entries = (DictEntry *)greallocn(entries, size, sizeof(DictEntry));
   78|  67.8k|  hashTab = (DictEntry **)greallocn(hashTab, 2 * size - 1,
   79|  67.8k|				    sizeof(DictEntry *));
   80|  67.8k|  memset(hashTab, 0, (2 * size - 1) * sizeof(DictEntry *));
   81|   654k|  for (i = 0; i < length; ++i) {
  ------------------
  |  Branch (81:15): [True: 586k, False: 67.8k]
  ------------------
   82|   586k|    h = hash(entries[i].key);
   83|   586k|    entries[i].next = hashTab[h];
   84|   586k|    hashTab[h] = &entries[i];
   85|   586k|  }
   86|  67.8k|}
_ZN4Dict4hashEPKc:
  101|  9.73M|int Dict::hash(const char *key) {
  102|  9.73M|  const char *p;
  103|  9.73M|  unsigned int h;
  104|       |
  105|  9.73M|  h = 0;
  106|  63.1M|  for (p = key; *p; ++p) {
  ------------------
  |  Branch (106:17): [True: 53.4M, False: 9.73M]
  ------------------
  107|  53.4M|    h = 17 * h + (int)(*p & 0xff);
  108|  53.4M|  }
  109|  9.73M|  return (int)(h % (2 * size - 1));
  110|  9.73M|}
_ZN4Dict6lookupEPKcP6Objecti:
  118|  3.78M|Object *Dict::lookup(const char *key, Object *obj, int recursion) {
  119|  3.78M|  DictEntry *e;
  120|       |
  121|  3.78M|  return (e = find(key)) ? e->val.fetch(xref, obj, recursion)
  ------------------
  |  Branch (121:10): [True: 1.04M, False: 2.74M]
  ------------------
  122|  3.78M|                         : obj->initNull();
  123|  3.78M|}
_ZN4Dict8lookupNFEPKcP6Object:
  125|   536k|Object *Dict::lookupNF(const char *key, Object *obj) {
  126|   536k|  DictEntry *e;
  127|       |
  128|   536k|  return (e = find(key)) ? e->val.copy(obj) : obj->initNull();
  ------------------
  |  Branch (128:10): [True: 147k, False: 389k]
  ------------------
  129|   536k|}
_ZN4Dict6getKeyEi:
  131|  15.6k|char *Dict::getKey(int i) {
  132|  15.6k|  return entries[i].key;
  133|  15.6k|}
_ZN4Dict6getValEiP6Object:
  135|  10.7k|Object *Dict::getVal(int i, Object *obj) {
  136|  10.7k|  return entries[i].val.fetch(xref, obj);
  137|  10.7k|}
_ZN4Dict8getValNFEiP6Object:
  139|  4.95k|Object *Dict::getValNF(int i, Object *obj) {
  140|  4.95k|  return entries[i].val.copy(obj);
  141|  4.95k|}
_ZN4Dict4findEPKc:
   88|  7.00M|inline DictEntry *Dict::find(const char *key) {
   89|  7.00M|  DictEntry *e;
   90|  7.00M|  int h;
   91|       |
   92|  7.00M|  h = hash(key);
   93|  8.93M|  for (e = hashTab[h]; e; e = e->next) {
  ------------------
  |  Branch (93:24): [True: 3.65M, False: 5.27M]
  ------------------
   94|  3.65M|    if (!strcmp(key, e->key)) {
  ------------------
  |  Branch (94:9): [True: 1.72M, False: 1.92M]
  ------------------
   95|  1.72M|      return e;
   96|  1.72M|    }
   97|  3.65M|  }
   98|  5.27M|  return NULL;
   99|  7.00M|}

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

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

_ZN23JArithmeticDecoderStatsC2Ei:
   20|  4.70M|JArithmeticDecoderStats::JArithmeticDecoderStats(int contextSizeA) {
   21|  4.70M|  contextSize = contextSizeA;
   22|  4.70M|  cxTab = (Guchar *)gmallocn(contextSize, sizeof(Guchar));
   23|  4.70M|  reset();
   24|  4.70M|}
_ZN23JArithmeticDecoderStatsD2Ev:
   26|  4.69M|JArithmeticDecoderStats::~JArithmeticDecoderStats() {
   27|  4.69M|  gfree(cxTab);
   28|  4.69M|}
_ZN23JArithmeticDecoderStats4copyEv:
   30|  3.92k|JArithmeticDecoderStats *JArithmeticDecoderStats::copy() {
   31|  3.92k|  JArithmeticDecoderStats *stats;
   32|       |
   33|  3.92k|  stats = new JArithmeticDecoderStats(contextSize);
   34|  3.92k|  memcpy(stats->cxTab, cxTab, contextSize);
   35|  3.92k|  return stats;
   36|  3.92k|}
_ZN23JArithmeticDecoderStats5resetEv:
   38|  6.38M|void JArithmeticDecoderStats::reset() {
   39|  6.38M|  memset(cxTab, 0, contextSize);
   40|  6.38M|}
_ZN23JArithmeticDecoderStats8setEntryEjii:
   46|  5.70M|void JArithmeticDecoderStats::setEntry(Guint cx, int i, int mps) {
   47|  5.70M|  cxTab[cx] = (Guchar)((i << 1) + mps);
   48|  5.70M|}
_ZN18JArithmeticDecoderC2Ev:
   87|   580k|JArithmeticDecoder::JArithmeticDecoder() {
   88|   580k|  str = NULL;
   89|   580k|  dataLen = 0;
   90|   580k|  limitStream = gFalse;
  ------------------
  |  |   18|   580k|#define gFalse 0
  ------------------
   91|   580k|  nBytesRead = 0;
   92|   580k|  readBufNext = 0;
   93|   580k|  readBufLength = 0;
   94|   580k|}
_ZN18JArithmeticDecoderD2Ev:
  110|   579k|JArithmeticDecoder::~JArithmeticDecoder() {
  111|   579k|  cleanup();
  112|   579k|}
_ZN18JArithmeticDecoder5startEv:
  114|   823k|void JArithmeticDecoder::start() {
  115|   823k|  buf0 = readByte();
  116|   823k|  buf1 = readByte();
  117|       |
  118|       |  // INITDEC
  119|   823k|  c = (buf0 ^ 0xff) << 16;
  120|   823k|  byteIn();
  121|   823k|  c <<= 7;
  122|   823k|  ct -= 7;
  123|   823k|  a = 0x80000000;
  124|   823k|}
_ZN18JArithmeticDecoder7restartEi:
  126|  40.0k|void JArithmeticDecoder::restart(int dataLenA) {
  127|  40.0k|  Guint cAdd;
  128|  40.0k|  GBool prevFF;
  129|  40.0k|  int k, nBits;
  130|       |
  131|  40.0k|  if (dataLen >= 0) {
  ------------------
  |  Branch (131:7): [True: 25.2k, False: 14.8k]
  ------------------
  132|  25.2k|    dataLen = dataLenA;
  133|  25.2k|  } else if (dataLen == -1) {
  ------------------
  |  Branch (133:14): [True: 1.71k, False: 13.1k]
  ------------------
  134|  1.71k|    dataLen = dataLenA;
  135|  1.71k|    buf1 = readByte();
  136|  13.1k|  } else {
  137|  13.1k|    k = (-dataLen - 1) * 8 - ct;
  138|  13.1k|    dataLen = dataLenA;
  139|  13.1k|    cAdd = 0;
  140|  13.1k|    prevFF = gFalse;
  ------------------
  |  |   18|  13.1k|#define gFalse 0
  ------------------
  141|   529k|    while (k > 0) {
  ------------------
  |  Branch (141:12): [True: 516k, False: 13.1k]
  ------------------
  142|   516k|      buf0 = readByte();
  143|   516k|      if (prevFF) {
  ------------------
  |  Branch (143:11): [True: 403k, False: 113k]
  ------------------
  144|   403k|	cAdd += 0xfe00 - (buf0 << 9);
  145|   403k|	nBits = 7;
  146|   403k|      } else {
  147|   113k|	cAdd += 0xff00 - (buf0 << 8);
  148|   113k|	nBits = 8;
  149|   113k|      }
  150|   516k|      prevFF = buf0 == 0xff;
  151|   516k|      if (k > nBits) {
  ------------------
  |  Branch (151:11): [True: 503k, False: 13.1k]
  ------------------
  152|   503k|	cAdd <<= nBits;
  153|   503k|	k -= nBits;
  154|   503k|      } else {
  155|  13.1k|	cAdd <<= k;
  156|  13.1k|	ct = nBits - k;
  157|  13.1k|	k = 0;
  158|  13.1k|      }
  159|   516k|    }
  160|  13.1k|    c += cAdd;
  161|  13.1k|    buf1 = readByte();
  162|  13.1k|  }
  163|  40.0k|}
_ZN18JArithmeticDecoder7cleanupEv:
  165|  1.57M|void JArithmeticDecoder::cleanup() {
  166|  1.57M|  if (limitStream) {
  ------------------
  |  Branch (166:7): [True: 1.30M, False: 272k]
  ------------------
  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.30M|    readBufLength = 0;
  175|  6.21G|    while (dataLen > 0) {
  ------------------
  |  Branch (175:12): [True: 6.21G, False: 1.30M]
  ------------------
  176|  6.21G|      if (readBufLength < (int)sizeof(readBuf)) {
  ------------------
  |  Branch (176:11): [True: 9.30M, False: 6.20G]
  ------------------
  177|  9.30M|	readBuf[readBufLength++] = (Guchar)str->getChar();
  178|  9.30M|	++nBytesRead;
  179|  9.30M|      }
  180|  6.21G|      --dataLen;
  181|  6.21G|    }
  182|  1.30M|    readBufNext = 0;
  183|  1.30M|  }
  184|  1.57M|}
_ZN18JArithmeticDecoder9decodeBitEjP23JArithmeticDecoderStats:
  187|   476M|				  JArithmeticDecoderStats *stats) {
  188|   476M|  int bit;
  189|   476M|  Guint qe;
  190|   476M|  int iCX, mpsCX;
  191|       |
  192|   476M|  iCX = stats->cxTab[context] >> 1;
  193|   476M|  mpsCX = stats->cxTab[context] & 1;
  194|   476M|  qe = qeTab[iCX];
  195|   476M|  a -= qe;
  196|   476M|  if (c < a) {
  ------------------
  |  Branch (196:7): [True: 437M, False: 39.0M]
  ------------------
  197|   437M|    if (a & 0x80000000) {
  ------------------
  |  Branch (197:9): [True: 394M, False: 43.3M]
  ------------------
  198|   394M|      bit = mpsCX;
  199|   394M|    } else {
  200|       |      // MPS_EXCHANGE
  201|  43.3M|      if (a < qe) {
  ------------------
  |  Branch (201:11): [True: 6.71M, False: 36.6M]
  ------------------
  202|  6.71M|	bit = 1 - mpsCX;
  203|  6.71M|	if (switchTab[iCX]) {
  ------------------
  |  Branch (203:6): [True: 3.85M, False: 2.86M]
  ------------------
  204|  3.85M|	  stats->cxTab[context] = (Guchar)((nlpsTab[iCX] << 1) | (1 - mpsCX));
  205|  3.85M|	} else {
  206|  2.86M|	  stats->cxTab[context] = (Guchar)((nlpsTab[iCX] << 1) | mpsCX);
  207|  2.86M|	}
  208|  36.6M|      } else {
  209|  36.6M|	bit = mpsCX;
  210|  36.6M|	stats->cxTab[context] = (Guchar)((nmpsTab[iCX] << 1) | mpsCX);
  211|  36.6M|      }
  212|       |      // RENORMD
  213|  46.0M|      do {
  214|  46.0M|	if (ct == 0) {
  ------------------
  |  Branch (214:6): [True: 5.81M, False: 40.2M]
  ------------------
  215|  5.81M|	  byteIn();
  216|  5.81M|	}
  217|  46.0M|	a <<= 1;
  218|  46.0M|	c <<= 1;
  219|  46.0M|	--ct;
  220|  46.0M|      } while (!(a & 0x80000000));
  ------------------
  |  Branch (220:16): [True: 2.67M, False: 43.3M]
  ------------------
  221|  43.3M|    }
  222|   437M|  } else {
  223|  39.0M|    c -= a;
  224|       |    // LPS_EXCHANGE
  225|  39.0M|    if (a < qe) {
  ------------------
  |  Branch (225:9): [True: 7.77M, False: 31.2M]
  ------------------
  226|  7.77M|      bit = mpsCX;
  227|  7.77M|      stats->cxTab[context] = (Guchar)((nmpsTab[iCX] << 1) | mpsCX);
  228|  31.2M|    } else {
  229|  31.2M|      bit = 1 - mpsCX;
  230|  31.2M|      if (switchTab[iCX]) {
  ------------------
  |  Branch (230:11): [True: 5.58M, False: 25.6M]
  ------------------
  231|  5.58M|	stats->cxTab[context] = (Guchar)((nlpsTab[iCX] << 1) | (1 - mpsCX));
  232|  25.6M|      } else {
  233|  25.6M|	stats->cxTab[context] = (Guchar)((nlpsTab[iCX] << 1) | mpsCX);
  234|  25.6M|      }
  235|  31.2M|    }
  236|  39.0M|    a = qe;
  237|       |    // RENORMD
  238|  60.6M|    do {
  239|  60.6M|      if (ct == 0) {
  ------------------
  |  Branch (239:11): [True: 7.65M, False: 52.9M]
  ------------------
  240|  7.65M|	byteIn();
  241|  7.65M|      }
  242|  60.6M|      a <<= 1;
  243|  60.6M|      c <<= 1;
  244|  60.6M|      --ct;
  245|  60.6M|    } while (!(a & 0x80000000));
  ------------------
  |  Branch (245:14): [True: 21.5M, False: 39.0M]
  ------------------
  246|  39.0M|  }
  247|   476M|  return bit;
  248|   476M|}
_ZN18JArithmeticDecoder9decodeIntEPiP23JArithmeticDecoderStats:
  262|  4.28M|GBool JArithmeticDecoder::decodeInt(int *x, JArithmeticDecoderStats *stats) {
  263|  4.28M|  int s;
  264|  4.28M|  Guint v;
  265|  4.28M|  int i;
  266|       |
  267|  4.28M|  prev = 1;
  268|  4.28M|  s = decodeIntBit(stats);
  269|  4.28M|  if (decodeIntBit(stats)) {
  ------------------
  |  Branch (269:7): [True: 1.72M, False: 2.56M]
  ------------------
  270|  1.72M|    if (decodeIntBit(stats)) {
  ------------------
  |  Branch (270:9): [True: 421k, False: 1.29M]
  ------------------
  271|   421k|      if (decodeIntBit(stats)) {
  ------------------
  |  Branch (271:11): [True: 110k, False: 310k]
  ------------------
  272|   110k|	if (decodeIntBit(stats)) {
  ------------------
  |  Branch (272:6): [True: 70.9k, False: 39.5k]
  ------------------
  273|  70.9k|	  if (decodeIntBit(stats)) {
  ------------------
  |  Branch (273:8): [True: 15.8k, False: 55.0k]
  ------------------
  274|  15.8k|	    v = 0;
  275|   524k|	    for (i = 0; i < 32; ++i) {
  ------------------
  |  Branch (275:18): [True: 508k, False: 15.8k]
  ------------------
  276|   508k|	      v = (v << 1) | decodeIntBit(stats);
  277|   508k|	    }
  278|  15.8k|	    v += 4436;
  279|  55.0k|	  } else {
  280|  55.0k|	    v = 0;
  281|   716k|	    for (i = 0; i < 12; ++i) {
  ------------------
  |  Branch (281:18): [True: 661k, False: 55.0k]
  ------------------
  282|   661k|	      v = (v << 1) | decodeIntBit(stats);
  283|   661k|	    }
  284|  55.0k|	    v += 340;
  285|  55.0k|	  }
  286|  70.9k|	} else {
  287|  39.5k|	  v = 0;
  288|   355k|	  for (i = 0; i < 8; ++i) {
  ------------------
  |  Branch (288:16): [True: 316k, False: 39.5k]
  ------------------
  289|   316k|	    v = (v << 1) | decodeIntBit(stats);
  290|   316k|	  }
  291|  39.5k|	  v += 84;
  292|  39.5k|	}
  293|   310k|      } else {
  294|   310k|	v = 0;
  295|  2.17M|	for (i = 0; i < 6; ++i) {
  ------------------
  |  Branch (295:14): [True: 1.86M, False: 310k]
  ------------------
  296|  1.86M|	  v = (v << 1) | decodeIntBit(stats);
  297|  1.86M|	}
  298|   310k|	v += 20;
  299|   310k|      }
  300|  1.29M|    } else {
  301|  1.29M|      v = decodeIntBit(stats);
  302|  1.29M|      v = (v << 1) | decodeIntBit(stats);
  303|  1.29M|      v = (v << 1) | decodeIntBit(stats);
  304|  1.29M|      v = (v << 1) | decodeIntBit(stats);
  305|  1.29M|      v += 4;
  306|  1.29M|    }
  307|  2.56M|  } else {
  308|  2.56M|    v = decodeIntBit(stats);
  309|  2.56M|    v = (v << 1) | decodeIntBit(stats);
  310|  2.56M|  }
  311|       |
  312|  4.28M|  if (s) {
  ------------------
  |  Branch (312:7): [True: 1.71M, False: 2.56M]
  ------------------
  313|  1.71M|    if (v == 0) {
  ------------------
  |  Branch (313:9): [True: 1.17M, False: 537k]
  ------------------
  314|  1.17M|      return gFalse;
  ------------------
  |  |   18|  1.17M|#define gFalse 0
  ------------------
  315|  1.17M|    }
  316|   537k|    *x = -(int)v;
  317|  2.56M|  } else {
  318|  2.56M|    *x = (int)v;
  319|  2.56M|  }
  320|  3.10M|  return gTrue;
  ------------------
  |  |   17|  3.10M|#define gTrue 1
  ------------------
  321|  4.28M|}
_ZN18JArithmeticDecoder12decodeIntBitEP23JArithmeticDecoderStats:
  323|  24.5M|int JArithmeticDecoder::decodeIntBit(JArithmeticDecoderStats *stats) {
  324|  24.5M|  int bit;
  325|       |
  326|  24.5M|  bit = decodeBit(prev, stats);
  327|  24.5M|  if (prev < 0x100) {
  ------------------
  |  Branch (327:7): [True: 22.7M, False: 1.84M]
  ------------------
  328|  22.7M|    prev = (prev << 1) | bit;
  329|  22.7M|  } else {
  330|  1.84M|    prev = (((prev << 1) | bit) & 0x1ff) | 0x100;
  331|  1.84M|  }
  332|  24.5M|  return bit;
  333|  24.5M|}
_ZN18JArithmeticDecoder10decodeIAIDEjP23JArithmeticDecoderStats:
  336|   619k|				     JArithmeticDecoderStats *stats) {
  337|   619k|  Guint i;
  338|   619k|  int bit;
  339|       |
  340|   619k|  prev = 1;
  341|  7.98M|  for (i = 0; i < codeLen; ++i) {
  ------------------
  |  Branch (341:15): [True: 7.36M, False: 619k]
  ------------------
  342|  7.36M|    bit = decodeBit(prev, stats);
  343|  7.36M|    prev = (prev << 1) | bit;
  344|  7.36M|  }
  345|   619k|  return prev - (1 << codeLen);
  346|   619k|}
_ZN18JArithmeticDecoder6byteInEv:
  348|  14.2M|void JArithmeticDecoder::byteIn() {
  349|  14.2M|  if (buf0 == 0xff) {
  ------------------
  |  Branch (349:7): [True: 11.2M, False: 3.02M]
  ------------------
  350|  11.2M|    if (buf1 > 0x8f) {
  ------------------
  |  Branch (350:9): [True: 11.2M, False: 21.6k]
  ------------------
  351|  11.2M|      if (limitStream) {
  ------------------
  |  Branch (351:11): [True: 3.28M, False: 7.96M]
  ------------------
  352|  3.28M|	buf0 = buf1;
  353|  3.28M|	buf1 = readByte();
  354|  3.28M|	c = c + 0xff00 - (buf0 << 8);
  355|  3.28M|      }
  356|  11.2M|      ct = 8;
  357|  11.2M|    } else {
  358|  21.6k|      buf0 = buf1;
  359|  21.6k|      buf1 = readByte();
  360|  21.6k|      c = c + 0xfe00 - (buf0 << 9);
  361|  21.6k|      ct = 7;
  362|  21.6k|    }
  363|  11.2M|  } else {
  364|  3.02M|    buf0 = buf1;
  365|  3.02M|    buf1 = readByte();
  366|  3.02M|    c = c + 0xff00 - (buf0 << 8);
  367|  3.02M|    ct = 8;
  368|  3.02M|  }
  369|  14.2M|}
_ZN18JArithmeticDecoder8readByteEv:
   96|  8.50M|inline Guint JArithmeticDecoder::readByte() {
   97|  8.50M|  if (limitStream) {
  ------------------
  |  Branch (97:7): [True: 7.34M, False: 1.16M]
  ------------------
   98|  7.34M|    if (readBufNext < readBufLength) {
  ------------------
  |  Branch (98:9): [True: 1.31M, False: 6.02M]
  ------------------
   99|  1.31M|      return readBuf[readBufNext++];
  100|  1.31M|    }
  101|  6.02M|    --dataLen;
  102|  6.02M|    if (dataLen < 0) {
  ------------------
  |  Branch (102:9): [True: 3.68M, False: 2.34M]
  ------------------
  103|  3.68M|      return 0xff;
  104|  3.68M|    }
  105|  6.02M|  }
  106|  3.51M|  ++nBytesRead;
  107|  3.51M|  return (Guint)str->getChar() & 0xff;
  108|  8.50M|}

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

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

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

_ZN5LexerC2EP4XRefP6Stream:
   46|   392k|Lexer::Lexer(XRef *xref, Stream *str) {
   47|   392k|  Object obj;
   48|       |
   49|   392k|  curStr.initStream(str);
   50|   392k|  streams = new Array(xref);
   51|   392k|  streams->add(curStr.copy(&obj));
   52|   392k|  strPtr = 0;
   53|   392k|  freeArray = gTrue;
  ------------------
  |  |   17|   392k|#define gTrue 1
  ------------------
   54|   392k|  curStr.streamReset();
   55|   392k|}
_ZN5LexerD2Ev:
   75|   392k|Lexer::~Lexer() {
   76|   392k|  if (!curStr.isNone()) {
  ------------------
  |  Branch (76:7): [True: 122k, False: 269k]
  ------------------
   77|   122k|    curStr.streamClose();
   78|   122k|    curStr.free();
   79|   122k|  }
   80|   392k|  if (freeArray) {
  ------------------
  |  Branch (80:7): [True: 392k, False: 0]
  ------------------
   81|   392k|    delete streams;
   82|   392k|  }
   83|   392k|}
_ZN5Lexer7getCharEv:
   85|  1.74G|int Lexer::getChar() {
   86|  1.74G|  int c;
   87|       |
   88|  1.74G|  c = EOF;
   89|  1.74G|  while (!curStr.isNone() && (c = curStr.streamGetChar()) == EOF) {
  ------------------
  |  Branch (89:10): [True: 1.62G, False: 125M]
  |  Branch (89:30): [True: 269k, False: 1.62G]
  ------------------
   90|   269k|    curStr.streamClose();
   91|   269k|    curStr.free();
   92|   269k|    ++strPtr;
   93|   269k|    if (strPtr < streams->getLength()) {
  ------------------
  |  Branch (93:9): [True: 0, False: 269k]
  ------------------
   94|      0|      streams->get(strPtr, &curStr);
   95|      0|      curStr.streamReset();
   96|      0|    }
   97|   269k|  }
   98|  1.74G|  return c;
   99|  1.74G|}
_ZN5Lexer8lookCharEv:
  101|   280M|int Lexer::lookChar() {
  102|   280M|  if (curStr.isNone()) {
  ------------------
  |  Branch (102:7): [True: 3.30k, False: 280M]
  ------------------
  103|  3.30k|    return EOF;
  104|  3.30k|  }
  105|   280M|  return curStr.streamLookChar();
  106|   280M|}
_ZN5Lexer6getObjEP6Object:
  108|   172M|Object *Lexer::getObj(Object *obj) {
  109|   172M|  char *p;
  110|   172M|  int c, c2;
  111|   172M|  GBool comment, neg, doubleMinus, done, invalid;
  112|   172M|  int numParen, nErrors;
  113|   172M|  int xi;
  114|   172M|  double xf, scale;
  115|   172M|  GString *s;
  116|   172M|  int n, m;
  117|       |
  118|       |  // skip whitespace and comments
  119|   172M|  comment = gFalse;
  ------------------
  |  |   18|   172M|#define gFalse 0
  ------------------
  120|   859M|  while (1) {
  ------------------
  |  Branch (120:10): [True: 859M, Folded]
  ------------------
  121|   859M|    if ((c = getChar()) == EOF) {
  ------------------
  |  Branch (121:9): [True: 125M, False: 733M]
  ------------------
  122|   125M|      return obj->initEOF();
  123|   125M|    }
  124|   733M|    if (comment) {
  ------------------
  |  Branch (124:9): [True: 19.2M, False: 714M]
  ------------------
  125|  19.2M|      if (c == '\r' || c == '\n')
  ------------------
  |  Branch (125:11): [True: 115k, False: 19.1M]
  |  Branch (125:24): [True: 194k, False: 18.9M]
  ------------------
  126|   309k|	comment = gFalse;
  ------------------
  |  |   18|   309k|#define gFalse 0
  ------------------
  127|   714M|    } else if (c == '%') {
  ------------------
  |  Branch (127:16): [True: 312k, False: 714M]
  ------------------
  128|   312k|      comment = gTrue;
  ------------------
  |  |   17|   312k|#define gTrue 1
  ------------------
  129|   714M|    } else if (specialChars[c] != 1) {
  ------------------
  |  Branch (129:16): [True: 46.2M, False: 668M]
  ------------------
  130|  46.2M|      break;
  131|  46.2M|    }
  132|   733M|  }
  133|       |
  134|       |  // start reading token
  135|  46.2M|  switch (c) {
  136|       |
  137|       |  // number
  138|  5.27M|  case '0': case '1': case '2': case '3': case '4':
  ------------------
  |  Branch (138:3): [True: 2.72M, False: 43.4M]
  |  Branch (138:13): [True: 1.13M, False: 45.0M]
  |  Branch (138:23): [True: 783k, False: 45.4M]
  |  Branch (138:33): [True: 251k, False: 45.9M]
  |  Branch (138:43): [True: 382k, False: 45.8M]
  ------------------
  139|  6.86M|  case '5': case '6': case '7': case '8': case '9':
  ------------------
  |  Branch (139:3): [True: 254k, False: 45.9M]
  |  Branch (139:13): [True: 367k, False: 45.8M]
  |  Branch (139:23): [True: 171k, False: 46.0M]
  |  Branch (139:33): [True: 559k, False: 45.6M]
  |  Branch (139:43): [True: 233k, False: 45.9M]
  ------------------
  140|  7.40M|  case '+': case '-': case '.':
  ------------------
  |  Branch (140:3): [True: 45.4k, False: 46.1M]
  |  Branch (140:13): [True: 277k, False: 45.9M]
  |  Branch (140:23): [True: 217k, False: 45.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|  7.40M|    neg = gFalse;
  ------------------
  |  |   18|  7.40M|#define gFalse 0
  ------------------
  156|  7.40M|    doubleMinus = gFalse;
  ------------------
  |  |   18|  7.40M|#define gFalse 0
  ------------------
  157|  7.40M|    xf = xi = 0;
  158|  7.40M|    if (c == '+') {
  ------------------
  |  Branch (158:9): [True: 45.4k, False: 7.35M]
  ------------------
  159|       |      // just ignore it
  160|  7.35M|    } else if (c == '-') {
  ------------------
  |  Branch (160:16): [True: 277k, False: 7.08M]
  ------------------
  161|   277k|      neg = gTrue;
  ------------------
  |  |   17|   277k|#define gTrue 1
  ------------------
  162|   277k|      if (lookChar() == '-') {
  ------------------
  |  Branch (162:11): [True: 11.2k, False: 265k]
  ------------------
  163|  11.2k|	doubleMinus = gTrue;
  ------------------
  |  |   17|  11.2k|#define gTrue 1
  ------------------
  164|  17.7k|	do {
  165|  17.7k|	  getChar();
  166|  17.7k|	} while (lookChar() == '-');
  ------------------
  |  Branch (166:11): [True: 6.54k, False: 11.2k]
  ------------------
  167|  11.2k|      }
  168|  7.08M|    } else if (c == '.') {
  ------------------
  |  Branch (168:16): [True: 217k, False: 6.86M]
  ------------------
  169|   217k|      goto doReal;
  170|  6.86M|    } else {
  171|  6.86M|      xf = xi = c - '0';
  172|  6.86M|    }
  173|  15.1M|    while (1) {
  ------------------
  |  Branch (173:12): [True: 15.1M, Folded]
  ------------------
  174|  15.1M|      c = lookChar();
  175|  15.1M|      if (isdigit(c)) {
  ------------------
  |  Branch (175:11): [True: 7.93M, False: 7.18M]
  ------------------
  176|  7.93M|	getChar();
  177|  7.93M|	xi = xi * 10 + (c - '0');
  178|  7.93M|	if (xf < 1e20) {
  ------------------
  |  Branch (178:6): [True: 7.55M, False: 384k]
  ------------------
  179|  7.55M|	  xf = xf * 10 + (c - '0');
  180|  7.55M|	}
  181|  7.93M|      } else if (c == '.') {
  ------------------
  |  Branch (181:18): [True: 332k, False: 6.85M]
  ------------------
  182|   332k|	getChar();
  183|   332k|	goto doReal;
  184|  6.85M|      } else {
  185|  6.85M|	break;
  186|  6.85M|      }
  187|  15.1M|    }
  188|  6.86M|    while ((c = lookChar()) == '-' || isdigit(c)) {
  ------------------
  |  Branch (188:12): [True: 4.07k, False: 6.85M]
  |  Branch (188:39): [True: 5.54k, False: 6.85M]
  ------------------
  189|  9.61k|      getChar();
  190|  9.61k|    }
  191|  6.85M|    if (neg) {
  ------------------
  |  Branch (191:9): [True: 270k, False: 6.58M]
  ------------------
  192|   270k|      xi = -xi;
  193|   270k|    }
  194|  6.85M|    if (doubleMinus) {
  ------------------
  |  Branch (194:9): [True: 11.1k, False: 6.84M]
  ------------------
  195|  11.1k|      xi = 0;
  196|  11.1k|    }
  197|  6.85M|    obj->initInt(xi);
  198|  6.85M|    break;
  199|   549k|  doReal:
  200|   549k|    scale = 0.1;
  201|  1.09M|    while (1) {
  ------------------
  |  Branch (201:12): [True: 1.09M, Folded]
  ------------------
  202|  1.09M|      c = lookChar();
  203|  1.09M|      if (c == '-') {
  ------------------
  |  Branch (203:11): [True: 29.4k, False: 1.06M]
  ------------------
  204|  29.4k|	error(errSyntaxWarning, getPos(), "Badly formatted number");
  205|  29.4k|	getChar();
  206|  29.4k|	continue;
  207|  29.4k|      }
  208|  1.06M|      if (!isdigit(c)) {
  ------------------
  |  Branch (208:11): [True: 549k, False: 518k]
  ------------------
  209|   549k|	break;
  210|   549k|      }
  211|   518k|      getChar();
  212|   518k|      xf = xf + scale * (c - '0');
  213|   518k|      scale *= 0.1;
  214|   518k|    }
  215|   549k|    while ((c = lookChar()) == '-' || isdigit(c)) {
  ------------------
  |  Branch (215:12): [True: 0, False: 549k]
  |  Branch (215:39): [True: 0, False: 549k]
  ------------------
  216|      0|      getChar();
  217|      0|    }
  218|   549k|    if (neg) {
  ------------------
  |  Branch (218:9): [True: 6.13k, False: 543k]
  ------------------
  219|  6.13k|      xf = -xf;
  220|  6.13k|    }
  221|   549k|    obj->initReal(xf);
  222|   549k|    break;
  223|       |
  224|       |  // string
  225|   209k|  case '(':
  ------------------
  |  Branch (225:3): [True: 209k, False: 45.9M]
  ------------------
  226|   209k|    p = tokBuf;
  227|   209k|    n = 0;
  228|   209k|    numParen = 1;
  229|   209k|    done = gFalse;
  ------------------
  |  |   18|   209k|#define gFalse 0
  ------------------
  230|   209k|    s = NULL;
  231|   598M|    do {
  232|   598M|      c2 = EOF;
  233|   598M|      switch (c = getChar()) {
  234|       |
  235|  12.0k|      case EOF:
  ------------------
  |  Branch (235:7): [True: 12.0k, False: 598M]
  ------------------
  236|  12.0k|	error(errSyntaxError, getPos(), "Unterminated string");
  237|  12.0k|	done = gTrue;
  ------------------
  |  |   17|  12.0k|#define gTrue 1
  ------------------
  238|  12.0k|	break;
  239|       |
  240|  3.07M|      case '(':
  ------------------
  |  Branch (240:7): [True: 3.07M, False: 595M]
  ------------------
  241|  3.07M|	++numParen;
  242|  3.07M|	c2 = c;
  243|  3.07M|	break;
  244|       |
  245|  1.27M|      case ')':
  ------------------
  |  Branch (245:7): [True: 1.27M, False: 597M]
  ------------------
  246|  1.27M|	if (--numParen == 0) {
  ------------------
  |  Branch (246:6): [True: 197k, False: 1.07M]
  ------------------
  247|   197k|	  done = gTrue;
  ------------------
  |  |   17|   197k|#define gTrue 1
  ------------------
  248|  1.07M|	} else {
  249|  1.07M|	  c2 = c;
  250|  1.07M|	}
  251|  1.27M|	break;
  252|       |
  253|  5.53M|      case '\r':
  ------------------
  |  Branch (253:7): [True: 5.53M, False: 593M]
  ------------------
  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|  5.53M|	c = lookChar();
  257|  5.53M|	if (c == '\n') {
  ------------------
  |  Branch (257:6): [True: 100k, False: 5.43M]
  ------------------
  258|   100k|	  getChar();
  259|   100k|	}
  260|  5.53M|	c2 = '\n';
  261|  5.53M|	break;
  262|       |
  263|   730k|      case '\\':
  ------------------
  |  Branch (263:7): [True: 730k, False: 598M]
  ------------------
  264|   730k|	switch (c = getChar()) {
  265|  4.01k|	case 'n':
  ------------------
  |  Branch (265:2): [True: 4.01k, False: 725k]
  ------------------
  266|  4.01k|	  c2 = '\n';
  267|  4.01k|	  break;
  268|  19.2k|	case 'r':
  ------------------
  |  Branch (268:2): [True: 19.2k, False: 710k]
  ------------------
  269|  19.2k|	  c2 = '\r';
  270|  19.2k|	  break;
  271|  24.2k|	case 't':
  ------------------
  |  Branch (271:2): [True: 24.2k, False: 705k]
  ------------------
  272|  24.2k|	  c2 = '\t';
  273|  24.2k|	  break;
  274|  4.88k|	case 'b':
  ------------------
  |  Branch (274:2): [True: 4.88k, False: 725k]
  ------------------
  275|  4.88k|	  c2 = '\b';
  276|  4.88k|	  break;
  277|  3.47k|	case 'f':
  ------------------
  |  Branch (277:2): [True: 3.47k, False: 726k]
  ------------------
  278|  3.47k|	  c2 = '\f';
  279|  3.47k|	  break;
  280|  2.75k|	case '\\':
  ------------------
  |  Branch (280:2): [True: 2.75k, False: 727k]
  ------------------
  281|  14.7k|	case '(':
  ------------------
  |  Branch (281:2): [True: 11.9k, False: 718k]
  ------------------
  282|  28.4k|	case ')':
  ------------------
  |  Branch (282:2): [True: 13.7k, False: 716k]
  ------------------
  283|  28.4k|	  c2 = c;
  284|  28.4k|	  break;
  285|  15.7k|	case '0': case '1': case '2': case '3':
  ------------------
  |  Branch (285:2): [True: 8.44k, False: 721k]
  |  Branch (285:12): [True: 2.57k, False: 727k]
  |  Branch (285:22): [True: 2.48k, False: 727k]
  |  Branch (285:32): [True: 2.23k, False: 727k]
  ------------------
  286|  45.8k|	case '4': case '5': case '6': case '7':
  ------------------
  |  Branch (286:2): [True: 5.85k, False: 724k]
  |  Branch (286:12): [True: 8.10k, False: 721k]
  |  Branch (286:22): [True: 8.17k, False: 721k]
  |  Branch (286:32): [True: 7.93k, False: 722k]
  ------------------
  287|  45.8k|	  c2 = c - '0';
  288|  45.8k|	  c = lookChar();
  289|  45.8k|	  if (c >= '0' && c <= '7') {
  ------------------
  |  Branch (289:8): [True: 25.1k, False: 20.7k]
  |  Branch (289:20): [True: 7.51k, False: 17.6k]
  ------------------
  290|  7.51k|	    getChar();
  291|  7.51k|	    c2 = (c2 << 3) + (c - '0');
  292|  7.51k|	    c = lookChar();
  293|  7.51k|	    if (c >= '0' && c <= '7') {
  ------------------
  |  Branch (293:10): [True: 2.40k, False: 5.10k]
  |  Branch (293:22): [True: 371, False: 2.03k]
  ------------------
  294|    371|	      getChar();
  295|    371|	      c2 = (c2 << 3) + (c - '0');
  296|    371|	    }
  297|  7.51k|	  }
  298|  45.8k|	  break;
  299|  4.06k|	case '\r':
  ------------------
  |  Branch (299:2): [True: 4.06k, False: 725k]
  ------------------
  300|  4.06k|	  c = lookChar();
  301|  4.06k|	  if (c == '\n') {
  ------------------
  |  Branch (301:8): [True: 1.28k, False: 2.78k]
  ------------------
  302|  1.28k|	    getChar();
  303|  1.28k|	  }
  304|  4.06k|	  break;
  305|  8.73k|	case '\n':
  ------------------
  |  Branch (305:2): [True: 8.73k, False: 721k]
  ------------------
  306|  8.73k|	  break;
  307|    269|	case EOF:
  ------------------
  |  Branch (307:2): [True: 269, False: 729k]
  ------------------
  308|    269|	  error(errSyntaxError, getPos(), "Unterminated string");
  309|    269|	  done = gTrue;
  ------------------
  |  |   17|    269|#define gTrue 1
  ------------------
  310|    269|	  break;
  311|   586k|	default:
  ------------------
  |  Branch (311:2): [True: 586k, False: 143k]
  ------------------
  312|   586k|	  c2 = c;
  313|   586k|	  break;
  314|   730k|	}
  315|   730k|	break;
  316|       |
  317|   588M|      default:
  ------------------
  |  Branch (317:7): [True: 588M, False: 10.6M]
  ------------------
  318|   588M|	c2 = c;
  319|   588M|	break;
  320|   598M|      }
  321|       |
  322|   598M|      if (c2 != EOF) {
  ------------------
  |  Branch (322:11): [True: 598M, False: 222k]
  ------------------
  323|   598M|	if (n == tokBufSize) {
  ------------------
  |  |   19|   598M|#define tokBufSize 128		// size of token buffer
  ------------------
  |  Branch (323:6): [True: 4.60M, False: 593M]
  ------------------
  324|  4.60M|	  if (!s)
  ------------------
  |  Branch (324:8): [True: 65.5k, False: 4.54M]
  ------------------
  325|  65.5k|	    s = new GString(tokBuf, tokBufSize);
  ------------------
  |  |   19|  65.5k|#define tokBufSize 128		// size of token buffer
  ------------------
  326|  4.54M|	  else
  327|  4.54M|	    s->append(tokBuf, tokBufSize);
  ------------------
  |  |   19|  4.54M|#define tokBufSize 128		// size of token buffer
  ------------------
  328|  4.60M|	  p = tokBuf;
  329|  4.60M|	  n = 0;
  330|  4.60M|	}
  331|   598M|	*p++ = (char)c2;
  332|   598M|	++n;
  333|   598M|      }
  334|   598M|    } while (!done);
  ------------------
  |  Branch (334:14): [True: 598M, False: 209k]
  ------------------
  335|   209k|    if (!s)
  ------------------
  |  Branch (335:9): [True: 144k, False: 65.5k]
  ------------------
  336|   144k|      s = new GString(tokBuf, n);
  337|  65.5k|    else
  338|  65.5k|      s->append(tokBuf, n);
  339|   209k|    obj->initString(s);
  340|   209k|    break;
  341|       |
  342|       |  // name
  343|  6.80M|  case '/':
  ------------------
  |  Branch (343:3): [True: 6.80M, False: 39.3M]
  ------------------
  344|  6.80M|    p = tokBuf;
  345|  6.80M|    n = 0;
  346|  6.80M|    s = NULL;
  347|  6.80M|    invalid = gFalse;
  ------------------
  |  |   18|  6.80M|#define gFalse 0
  ------------------
  348|  29.5M|    while ((c = lookChar()) != EOF && !specialChars[c]) {
  ------------------
  |  Branch (348:12): [True: 29.5M, False: 3.66k]
  |  Branch (348:39): [True: 22.7M, False: 6.80M]
  ------------------
  349|  22.7M|      getChar();
  350|  22.7M|      if (c == '#') {
  ------------------
  |  Branch (350:11): [True: 828k, False: 21.8M]
  ------------------
  351|   828k|	c2 = lookChar();
  352|   828k|	if (c2 >= '0' && c2 <= '9') {
  ------------------
  |  Branch (352:6): [True: 407k, False: 421k]
  |  Branch (352:19): [True: 2.07k, False: 405k]
  ------------------
  353|  2.07k|	  c = c2 - '0';
  354|   826k|	} else if (c2 >= 'A' && c2 <= 'F') {
  ------------------
  |  Branch (354:13): [True: 405k, False: 421k]
  |  Branch (354:26): [True: 47.1k, False: 357k]
  ------------------
  355|  47.1k|	  c = c2 - 'A' + 10;
  356|   779k|	} else if (c2 >= 'a' && c2 <= 'f') {
  ------------------
  |  Branch (356:13): [True: 357k, False: 421k]
  |  Branch (356:26): [True: 98.1k, False: 259k]
  ------------------
  357|  98.1k|	  c = c2 - 'a' + 10;
  358|   681k|	} else {
  359|   681k|	  error(errSyntaxError, getPos(), "Invalid hex escape in name");
  360|   681k|	  goto notEscChar;
  361|   681k|	}
  362|   147k|	getChar();
  363|   147k|	c2 = lookChar();
  364|   147k|	if (c2 >= '0' && c2 <= '9') {
  ------------------
  |  Branch (364:6): [True: 145k, False: 1.47k]
  |  Branch (364:19): [True: 27.8k, False: 118k]
  ------------------
  365|  27.8k|	  c = (c << 4) + (c2 - '0');
  366|   119k|	} else if (c2 >= 'A' && c2 <= 'F') {
  ------------------
  |  Branch (366:13): [True: 95.6k, False: 23.9k]
  |  Branch (366:26): [True: 46.8k, False: 48.8k]
  ------------------
  367|  46.8k|	  c = (c << 4) + (c2 - 'A' + 10);
  368|  72.7k|	} else if (c2 >= 'a' && c2 <= 'f') {
  ------------------
  |  Branch (368:13): [True: 2.02k, False: 70.7k]
  |  Branch (368:26): [True: 1.10k, False: 915]
  ------------------
  369|  1.10k|	  c = (c << 4) + (c2 - 'a' + 10);
  370|  71.6k|	} else {
  371|  71.6k|	  error(errSyntaxError, getPos(), "Invalid hex escape in name");
  372|  71.6k|	  goto notEscChar;
  373|  71.6k|	}
  374|  75.7k|	getChar();
  375|  75.7k|	if (c == 0) {
  ------------------
  |  Branch (375:6): [True: 668, False: 75.0k]
  ------------------
  376|    668|	  invalid = gTrue;
  ------------------
  |  |   17|    668|#define gTrue 1
  ------------------
  377|    668|	}
  378|  75.7k|      }
  379|  22.7M|     notEscChar:
  380|       |      // the PDF spec claims that names are limited to 127 chars, but
  381|       |      // Distiller 8 will produce longer names, and Acrobat 8 will
  382|       |      // accept longer names
  383|  22.7M|      ++n;
  384|  22.7M|      if (n < tokBufSize) {
  ------------------
  |  |   19|  22.7M|#define tokBufSize 128		// size of token buffer
  ------------------
  |  Branch (384:11): [True: 21.6M, False: 1.02M]
  ------------------
  385|  21.6M|	*p++ = (char)c;
  386|  21.6M|      } else if (n == tokBufSize) {
  ------------------
  |  |   19|  1.02M|#define tokBufSize 128		// size of token buffer
  ------------------
  |  Branch (386:18): [True: 2.35k, False: 1.02M]
  ------------------
  387|  2.35k|	*p = (char)c;
  388|  2.35k|	s = new GString(tokBuf, n);
  389|  1.02M|      } else {
  390|  1.02M|	s->append((char)c);
  391|  1.02M|      }
  392|  22.7M|    }
  393|  6.80M|    if (invalid) {
  ------------------
  |  Branch (393:9): [True: 668, False: 6.80M]
  ------------------
  394|    668|      error(errSyntaxError, getPos(), "Null character in name");
  395|    668|      obj->initError();
  396|    668|      if (s) {
  ------------------
  |  Branch (396:11): [True: 291, False: 377]
  ------------------
  397|    291|	delete s;
  398|    291|      }
  399|  6.80M|    } else if (n < tokBufSize) {
  ------------------
  |  |   19|  6.80M|#define tokBufSize 128		// size of token buffer
  ------------------
  |  Branch (399:16): [True: 6.80M, False: 2.06k]
  ------------------
  400|  6.80M|      *p = '\0';
  401|  6.80M|      obj->initName(tokBuf);
  402|  6.80M|    } else {
  403|  2.06k|      obj->initName(s->getCString());
  404|  2.06k|      delete s;
  405|  2.06k|    }
  406|  6.80M|    break;
  407|       |
  408|       |  // array punctuation
  409|  5.23M|  case '[':
  ------------------
  |  Branch (409:3): [True: 5.23M, False: 40.9M]
  ------------------
  410|  5.77M|  case ']':
  ------------------
  |  Branch (410:3): [True: 530k, False: 45.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.95M|  case '<':
  ------------------
  |  Branch (417:3): [True: 3.95M, False: 42.2M]
  ------------------
  418|  3.95M|    c = lookChar();
  419|       |
  420|       |    // dict punctuation
  421|  3.95M|    if (c == '<') {
  ------------------
  |  Branch (421:9): [True: 3.19M, False: 757k]
  ------------------
  422|  3.19M|      getChar();
  423|  3.19M|      tokBuf[0] = tokBuf[1] = '<';
  424|  3.19M|      tokBuf[2] = '\0';
  425|  3.19M|      obj->initCmd(tokBuf);
  426|       |
  427|       |    // hex string
  428|  3.19M|    } else {
  429|   757k|      p = tokBuf;
  430|   757k|      m = n = 0;
  431|   757k|      c2 = 0;
  432|   757k|      s = NULL;
  433|   757k|      nErrors = 0;
  434|  54.3M|      while (nErrors < 100) {
  ------------------
  |  Branch (434:14): [True: 54.1M, False: 162k]
  ------------------
  435|  54.1M|	c = getChar();
  436|  54.1M|	if (c == '>') {
  ------------------
  |  Branch (436:6): [True: 591k, False: 53.5M]
  ------------------
  437|   591k|	  break;
  438|  53.5M|	} else if (c == EOF) {
  ------------------
  |  Branch (438:13): [True: 2.79k, False: 53.5M]
  ------------------
  439|  2.79k|	  error(errSyntaxError, getPos(), "Unterminated hex string");
  440|  2.79k|	  break;
  441|  53.5M|	} else if (specialChars[c] != 1) {
  ------------------
  |  Branch (441:13): [True: 46.6M, False: 6.92M]
  ------------------
  442|  46.6M|	  c2 = c2 << 4;
  443|  46.6M|	  if (c >= '0' && c <= '9') {
  ------------------
  |  Branch (443:8): [True: 41.8M, False: 4.83M]
  |  Branch (443:20): [True: 5.75M, False: 36.0M]
  ------------------
  444|  5.75M|	    c2 += c - '0';
  445|  40.9M|	  } else if (c >= 'A' && c <= 'F') {
  ------------------
  |  Branch (445:15): [True: 32.1M, False: 8.73M]
  |  Branch (445:27): [True: 733k, False: 31.4M]
  ------------------
  446|   733k|	    c2 += c - 'A' + 10;
  447|  40.1M|	  } else if (c >= 'a' && c <= 'f') {
  ------------------
  |  Branch (447:15): [True: 28.6M, False: 11.5M]
  |  Branch (447:27): [True: 6.54M, False: 22.1M]
  ------------------
  448|  6.54M|	    c2 += c - 'a' + 10;
  449|  33.6M|	  } else {
  450|  33.6M|	    error(errSyntaxError, getPos(),
  451|  33.6M|		  "Illegal character <{0:02x}> in hex string", c);
  452|  33.6M|	    ++nErrors;
  453|  33.6M|	  }
  454|  46.6M|	  if (++m == 2) {
  ------------------
  |  Branch (454:8): [True: 23.1M, False: 23.5M]
  ------------------
  455|  23.1M|	    if (n == tokBufSize) {
  ------------------
  |  |   19|  23.1M|#define tokBufSize 128		// size of token buffer
  ------------------
  |  Branch (455:10): [True: 5.19k, False: 23.1M]
  ------------------
  456|  5.19k|	      if (!s)
  ------------------
  |  Branch (456:12): [True: 2.53k, False: 2.66k]
  ------------------
  457|  2.53k|		s = new GString(tokBuf, tokBufSize);
  ------------------
  |  |   19|  2.53k|#define tokBufSize 128		// size of token buffer
  ------------------
  458|  2.66k|	      else
  459|  2.66k|		s->append(tokBuf, tokBufSize);
  ------------------
  |  |   19|  2.66k|#define tokBufSize 128		// size of token buffer
  ------------------
  460|  5.19k|	      p = tokBuf;
  461|  5.19k|	      n = 0;
  462|  5.19k|	    }
  463|  23.1M|	    *p++ = (char)c2;
  464|  23.1M|	    ++n;
  465|  23.1M|	    c2 = 0;
  466|  23.1M|	    m = 0;
  467|  23.1M|	  }
  468|  46.6M|	}
  469|  54.1M|      }
  470|   757k|      if (!s)
  ------------------
  |  Branch (470:11): [True: 754k, False: 2.53k]
  ------------------
  471|   754k|	s = new GString(tokBuf, n);
  472|  2.53k|      else
  473|  2.53k|	s->append(tokBuf, n);
  474|   757k|      if (m == 1)
  ------------------
  |  Branch (474:11): [True: 342k, False: 415k]
  ------------------
  475|   342k|	s->append((char)(c2 << 4));
  476|   757k|      obj->initString(s);
  477|   757k|    }
  478|  3.95M|    break;
  479|       |
  480|       |  // dict punctuation
  481|  3.05M|  case '>':
  ------------------
  |  Branch (481:3): [True: 3.05M, False: 43.1M]
  ------------------
  482|  3.05M|    c = lookChar();
  483|  3.05M|    if (c == '>') {
  ------------------
  |  Branch (483:9): [True: 1.93M, False: 1.12M]
  ------------------
  484|  1.93M|      getChar();
  485|  1.93M|      tokBuf[0] = tokBuf[1] = '>';
  486|  1.93M|      tokBuf[2] = '\0';
  487|  1.93M|      obj->initCmd(tokBuf);
  488|  1.93M|    } else {
  489|  1.12M|      error(errSyntaxError, getPos(), "Illegal character '>'");
  490|  1.12M|      obj->initError();
  491|  1.12M|    }
  492|  3.05M|    break;
  493|       |
  494|       |  // error
  495|   889k|  case ')':
  ------------------
  |  Branch (495:3): [True: 889k, False: 45.3M]
  ------------------
  496|  1.07M|  case '{':
  ------------------
  |  Branch (496:3): [True: 187k, False: 46.0M]
  ------------------
  497|  1.20M|  case '}':
  ------------------
  |  Branch (497:3): [True: 131k, False: 46.0M]
  ------------------
  498|  1.20M|    error(errSyntaxError, getPos(), "Illegal character '{0:c}'", c);
  499|  1.20M|    obj->initError();
  500|  1.20M|    break;
  501|       |
  502|       |  // command
  503|  17.7M|  default:
  ------------------
  |  Branch (503:3): [True: 17.7M, False: 28.4M]
  ------------------
  504|  17.7M|    p = tokBuf;
  505|  17.7M|    *p++ = (char)c;
  506|  17.7M|    n = 1;
  507|   212M|    while ((c = lookChar()) != EOF && !specialChars[c]) {
  ------------------
  |  Branch (507:12): [True: 212M, False: 24.2k]
  |  Branch (507:39): [True: 196M, False: 16.8M]
  ------------------
  508|   196M|      getChar();
  509|   196M|      if (++n == tokBufSize) {
  ------------------
  |  |   19|   196M|#define tokBufSize 128		// size of token buffer
  ------------------
  |  Branch (509:11): [True: 885k, False: 195M]
  ------------------
  510|   885k|	error(errSyntaxError, getPos(), "Command token too long");
  511|   885k|	break;
  512|   885k|      }
  513|   195M|      *p++ = (char)c;
  514|   195M|    }
  515|  17.7M|    *p = '\0';
  516|  17.7M|    if (tokBuf[0] == 't' && !strcmp(tokBuf, "true")) {
  ------------------
  |  Branch (516:9): [True: 2.00M, False: 15.7M]
  |  Branch (516:29): [True: 70.9k, False: 1.93M]
  ------------------
  517|  70.9k|      obj->initBool(gTrue);
  ------------------
  |  |   17|  70.9k|#define gTrue 1
  ------------------
  518|  17.7M|    } else if (tokBuf[0] == 'f' && !strcmp(tokBuf, "false")) {
  ------------------
  |  Branch (518:16): [True: 31.2k, False: 17.6M]
  |  Branch (518:36): [True: 1.34k, False: 29.8k]
  ------------------
  519|  1.34k|      obj->initBool(gFalse);
  ------------------
  |  |   18|  1.34k|#define gFalse 0
  ------------------
  520|  17.7M|    } else if (tokBuf[0] == 'n' && !strcmp(tokBuf, "null")) {
  ------------------
  |  Branch (520:16): [True: 129k, False: 17.5M]
  |  Branch (520:36): [True: 750, False: 128k]
  ------------------
  521|    750|      obj->initNull();
  522|  17.7M|    } else {
  523|  17.7M|      obj->initCmd(tokBuf);
  524|  17.7M|    }
  525|  17.7M|    break;
  526|  46.2M|  }
  527|       |
  528|  46.2M|  return obj;
  529|  46.2M|}
_ZN5Lexer14skipToNextLineEv:
  531|   108k|void Lexer::skipToNextLine() {
  532|   108k|  int c;
  533|       |
  534|   409k|  while (1) {
  ------------------
  |  Branch (534:10): [True: 409k, Folded]
  ------------------
  535|   409k|    c = getChar();
  536|   409k|    if (c == EOF || c == '\n') {
  ------------------
  |  Branch (536:9): [True: 2.63k, False: 406k]
  |  Branch (536:21): [True: 33.0k, False: 373k]
  ------------------
  537|  35.6k|      return;
  538|  35.6k|    }
  539|   373k|    if (c == '\r') {
  ------------------
  |  Branch (539:9): [True: 72.8k, False: 300k]
  ------------------
  540|  72.8k|      if ((c = lookChar()) == '\n') {
  ------------------
  |  Branch (540:11): [True: 64.9k, False: 7.93k]
  ------------------
  541|  64.9k|	getChar();
  542|  64.9k|      }
  543|  72.8k|      return;
  544|  72.8k|    }
  545|   373k|  }
  546|   108k|}
_ZN5Lexer9skipToEOFEv:
  548|  39.0k|void Lexer::skipToEOF() {
  549|  2.23M|  while (getChar() != EOF) ;
  ------------------
  |  Branch (549:10): [True: 2.19M, False: 39.0k]
  ------------------
  550|  39.0k|}
_ZN5Lexer7isSpaceEi:
  552|  46.5M|GBool Lexer::isSpace(int c) {
  553|  46.5M|  return c >= 0 && c <= 0xff && specialChars[c] == 1;
  ------------------
  |  Branch (553:10): [True: 46.4M, False: 12.2k]
  |  Branch (553:20): [True: 46.4M, False: 0]
  |  Branch (553:33): [True: 8.12M, False: 38.3M]
  ------------------
  554|  46.5M|}

_ZN5Lexer8skipCharEv:
   49|   296k|  void skipChar() { getChar(); }
_ZN5Lexer9getStreamEv:
   56|   426k|    { return curStr.isNone() ? (Stream *)NULL : curStr.getStream(); }
  ------------------
  |  Branch (56:14): [True: 2.63k, False: 423k]
  ------------------
_ZN5Lexer6getPosEv:
   60|  51.7M|    { return curStr.isNone() ? -1 : curStr.streamGetPos(); }
  ------------------
  |  Branch (60:14): [True: 469k, False: 51.3M]
  ------------------
_ZN5Lexer6setPosEli:
   64|  88.5k|    { if (!curStr.isNone()) curStr.streamSetPos(pos, dir); }
  ------------------
  |  Branch (64:11): [True: 88.5k, False: 0]
  ------------------

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

_ZN10LinkActionD2Ev:
   41|    685|  virtual ~LinkAction() {}
_ZN8LinkDest4isOkEv:
   85|    402|  GBool isOk() { return ok; }
_ZN8LinkGoTo4isOkEv:
  135|    421|  virtual GBool isOk() { return dest || namedDest; }
  ------------------
  |  Branch (135:33): [True: 258, False: 163]
  |  Branch (135:41): [True: 21, False: 142]
  ------------------
_ZN9LinkGoToR4isOkEv:
  165|    126|  virtual GBool isOk() { return fileName && (dest || namedDest); }
  ------------------
  |  Branch (165:33): [True: 19, False: 107]
  |  Branch (165:46): [True: 6, False: 13]
  |  Branch (165:54): [True: 3, False: 10]
  ------------------
_ZN7LinkURI4isOkEv:
  223|     54|  virtual GBool isOk() { return uri != NULL; }
_ZN14LinkJavaScript4isOkEv:
  296|     34|  virtual GBool isOk() { return js != NULL; }
_ZN11LinkUnknown4isOkEv:
  373|     50|  virtual GBool isOk() { return action != NULL; }

_ZN14NameToCharCodeC2Ev:
   25|  21.0k|NameToCharCode::NameToCharCode() {
   26|  21.0k|  int i;
   27|       |
   28|  21.0k|  size = 31;
   29|  21.0k|  len = 0;
   30|  21.0k|  tab = (NameToCharCodeEntry *)gmallocn(size, sizeof(NameToCharCodeEntry));
   31|   673k|  for (i = 0; i < size; ++i) {
  ------------------
  |  Branch (31:15): [True: 652k, False: 21.0k]
  ------------------
   32|       |    tab[i].name = NULL;
   33|   652k|  }
   34|  21.0k|}
_ZN14NameToCharCodeD2Ev:
   36|  21.0k|NameToCharCode::~NameToCharCode() {
   37|  21.0k|  int i;
   38|       |
   39|   177M|  for (i = 0; i < size; ++i) {
  ------------------
  |  Branch (39:15): [True: 177M, False: 21.0k]
  ------------------
   40|   177M|    if (tab[i].name) {
  ------------------
  |  Branch (40:9): [True: 46.9M, False: 130M]
  ------------------
   41|  46.9M|      gfree(tab[i].name);
   42|  46.9M|    }
   43|   177M|  }
   44|  21.0k|  gfree(tab);
   45|  21.0k|}
_ZN14NameToCharCode3addEPKcj:
   47|  47.0M|void NameToCharCode::add(const char *name, CharCode c) {
   48|  47.0M|  NameToCharCodeEntry *oldTab;
   49|  47.0M|  int h, i, oldSize;
   50|       |
   51|       |  // expand the table if necessary
   52|  47.0M|  if (len >= size / 2) {
  ------------------
  |  Branch (52:7): [True: 136k, False: 46.8M]
  ------------------
   53|   136k|    oldSize = size;
   54|   136k|    oldTab = tab;
   55|   136k|    size = 2*size + 1;
   56|   136k|    tab = (NameToCharCodeEntry *)gmallocn(size, sizeof(NameToCharCodeEntry));
   57|   354M|    for (h = 0; h < size; ++h) {
  ------------------
  |  Branch (57:17): [True: 354M, False: 136k]
  ------------------
   58|   354M|      tab[h].name = NULL;
   59|   354M|    }
   60|   177M|    for (i = 0; i < oldSize; ++i) {
  ------------------
  |  Branch (60:17): [True: 177M, False: 136k]
  ------------------
   61|   177M|      if (oldTab[i].name) {
  ------------------
  |  Branch (61:11): [True: 88.4M, False: 88.5M]
  ------------------
   62|  88.4M|	h = hash(oldTab[i].name);
   63|   129M|	while (tab[h].name) {
  ------------------
  |  Branch (63:9): [True: 40.7M, False: 88.4M]
  ------------------
   64|  40.7M|	  if (++h == size) {
  ------------------
  |  Branch (64:8): [True: 0, False: 40.7M]
  ------------------
   65|      0|	    h = 0;
   66|      0|	  }
   67|  40.7M|	}
   68|  88.4M|	tab[h] = oldTab[i];
   69|  88.4M|      }
   70|   177M|    }
   71|   136k|    gfree(oldTab);
   72|   136k|  }
   73|       |
   74|       |  // add the new name
   75|  47.0M|  h = hash(name);
   76|   195M|  while (tab[h].name && strcmp(tab[h].name, name)) {
  ------------------
  |  Branch (76:10): [True: 148M, False: 46.9M]
  |  Branch (76:25): [True: 148M, False: 10.5k]
  ------------------
   77|   148M|    if (++h == size) {
  ------------------
  |  Branch (77:9): [True: 31.5k, False: 148M]
  ------------------
   78|  31.5k|      h = 0;
   79|  31.5k|    }
   80|   148M|  }
   81|  47.0M|  if (!tab[h].name) {
  ------------------
  |  Branch (81:7): [True: 46.9M, False: 10.5k]
  ------------------
   82|  46.9M|    tab[h].name = copyString(name);
   83|  46.9M|  }
   84|  47.0M|  tab[h].c = c;
   85|       |
   86|  47.0M|  ++len;
   87|  47.0M|}
_ZN14NameToCharCode4hashEPKc:
  104|   135M|int NameToCharCode::hash(const char *name) {
  105|   135M|  const char *p;
  106|   135M|  unsigned int h;
  107|       |
  108|   135M|  h = 0;
  109|  1.59G|  for (p = name; *p; ++p) {
  ------------------
  |  Branch (109:18): [True: 1.45G, False: 135M]
  ------------------
  110|  1.45G|    h = 17 * h + (int)(*p & 0xff);
  111|  1.45G|  }
  112|   135M|  return (int)(h % size);
  113|   135M|}

_ZN6Object9initArrayEP4XRef:
   51|   715k|Object *Object::initArray(XRef *xref) {
   52|   715k|  initObj(objArray);
  ------------------
  |  |   77|   715k|#define initObj(t) type = t
  ------------------
   53|   715k|  array = new Array(xref);
   54|   715k|  return this;
   55|   715k|}
_ZN6Object8initDictEP4XRef:
   57|   624k|Object *Object::initDict(XRef *xref) {
   58|   624k|  initObj(objDict);
  ------------------
  |  |   77|   624k|#define initObj(t) type = t
  ------------------
   59|   624k|  dict = new Dict(xref);
   60|   624k|  return this;
   61|   624k|}
_ZN6Object8initDictEP4Dict:
   63|  5.69k|Object *Object::initDict(Dict *dictA) {
   64|  5.69k|  initObj(objDict);
  ------------------
  |  |   77|  5.69k|#define initObj(t) type = t
  ------------------
   65|  5.69k|  dict = dictA;
   66|  5.69k|  dict->incRef();
   67|  5.69k|  return this;
   68|  5.69k|}
_ZN6Object10initStreamEP6Stream:
   70|   493k|Object *Object::initStream(Stream *streamA) {
   71|   493k|  initObj(objStream);
  ------------------
  |  |   77|   493k|#define initObj(t) type = t
  ------------------
   72|   493k|  stream = streamA;
   73|   493k|  return this;
   74|   493k|}
_ZN6Object4copyEPS_:
   76|   167M|Object *Object::copy(Object *obj) {
   77|   167M|  *obj = *this;
   78|   167M|  switch (type) {
   79|   709k|  case objString:
  ------------------
  |  Branch (79:3): [True: 709k, False: 166M]
  ------------------
   80|   709k|    obj->string = string->copy();
   81|   709k|    break;
   82|  5.49M|  case objName:
  ------------------
  |  Branch (82:3): [True: 5.49M, False: 162M]
  ------------------
   83|  5.49M|    obj->name = copyString(name);
   84|  5.49M|    break;
   85|  1.64M|  case objArray:
  ------------------
  |  Branch (85:3): [True: 1.64M, False: 165M]
  ------------------
   86|  1.64M|    array->incRef();
   87|  1.64M|    break;
   88|  1.75M|  case objDict:
  ------------------
  |  Branch (88:3): [True: 1.75M, False: 165M]
  ------------------
   89|  1.75M|    dict->incRef();
   90|  1.75M|    break;
   91|   861k|  case objStream:
  ------------------
  |  Branch (91:3): [True: 861k, False: 166M]
  ------------------
   92|   861k|    obj->stream = stream->copy();
   93|   861k|    break;
   94|  21.2M|  case objCmd:
  ------------------
  |  Branch (94:3): [True: 21.2M, False: 146M]
  ------------------
   95|  21.2M|    obj->cmd = copyString(cmd);
   96|  21.2M|    break;
   97|   135M|  default:
  ------------------
  |  Branch (97:3): [True: 135M, False: 31.6M]
  ------------------
   98|   135M|    break;
   99|   167M|  }
  100|       |#ifdef DEBUG_OBJECT_MEM
  101|       |#if MULTITHREADED
  102|       |  gAtomicIncrement(&numAlloc[type]);
  103|       |#else
  104|       |  ++numAlloc[type];
  105|       |#endif
  106|       |#endif
  107|   167M|  return obj;
  108|   167M|}
_ZN6Object5fetchEP4XRefPS_i:
  110|  6.13M|Object *Object::fetch(XRef *xref, Object *obj, int recursion) {
  111|  6.13M|  return (type == objRef && xref) ?
  ------------------
  |  Branch (111:11): [True: 1.50M, False: 4.62M]
  |  Branch (111:29): [True: 1.50M, False: 4]
  ------------------
  112|  4.62M|         xref->fetch(ref.num, ref.gen, obj, recursion) : copy(obj);
  113|  6.13M|}
_ZN6Object4freeEv:
  115|   404M|void Object::free() {
  116|   404M|  switch (type) {
  117|  1.70M|  case objString:
  ------------------
  |  Branch (117:3): [True: 1.70M, False: 403M]
  ------------------
  118|  1.70M|    delete string;
  119|  1.70M|    break;
  120|  12.2M|  case objName:
  ------------------
  |  Branch (120:3): [True: 12.2M, False: 392M]
  ------------------
  121|  12.2M|    gfree(name);
  122|  12.2M|    break;
  123|  2.36M|  case objArray:
  ------------------
  |  Branch (123:3): [True: 2.36M, False: 402M]
  ------------------
  124|  2.36M|    if (!array->decRef()) {
  ------------------
  |  Branch (124:9): [True: 715k, False: 1.64M]
  ------------------
  125|   715k|      delete array;
  126|   715k|    }
  127|  2.36M|    break;
  128|  2.38M|  case objDict:
  ------------------
  |  Branch (128:3): [True: 2.38M, False: 402M]
  ------------------
  129|  2.38M|    if (!dict->decRef()) {
  ------------------
  |  Branch (129:9): [True: 624k, False: 1.75M]
  ------------------
  130|   624k|      delete dict;
  131|   624k|    }
  132|  2.38M|    break;
  133|  1.35M|  case objStream:
  ------------------
  |  Branch (133:3): [True: 1.35M, False: 403M]
  ------------------
  134|  1.35M|    delete stream;
  135|  1.35M|    break;
  136|  49.8M|  case objCmd:
  ------------------
  |  Branch (136:3): [True: 49.8M, False: 355M]
  ------------------
  137|  49.8M|    gfree(cmd);
  138|  49.8M|    break;
  139|   335M|  default:
  ------------------
  |  Branch (139:3): [True: 335M, False: 69.9M]
  ------------------
  140|   335M|    break;
  141|   404M|  }
  142|       |#ifdef DEBUG_OBJECT_MEM
  143|       |#if MULTITHREADED
  144|       |  gAtomicDecrement(&numAlloc[type]);
  145|       |#else
  146|       |  --numAlloc[type];
  147|       |#endif
  148|       |#endif
  149|   404M|  type = objNone;
  150|   404M|}
_ZN6Object11getTypeNameEv:
  152|   727k|const char *Object::getTypeName() {
  153|   727k|  return objTypeNames[type];
  154|   727k|}

_ZN6ObjectC2Ev:
   85|   396M|    type(objNone) {}
_ZN6Object8initNullEv:
   99|  58.3M|    { initObj(objNull); return this; }
  ------------------
  |  |   77|  58.3M|#define initObj(t) type = t
  ------------------
_ZN6Object8isStreamEv:
  134|  53.7M|  GBool isStream() { return type == objStream; }
_ZN6Object9getStreamEv:
  158|   749k|  Stream *getStream() { return stream; }
_ZN6Object8initBoolEi:
   89|  72.3k|    { initObj(objBool); booln = boolnA; return this; }
  ------------------
  |  |   77|  72.3k|#define initObj(t) type = t
  ------------------
_ZN6Object7initIntEi:
   91|  10.9M|    { initObj(objInt); intg = intgA; return this; }
  ------------------
  |  |   77|  10.9M|#define initObj(t) type = t
  ------------------
_ZN6Object8initRealEd:
   93|   549k|    { initObj(objReal); real = realA; return this; }
  ------------------
  |  |   77|   549k|#define initObj(t) type = t
  ------------------
_ZN6Object10initStringEP7GString:
   95|   998k|    { initObj(objString); string = stringA; return this; }
  ------------------
  |  |   77|   998k|#define initObj(t) type = t
  ------------------
_ZN6Object8initNameEPKc:
   97|  6.80M|    { initObj(objName); name = copyString(nameA); return this; }
  ------------------
  |  |   77|  6.80M|#define initObj(t) type = t
  ------------------
_ZN6Object7initRefEii:
  105|   720k|    { initObj(objRef); ref.num = numA; ref.gen = genA; return this; }
  ------------------
  |  |   77|   720k|#define initObj(t) type = t
  ------------------
_ZN6Object7initCmdEPc:
  107|  28.6M|    { initObj(objCmd); cmd = copyString(cmdA); return this; }
  ------------------
  |  |   77|  28.6M|#define initObj(t) type = t
  ------------------
_ZN6Object9initErrorEv:
  109|  2.34M|    { initObj(objError); return this; }
  ------------------
  |  |   77|  2.34M|#define initObj(t) type = t
  ------------------
_ZN6Object7initEOFEv:
  111|   125M|    { initObj(objEOF); return this; }
  ------------------
  |  |   77|   125M|#define initObj(t) type = t
  ------------------
_ZN6Object6isBoolEv:
  125|  16.1k|  GBool isBool() { return type == objBool; }
_ZN6Object5isIntEv:
  126|   222M|  GBool isInt() { return type == objInt; }
_ZN6Object5isNumEv:
  128|   188k|  GBool isNum() { return type == objInt || type == objReal; }
  ------------------
  |  Branch (128:26): [True: 24.7k, False: 163k]
  |  Branch (128:44): [True: 10.4k, False: 152k]
  ------------------
_ZN6Object8isStringEv:
  129|   147M|  GBool isString() { return type == objString; }
_ZN6Object6isNameEv:
  130|  16.4M|  GBool isName() { return type == objName; }
_ZN6Object6isNullEv:
  131|   564k|  GBool isNull() { return type == objNull; }
_ZN6Object7isArrayEv:
  132|  4.60M|  GBool isArray() { return type == objArray; }
_ZN6Object6isDictEv:
  133|  1.94M|  GBool isDict() { return type == objDict; }
_ZN6Object5isRefEv:
  135|  13.1M|  GBool isRef() { return type == objRef; }
_ZN6Object7isErrorEv:
  137|  2.71M|  GBool isError() { return type == objError; }
_ZN6Object5isEOFEv:
  138|  41.2M|  GBool isEOF() { return type == objEOF; }
_ZN6Object6isNoneEv:
  139|  2.08G|  GBool isNone() { return type == objNone; }
_ZN6Object6isNameEPKc:
  143|   696k|    { return type == objName && !strcmp(name, nameA); }
  ------------------
  |  Branch (143:14): [True: 554k, False: 141k]
  |  Branch (143:33): [True: 257k, False: 296k]
  ------------------
_ZN6Object5isCmdEPKc:
  147|   233M|    { return type == objCmd && !strcmp(cmd, cmdA); }
  ------------------
  |  Branch (147:14): [True: 63.2M, False: 169M]
  |  Branch (147:32): [True: 3.24M, False: 60.0M]
  ------------------
_ZN6Object7getBoolEv:
  150|  2.61k|  GBool getBool() { return booln; }
_ZN6Object6getIntEv:
  151|  6.29M|  int getInt() { return intg; }
_ZN6Object6getNumEv:
  153|  35.3k|  double getNum() { return type == objInt ? (double)intg : real; }
  ------------------
  |  Branch (153:28): [True: 24.7k, False: 10.5k]
  ------------------
_ZN6Object9getStringEv:
  154|   135k|  GString *getString() { return string; }
_ZN6Object7getNameEv:
  155|  2.79M|  char *getName() { return name; }
_ZN6Object8getArrayEv:
  156|    402|  Array *getArray() { return array; }
_ZN6Object7getDictEv:
  157|  1.05M|  Dict *getDict() { return dict; }
_ZN6Object6getRefEv:
  159|   262k|  Ref getRef() { return ref; }
_ZN6Object9getRefNumEv:
  160|  2.15M|  int getRefNum() { return ref.num; }
_ZN6Object9getRefGenEv:
  161|  1.34M|  int getRefGen() { return ref.gen; }
_ZN6Object14arrayGetLengthEv:
  233|  13.7M|  { return array->getLength(); }
_ZN6Object8arrayAddEPS_:
  236|  20.4M|  { array->add(elem); }
_ZN6Object8arrayGetEiPS_i:
  239|   667k|  { return array->get(i, obj, recursion); }
_ZN6Object10arrayGetNFEiPS_:
  242|  12.3M|  { return array->getNF(i, obj); }
_ZN6Object7dictAddEPcPS_:
  254|  2.66M|  { dict->add(key, val); }
_ZN6Object10dictLookupEPKcPS_i:
  263|   945k|  { return dict->lookup(key, obj, recursion); }
_ZN6Object12dictLookupNFEPKcPS_:
  266|  64.2k|  { return dict->lookupNF(key, obj); }
_ZN6Object11streamResetEv:
  290|   408k|  { stream->reset(); }
_ZN6Object11streamCloseEv:
  293|   402k|  { stream->close(); }
_ZN6Object13streamGetCharEv:
  296|  1.62G|  { return stream->getChar(); }
_ZN6Object14streamLookCharEv:
  299|   280M|  { return stream->lookChar(); }
_ZN6Object12streamGetPosEv:
  308|  51.3M|  { return stream->getPos(); }
_ZN6Object12streamSetPosEli:
  311|  88.5k|  { stream->setPos(pos, dir); }
_ZN6Object13streamGetDictEv:
  314|   708k|  { return stream->getDict(); }

_ZN15OptionalContentC2EP6PDFDoc:
   39|  2.92k|OptionalContent::OptionalContent(PDFDoc *doc) {
   40|  2.92k|  Object *ocProps;
   41|  2.92k|  Object ocgList, defView, uad, obj1, obj2, obj3, obj4;
   42|  2.92k|  Ref ref1;
   43|  2.92k|  OptionalContentGroup *ocg;
   44|  2.92k|  int i, j;
   45|       |
   46|  2.92k|  xref = doc->getXRef();
   47|  2.92k|  ocgs = new GList();
   48|  2.92k|  display = NULL;
   49|       |
   50|  2.92k|  if ((ocProps = doc->getCatalog()->getOCProperties())->isDict()) {
  ------------------
  |  Branch (50:7): [True: 512, False: 2.41k]
  ------------------
   51|    512|    if (ocProps->dictLookup("OCGs", &ocgList)->isArray()) {
  ------------------
  |  Branch (51:9): [True: 470, False: 42]
  ------------------
   52|       |
   53|       |      //----- read the OCG list
   54|  19.2k|      for (i = 0; i < ocgList.arrayGetLength(); ++i) {
  ------------------
  |  Branch (54:19): [True: 18.8k, False: 470]
  ------------------
   55|  18.8k|	if (ocgList.arrayGetNF(i, &obj1)->isRef()) {
  ------------------
  |  Branch (55:6): [True: 3.97k, False: 14.8k]
  ------------------
   56|  3.97k|	  ref1 = obj1.getRef();
   57|  3.97k|	  obj1.fetch(xref, &obj2);
   58|  3.97k|	  if ((ocg = OptionalContentGroup::parse(&ref1, &obj2))) {
  ------------------
  |  Branch (58:8): [True: 2.12k, False: 1.85k]
  ------------------
   59|  2.12k|	    ocgs->append(ocg);
   60|  2.12k|	  }
   61|  3.97k|	  obj2.free();
   62|  3.97k|	}
   63|  18.8k|	obj1.free();
   64|  18.8k|      }
   65|       |
   66|       |      //----- read the default viewing OCCD
   67|    470|      if (ocProps->dictLookup("D", &defView)->isDict()) {
  ------------------
  |  Branch (67:11): [True: 304, False: 166]
  ------------------
   68|       |
   69|       |	//----- read the usage app dicts
   70|    304|	if (defView.dictLookup("AS", &obj1)->isArray()) {
  ------------------
  |  Branch (70:6): [True: 45, False: 259]
  ------------------
   71|  2.13k|	  for (i = 0; i < obj1.arrayGetLength(); ++i) {
  ------------------
  |  Branch (71:16): [True: 2.09k, False: 45]
  ------------------
   72|  2.09k|	    if (obj1.arrayGet(i, &uad)->isDict()) {
  ------------------
  |  Branch (72:10): [True: 172, False: 1.92k]
  ------------------
   73|    172|	      if (uad.dictLookup("Event", &obj2)->isName("View")) {
  ------------------
  |  Branch (73:12): [True: 35, False: 137]
  ------------------
   74|     35|		if (uad.dictLookup("OCGs", &obj3)->isArray()) {
  ------------------
  |  Branch (74:7): [True: 31, False: 4]
  ------------------
   75|    354|		  for (j = 0; j < obj3.arrayGetLength(); ++j) {
  ------------------
  |  Branch (75:17): [True: 323, False: 31]
  ------------------
   76|    323|		    if (obj3.arrayGetNF(j, &obj4)->isRef()) {
  ------------------
  |  Branch (76:11): [True: 91, False: 232]
  ------------------
   77|     91|		      ref1 = obj4.getRef();
   78|     91|		      if ((ocg = findOCG(&ref1))) {
  ------------------
  |  Branch (78:13): [True: 46, False: 45]
  ------------------
   79|     46|			ocg->setInViewUsageAppDict();
   80|     46|		      }
   81|     91|		    }
   82|    323|		    obj4.free();
   83|    323|		  }
   84|     31|		}
   85|     35|		obj3.free();
   86|     35|	      }
   87|    172|	      obj2.free();
   88|    172|	    }
   89|  2.09k|	    uad.free();
   90|  2.09k|	  }
   91|     45|	}
   92|    304|	obj1.free();
   93|       |
   94|       |	//----- initial state from OCCD
   95|    304|	if (defView.dictLookup("OFF", &obj1)->isArray()) {
  ------------------
  |  Branch (95:6): [True: 37, False: 267]
  ------------------
   96|  2.13k|	  for (i = 0; i < obj1.arrayGetLength(); ++i) {
  ------------------
  |  Branch (96:16): [True: 2.09k, False: 37]
  ------------------
   97|  2.09k|	    if (obj1.arrayGetNF(i, &obj2)->isRef()) {
  ------------------
  |  Branch (97:10): [True: 951, False: 1.14k]
  ------------------
   98|    951|	      ref1 = obj2.getRef();
   99|    951|	      if ((ocg = findOCG(&ref1))) {
  ------------------
  |  Branch (99:12): [True: 314, False: 637]
  ------------------
  100|    314|		ocg->setState(gFalse);
  ------------------
  |  |   18|    314|#define gFalse 0
  ------------------
  101|    637|	      } else {
  102|    637|		error(errSyntaxError, -1,
  103|    637|		      "Invalid OCG reference in OFF array in default viewing OCCD");
  104|    637|	      }
  105|    951|	    }
  106|  2.09k|	    obj2.free();
  107|  2.09k|	  }
  108|     37|	}
  109|    304|	obj1.free();
  110|       |
  111|       |	//----- initial state from OCG usage dict
  112|    704|	for (i = 0; i < ocgs->getLength(); ++i) {
  ------------------
  |  Branch (112:14): [True: 400, False: 304]
  ------------------
  113|    400|	  ocg = (OptionalContentGroup *)ocgs->get(i);
  114|    400|	  if (ocg->getInViewUsageAppDict() &&
  ------------------
  |  Branch (114:8): [True: 39, False: 361]
  ------------------
  115|     39|	      ocg->getViewState() != ocUsageUnset) {
  ------------------
  |  Branch (115:8): [True: 0, False: 39]
  ------------------
  116|      0|	    ocg->setState(ocg->getViewState() == ocUsageOn);
  117|      0|	  }
  118|    400|	}
  119|       |
  120|       |	//----- display order
  121|    304|	if (defView.dictLookup("Order", &obj1)->isArray()) {
  ------------------
  |  Branch (121:6): [True: 257, False: 47]
  ------------------
  122|    257|	  display = OCDisplayNode::parse(&obj1, this, xref);
  123|    257|	}
  124|    304|	obj1.free();
  125|       |
  126|    304|      } else {
  127|    166|	error(errSyntaxError, -1, "Missing or invalid default viewing OCCD");
  128|    166|      }
  129|    470|      defView.free();
  130|       |
  131|    470|    }
  132|    512|    ocgList.free();
  133|    512|  }
  134|       |
  135|  2.92k|  if (!display) {
  ------------------
  |  Branch (135:7): [True: 2.66k, False: 257]
  ------------------
  136|  2.66k|    display = new OCDisplayNode();
  137|  2.66k|  }
  138|  2.92k|}
_ZN15OptionalContentD2Ev:
  140|  2.92k|OptionalContent::~OptionalContent() {
  141|  2.92k|  deleteGList(ocgs, OptionalContentGroup);
  ------------------
  |  |   94|  2.92k|  do {                                              \
  |  |   95|  2.92k|    GList *_list = (list);                          \
  |  |   96|  2.92k|    {                                               \
  |  |   97|  2.92k|      int _i;                                       \
  |  |   98|  5.04k|      for (_i = 0; _i < _list->getLength(); ++_i) { \
  |  |  ------------------
  |  |  |  Branch (98:20): [True: 2.12k, False: 2.92k]
  |  |  ------------------
  |  |   99|  2.12k|        delete (T*)_list->get(_i);                  \
  |  |  100|  2.12k|      }                                             \
  |  |  101|  2.92k|      delete _list;                                 \
  |  |  102|  2.92k|    }                                               \
  |  |  103|  2.92k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (103:12): [Folded, False: 2.92k]
  |  |  ------------------
  ------------------
  142|  2.92k|  delete display;
  143|  2.92k|}
_ZN15OptionalContent7findOCGEP3Ref:
  153|   214k|OptionalContentGroup *OptionalContent::findOCG(Ref *ref) {
  154|   214k|  OptionalContentGroup *ocg;
  155|   214k|  int i;
  156|       |
  157|   506k|  for (i = 0; i < ocgs->getLength(); ++i) {
  ------------------
  |  Branch (157:15): [True: 300k, False: 206k]
  ------------------
  158|   300k|    ocg = (OptionalContentGroup *)ocgs->get(i);
  159|   300k|    if (ocg->matches(ref)) {
  ------------------
  |  Branch (159:9): [True: 8.69k, False: 291k]
  ------------------
  160|  8.69k|      return ocg;
  161|  8.69k|    }
  162|   300k|  }
  163|   206k|  return NULL;
  164|   214k|}
_ZN20OptionalContentGroup5parseEP3RefP6Object:
  328|  3.97k|OptionalContentGroup *OptionalContentGroup::parse(Ref *refA, Object *obj) {
  329|  3.97k|  TextString *nameA;
  330|  3.97k|  Object obj1, obj2, obj3;
  331|  3.97k|  OCUsageState viewStateA, printStateA;
  332|       |
  333|  3.97k|  if (!obj->isDict()) {
  ------------------
  |  Branch (333:7): [True: 1.39k, False: 2.57k]
  ------------------
  334|  1.39k|    return NULL;
  335|  1.39k|  }
  336|  2.57k|  if (!obj->dictLookup("Name", &obj1)->isString()) {
  ------------------
  |  Branch (336:7): [True: 456, False: 2.12k]
  ------------------
  337|    456|    error(errSyntaxError, -1, "Missing or invalid Name in OCG");
  338|    456|    obj1.free();
  339|    456|    return NULL;
  340|    456|  }
  341|  2.12k|  nameA = new TextString(obj1.getString());
  342|  2.12k|  obj1.free();
  343|       |
  344|  2.12k|  viewStateA = printStateA = ocUsageUnset;
  345|  2.12k|  if (obj->dictLookup("Usage", &obj1)->isDict()) {
  ------------------
  |  Branch (345:7): [True: 51, False: 2.07k]
  ------------------
  346|     51|    if (obj1.dictLookup("View", &obj2)->isDict()) {
  ------------------
  |  Branch (346:9): [True: 11, False: 40]
  ------------------
  347|     11|      if (obj2.dictLookup("ViewState", &obj3)->isName()) {
  ------------------
  |  Branch (347:11): [True: 6, False: 5]
  ------------------
  348|      6|	if (obj3.isName("ON")) {
  ------------------
  |  Branch (348:6): [True: 3, False: 3]
  ------------------
  349|      3|	  viewStateA = ocUsageOn;
  350|      3|	} else {
  351|      3|	  viewStateA = ocUsageOff;
  352|      3|	}
  353|      6|      }
  354|     11|      obj3.free();
  355|     11|    }
  356|     51|    obj2.free();
  357|     51|    if (obj1.dictLookup("Print", &obj2)->isDict()) {
  ------------------
  |  Branch (357:9): [True: 11, False: 40]
  ------------------
  358|     11|      if (obj2.dictLookup("PrintState", &obj3)->isName()) {
  ------------------
  |  Branch (358:11): [True: 8, False: 3]
  ------------------
  359|      8|	if (obj3.isName("ON")) {
  ------------------
  |  Branch (359:6): [True: 3, False: 5]
  ------------------
  360|      3|	  printStateA = ocUsageOn;
  361|      5|	} else {
  362|      5|	  printStateA = ocUsageOff;
  363|      5|	}
  364|      8|      }
  365|     11|      obj3.free();
  366|     11|    }
  367|     51|    obj2.free();
  368|     51|  }
  369|  2.12k|  obj1.free();
  370|       |
  371|  2.12k|  return new OptionalContentGroup(refA, nameA, viewStateA, printStateA);
  372|  2.57k|}
_ZN20OptionalContentGroupC2EP3RefP10TextString12OCUsageStateS4_:
  376|  2.12k|					   OCUsageState printStateA) {
  377|  2.12k|  ref = *refA;
  378|  2.12k|  name = nameA;
  379|  2.12k|  viewState = viewStateA;
  380|  2.12k|  printState = printStateA;
  381|  2.12k|  state = gTrue;
  ------------------
  |  |   17|  2.12k|#define gTrue 1
  ------------------
  382|  2.12k|  inViewUsageAppDict = gFalse;
  ------------------
  |  |   18|  2.12k|#define gFalse 0
  ------------------
  383|  2.12k|}
_ZN20OptionalContentGroupD2Ev:
  385|  2.12k|OptionalContentGroup::~OptionalContentGroup() {
  386|  2.12k|  delete name;
  387|  2.12k|}
_ZN20OptionalContentGroup7matchesEP3Ref:
  389|   300k|GBool OptionalContentGroup::matches(Ref *refA) {
  390|   300k|  return refA->num == ref.num && refA->gen == ref.gen;
  ------------------
  |  Branch (390:10): [True: 44.1k, False: 256k]
  |  Branch (390:34): [True: 8.69k, False: 35.4k]
  ------------------
  391|   300k|}
_ZN13OCDisplayNode5parseEP6ObjectP15OptionalContentP4XRefi:
  404|  3.53M|				    XRef *xref, int recursion) {
  405|  3.53M|  Object obj2, obj3;
  406|  3.53M|  Ref ref;
  407|  3.53M|  OptionalContentGroup *ocgA;
  408|  3.53M|  OCDisplayNode *node, *child;
  409|  3.53M|  int i;
  410|       |
  411|  3.53M|  if (recursion > displayNodeRecursionLimit) {
  ------------------
  |  |   35|  3.53M|#define displayNodeRecursionLimit 50
  ------------------
  |  Branch (411:7): [True: 580k, False: 2.95M]
  ------------------
  412|   580k|    error(errSyntaxError, -1, "Loop detected in optional content order");
  413|   580k|    return NULL;
  414|   580k|  }
  415|  2.95M|  if (obj->isRef()) {
  ------------------
  |  Branch (415:7): [True: 213k, False: 2.73M]
  ------------------
  416|   213k|    ref = obj->getRef();
  417|   213k|    if ((ocgA = oc->findOCG(&ref))) {
  ------------------
  |  Branch (417:9): [True: 8.33k, False: 205k]
  ------------------
  418|  8.33k|      return new OCDisplayNode(ocgA);
  419|  8.33k|    }
  420|   213k|  }
  421|  2.94M|  obj->fetch(xref, &obj2);
  422|  2.94M|  if (!obj2.isArray()) {
  ------------------
  |  Branch (422:7): [True: 2.36M, False: 572k]
  ------------------
  423|  2.36M|    obj2.free();
  424|  2.36M|    return NULL;
  425|  2.36M|  }
  426|   572k|  i = 0;
  427|   572k|  if (obj2.arrayGetLength() >= 1) {
  ------------------
  |  Branch (427:7): [True: 570k, False: 1.96k]
  ------------------
  428|   570k|    if (obj2.arrayGet(0, &obj3)->isString()) {
  ------------------
  |  Branch (428:9): [True: 61.6k, False: 509k]
  ------------------
  429|  61.6k|      node = new OCDisplayNode(obj3.getString());
  430|  61.6k|      i = 1;
  431|   509k|    } else {
  432|   509k|      node = new OCDisplayNode();
  433|   509k|    }
  434|   570k|    obj3.free();
  435|   570k|  } else {
  436|  1.96k|    node = new OCDisplayNode();
  437|  1.96k|  }
  438|  4.10M|  for (; i < obj2.arrayGetLength(); ++i) {
  ------------------
  |  Branch (438:10): [True: 3.53M, False: 572k]
  ------------------
  439|  3.53M|    obj2.arrayGetNF(i, &obj3);
  440|  3.53M|    if ((child = OCDisplayNode::parse(&obj3, oc, xref, recursion + 1))) {
  ------------------
  |  Branch (440:9): [True: 580k, False: 2.94M]
  ------------------
  441|   580k|      if (!child->ocg && !child->name && node->getNumChildren() > 0) {
  ------------------
  |  Branch (441:11): [True: 572k, False: 8.33k]
  |  Branch (441:26): [True: 0, False: 572k]
  |  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|   580k|      } else {
  448|   580k|	node->addChild(child);
  449|   580k|      }
  450|   580k|    }
  451|  3.53M|    obj3.free();
  452|  3.53M|  }
  453|   572k|  obj2.free();
  454|   572k|  return node;
  455|  2.94M|}
_ZN13OCDisplayNodeC2Ev:
  457|   513k|OCDisplayNode::OCDisplayNode() {
  458|   513k|  name = new TextString();
  459|   513k|  ocg = NULL;
  460|   513k|  parent = NULL;
  461|       |  children = NULL;
  462|   513k|}
_ZN13OCDisplayNodeC2EP7GString:
  464|  61.6k|OCDisplayNode::OCDisplayNode(GString *nameA) {
  465|  61.6k|  name = new TextString(nameA);
  466|  61.6k|  ocg = NULL;
  467|       |  children = NULL;
  468|  61.6k|}
_ZN13OCDisplayNodeC2EP20OptionalContentGroup:
  470|  8.33k|OCDisplayNode::OCDisplayNode(OptionalContentGroup *ocgA) {
  471|  8.33k|  name = new TextString(ocgA->name);
  472|  8.33k|  ocg = ocgA;
  473|       |  children = NULL;
  474|  8.33k|}
_ZN13OCDisplayNode8addChildEPS_:
  476|   580k|void OCDisplayNode::addChild(OCDisplayNode *child) {
  477|   580k|  if (!children) {
  ------------------
  |  Branch (477:7): [True: 403k, False: 176k]
  ------------------
  478|   403k|    children = new GList();
  479|   403k|  }
  480|   580k|  children->append(child);
  481|   580k|  child->parent = this;
  482|   580k|}
_ZN13OCDisplayNodeD2Ev:
  509|   583k|OCDisplayNode::~OCDisplayNode() {
  510|   583k|  delete name;
  511|   583k|  if (children) {
  ------------------
  |  Branch (511:7): [True: 403k, False: 179k]
  ------------------
  512|   403k|    deleteGList(children, OCDisplayNode);
  ------------------
  |  |   94|   403k|  do {                                              \
  |  |   95|   403k|    GList *_list = (list);                          \
  |  |   96|   403k|    {                                               \
  |  |   97|   403k|      int _i;                                       \
  |  |   98|   984k|      for (_i = 0; _i < _list->getLength(); ++_i) { \
  |  |  ------------------
  |  |  |  Branch (98:20): [True: 580k, False: 403k]
  |  |  ------------------
  |  |   99|   580k|        delete (T*)_list->get(_i);                  \
  |  |  100|   580k|      }                                             \
  |  |  101|   403k|      delete _list;                                 \
  |  |  102|   403k|    }                                               \
  |  |  103|   403k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (103:12): [Folded, False: 403k]
  |  |  ------------------
  ------------------
  513|   403k|  }
  514|   583k|}

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

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

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

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

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

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

_ZN6ParserC2EP4XRefP5Lexeri:
   22|   392k|Parser::Parser(XRef *xrefA, Lexer *lexerA, GBool allowStreamsA) {
   23|   392k|  xref = xrefA;
   24|   392k|  lexer = lexerA;
   25|   392k|  inlineImg = 0;
   26|   392k|  allowStreams = allowStreamsA;
   27|   392k|  lexer->getObj(&buf1);
   28|   392k|  lexer->getObj(&buf2);
   29|   392k|}
_ZN6ParserD2Ev:
   31|   392k|Parser::~Parser() {
   32|   392k|  buf1.free();
   33|   392k|  buf2.free();
   34|   392k|  delete lexer;
   35|   392k|}
_ZN6Parser6getObjEP6ObjectiPh14CryptAlgorithmiiii:
   40|   152M|		       int objNum, int objGen, int recursion) {
   41|   152M|  char *key;
   42|   152M|  Stream *str;
   43|   152M|  Object obj2;
   44|   152M|  int num;
   45|   152M|  DecryptStream *decrypt;
   46|   152M|  GString *s, *s2;
   47|   152M|  int c;
   48|       |
   49|       |  // refill buffer after inline image data
   50|   152M|  if (inlineImg == 2) {
  ------------------
  |  Branch (50:7): [True: 56.7k, False: 152M]
  ------------------
   51|  56.7k|    buf1.free();
   52|  56.7k|    buf2.free();
   53|  56.7k|    lexer->getObj(&buf1);
   54|  56.7k|    lexer->getObj(&buf2);
   55|  56.7k|    inlineImg = 0;
   56|  56.7k|  }
   57|       |
   58|       |  // array
   59|   152M|  if (!simpleOnly && recursion < objectRecursionLimit && buf1.isCmd("[")) {
  ------------------
  |  |   20|   176M|#define objectRecursionLimit 500
  ------------------
  |  Branch (59:7): [True: 23.2M, False: 129M]
  |  Branch (59:22): [True: 11.0M, False: 12.2M]
  |  Branch (59:58): [True: 715k, False: 10.3M]
  ------------------
   60|   715k|    shift();
   61|   715k|    obj->initArray(xref);
   62|  21.1M|    while (!buf1.isCmd("]") && !buf1.isEOF())
  ------------------
  |  Branch (62:12): [True: 20.8M, False: 308k]
  |  Branch (62:32): [True: 20.4M, False: 406k]
  ------------------
   63|  20.4M|      obj->arrayAdd(getObj(&obj2, gFalse, fileKey, encAlgorithm, keyLength,
  ------------------
  |  |   18|  20.4M|#define gFalse 0
  ------------------
   64|  20.4M|			   objNum, objGen, recursion + 1));
   65|   715k|    if (buf1.isEOF())
  ------------------
  |  Branch (65:9): [True: 406k, False: 308k]
  ------------------
   66|   406k|      error(errSyntaxError, getPos(), "End of file inside array");
   67|   715k|    shift();
   68|       |
   69|       |  // dictionary or stream
   70|   152M|  } else if (!simpleOnly && recursion < objectRecursionLimit &&
  ------------------
  |  |   20|   174M|#define objectRecursionLimit 500
  ------------------
  |  Branch (70:14): [True: 22.5M, False: 129M]
  |  Branch (70:29): [True: 10.3M, False: 12.2M]
  ------------------
   71|  10.3M|	     buf1.isCmd("<<")) {
  ------------------
  |  Branch (71:7): [True: 618k, False: 9.72M]
  ------------------
   72|   618k|    shift();
   73|   618k|    obj->initDict(xref);
   74|  16.9M|    while (!buf1.isCmd(">>") && !buf1.isEOF()) {
  ------------------
  |  Branch (74:12): [True: 16.3M, False: 534k]
  |  Branch (74:33): [True: 16.3M, False: 40.2k]
  ------------------
   75|  16.3M|      if (!buf1.isName()) {
  ------------------
  |  Branch (75:11): [True: 13.6M, False: 2.71M]
  ------------------
   76|  13.6M|	error(errSyntaxError, getPos(),
   77|  13.6M|	      "Dictionary key must be a name object");
   78|  13.6M|	shift();
   79|  13.6M|      } else {
   80|  2.71M|	key = copyString(buf1.getName());
   81|  2.71M|	shift();
   82|  2.71M|	if (buf1.isEOF() || buf1.isError()) {
  ------------------
  |  Branch (82:6): [True: 2.66k, False: 2.71M]
  |  Branch (82:22): [True: 41.4k, False: 2.66M]
  ------------------
   83|  44.1k|	  gfree(key);
   84|  44.1k|	  break;
   85|  44.1k|	}
   86|  2.66M|	obj->dictAdd(key, getObj(&obj2, gFalse,
  ------------------
  |  |   18|  2.66M|#define gFalse 0
  ------------------
   87|  2.66M|				 fileKey, encAlgorithm, keyLength,
   88|  2.66M|				 objNum, objGen, recursion + 1));
   89|  2.66M|      }
   90|  16.3M|    }
   91|   618k|    if (buf1.isEOF())
  ------------------
  |  Branch (91:9): [True: 42.9k, False: 575k]
  ------------------
   92|  42.9k|      error(errSyntaxError, getPos(), "End of file inside dictionary");
   93|       |    // stream objects are not allowed inside content streams or
   94|       |    // object streams
   95|   618k|    if (allowStreams && buf2.isCmd("stream")) {
  ------------------
  |  Branch (95:9): [True: 369k, False: 249k]
  |  Branch (95:25): [True: 108k, False: 260k]
  ------------------
   96|   108k|      if ((str = makeStream(obj, fileKey, encAlgorithm, keyLength,
  ------------------
  |  Branch (96:11): [True: 100k, False: 7.65k]
  ------------------
   97|   108k|			    objNum, objGen, recursion + 1))) {
   98|   100k|	obj->initStream(str);
   99|   100k|      } else {
  100|  7.65k|	obj->free();
  101|  7.65k|	obj->initError();
  102|  7.65k|      }
  103|   510k|    } else {
  104|   510k|      shift();
  105|   510k|    }
  106|       |
  107|       |  // indirect reference or integer
  108|   151M|  } else if (buf1.isInt()) {
  ------------------
  |  Branch (108:14): [True: 4.67M, False: 146M]
  ------------------
  109|  4.67M|    num = buf1.getInt();
  110|  4.67M|    shift();
  111|  4.67M|    if (buf1.isInt() && buf2.isCmd("R")) {
  ------------------
  |  Branch (111:9): [True: 2.00M, False: 2.66M]
  |  Branch (111:25): [True: 572k, False: 1.43M]
  ------------------
  112|   572k|      int gen = buf1.getInt();
  113|   572k|      if (num >= 0 && gen >= 0) {
  ------------------
  |  Branch (113:11): [True: 569k, False: 2.45k]
  |  Branch (113:23): [True: 568k, False: 873]
  ------------------
  114|   568k|	obj->initRef(num, gen);
  115|   568k|      } else {
  116|  3.32k|	error(errSyntaxError, getPos(),
  117|  3.32k|	      "Negative number or generation in indirect reference");
  118|  3.32k|	obj->initError();
  119|  3.32k|      }
  120|   572k|      shift();
  121|   572k|      shift();
  122|  4.10M|    } else {
  123|  4.10M|      obj->initInt(num);
  124|  4.10M|    }
  125|       |
  126|       |  // string
  127|   146M|  } else if (buf1.isString() && fileKey) {
  ------------------
  |  Branch (127:14): [True: 523k, False: 146M]
  |  Branch (127:33): [True: 31.3k, False: 491k]
  ------------------
  128|  31.3k|    s = buf1.getString();
  129|  31.3k|    s2 = new GString();
  130|  31.3k|    obj2.initNull();
  131|  31.3k|    decrypt = new DecryptStream(new MemStream(s->getCString(), 0,
  132|  31.3k|					      s->getLength(), &obj2),
  133|  31.3k|				fileKey, encAlgorithm, keyLength,
  134|  31.3k|				objNum, objGen);
  135|  31.3k|    decrypt->reset();
  136|  1.33M|    while ((c = decrypt->getChar()) != EOF) {
  ------------------
  |  Branch (136:12): [True: 1.30M, False: 31.3k]
  ------------------
  137|  1.30M|      s2->append((char)c);
  138|  1.30M|    }
  139|  31.3k|    delete decrypt;
  140|  31.3k|    obj->initString(s2);
  141|  31.3k|    shift();
  142|       |
  143|       |  // simple object
  144|   146M|  } else {
  145|   146M|    buf1.copy(obj);
  146|   146M|    shift();
  147|   146M|  }
  148|       |
  149|   152M|  return obj;
  150|   152M|}
_ZN6Parser10makeStreamEP6ObjectPh14CryptAlgorithmiiii:
  154|   108k|			   int objNum, int objGen, int recursion) {
  155|       |  // get stream start position
  156|   108k|  lexer->skipToNextLine();
  157|   108k|  Stream *curStr = lexer->getStream();
  158|   108k|  if (!curStr) {
  ------------------
  |  Branch (158:7): [True: 2.63k, False: 105k]
  ------------------
  159|  2.63k|    return NULL;
  160|  2.63k|  }
  161|   105k|  GFileOffset pos = curStr->getPos();
  162|       |
  163|   105k|  GBool haveLength = gFalse;
  ------------------
  |  |   18|   105k|#define gFalse 0
  ------------------
  164|   105k|  GFileOffset length = 0;
  165|   105k|  GFileOffset endPos;
  166|       |
  167|       |  // check for length in damaged file
  168|   105k|  if (xref && xref->getStreamEnd(pos, &endPos)) {
  ------------------
  |  Branch (168:7): [True: 104k, False: 1.32k]
  |  Branch (168:15): [True: 53.3k, False: 51.1k]
  ------------------
  169|  53.3k|    length = endPos - pos;
  170|  53.3k|    haveLength = gTrue;
  ------------------
  |  |   17|  53.3k|#define gTrue 1
  ------------------
  171|       |
  172|       |  // get length from the stream object
  173|  53.3k|  } else {
  174|  52.4k|    Object obj;
  175|  52.4k|    dict->dictLookup("Length", &obj, recursion);
  176|  52.4k|    if (obj.isInt()) {
  ------------------
  |  Branch (176:9): [True: 35.1k, False: 17.3k]
  ------------------
  177|  35.1k|      length = (GFileOffset)(Guint)obj.getInt();
  178|  35.1k|      haveLength = gTrue;
  ------------------
  |  |   17|  35.1k|#define gTrue 1
  ------------------
  179|  35.1k|    } else {
  180|  17.3k|      error(errSyntaxError, getPos(),
  181|  17.3k|	    "Missing or invalid 'Length' attribute in stream");
  182|  17.3k|    }
  183|  52.4k|    obj.free();
  184|  52.4k|  }
  185|       |
  186|       |  // in badly damaged PDF files, we can run off the end of the input
  187|       |  // stream immediately after the "stream" token
  188|   105k|  if (!lexer->getStream()) {
  ------------------
  |  Branch (188:7): [True: 0, False: 105k]
  ------------------
  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|   105k|  BaseStream *baseStr =
  195|   105k|      (BaseStream *)lexer->getStream()->getBaseStream()->copy();
  196|       |
  197|       |  // 'Length' attribute is missing -- search for 'endstream'
  198|   105k|  if (!haveLength) {
  ------------------
  |  Branch (198:7): [True: 17.3k, False: 88.5k]
  ------------------
  199|  17.3k|    GBool foundEndstream = gFalse;
  ------------------
  |  |   18|  17.3k|#define gFalse 0
  ------------------
  200|  17.3k|    char endstreamBuf[8];
  201|  17.3k|    if ((curStr = lexer->getStream())) {
  ------------------
  |  Branch (201:9): [True: 17.3k, False: 0]
  ------------------
  202|  17.3k|      int c;
  203|  9.45M|      while ((c = curStr->getChar()) != EOF) {
  ------------------
  |  Branch (203:14): [True: 9.45M, False: 5.01k]
  ------------------
  204|  9.45M|	if (c == 'e' &&
  ------------------
  |  Branch (204:6): [True: 487k, False: 8.96M]
  ------------------
  205|   487k|	    curStr->getBlock(endstreamBuf, 8) == 8 &&
  ------------------
  |  Branch (205:6): [True: 486k, False: 1.09k]
  ------------------
  206|   486k|	    !memcmp(endstreamBuf, "ndstream", 8)) {
  ------------------
  |  Branch (206:6): [True: 12.3k, False: 473k]
  ------------------
  207|  12.3k|	  length = curStr->getPos() - 9 - pos;
  208|  12.3k|	  foundEndstream = gTrue;
  ------------------
  |  |   17|  12.3k|#define gTrue 1
  ------------------
  209|  12.3k|	  break;
  210|  12.3k|	}
  211|  9.45M|      }
  212|  17.3k|    }
  213|  17.3k|    if (!foundEndstream) {
  ------------------
  |  Branch (213:9): [True: 5.01k, False: 12.3k]
  ------------------
  214|  5.01k|      error(errSyntaxError, getPos(), "Couldn't find 'endstream' for stream");
  215|  5.01k|      delete baseStr;
  216|  5.01k|      return NULL;
  217|  5.01k|    }
  218|  17.3k|  }
  219|       |
  220|       |  // make new base stream
  221|   100k|  Stream *str = baseStr->makeSubStream(pos, gTrue, length, dict);
  ------------------
  |  |   17|   100k|#define gTrue 1
  ------------------
  222|       |
  223|       |  // look for the 'endstream' marker
  224|   100k|  if (haveLength) {
  ------------------
  |  Branch (224:7): [True: 88.5k, False: 12.3k]
  ------------------
  225|       |    // skip over stream data
  226|  88.5k|    lexer->setPos(pos + length);
  227|       |
  228|       |    // check for 'endstream'
  229|       |    // NB: we never reuse the Parser object to parse objects after a
  230|       |    // stream, and we could (if the PDF file is damaged) be in the
  231|       |    // middle of binary data at this point, so we check the stream
  232|       |    // data directly for 'endstream', rather than calling shift() to
  233|       |    // parse objects
  234|  88.5k|    GBool foundEndstream = gFalse;
  ------------------
  |  |   18|  88.5k|#define gFalse 0
  ------------------
  235|  88.5k|    char endstreamBuf[8];
  236|  88.5k|    if ((curStr = lexer->getStream())) {
  ------------------
  |  Branch (236:9): [True: 88.5k, False: 0]
  ------------------
  237|       |      // skip up to 100 whitespace chars
  238|  88.5k|      int c;
  239|   203k|      for (int i = 0; i < 100; ++i) {
  ------------------
  |  Branch (239:23): [True: 202k, False: 1.05k]
  ------------------
  240|   202k|	c = curStr->getChar();
  241|   202k|	if (!Lexer::isSpace(c)) {
  ------------------
  |  Branch (241:6): [True: 87.4k, False: 115k]
  ------------------
  242|  87.4k|	  break;
  243|  87.4k|	}
  244|   202k|      }
  245|  88.5k|      if (c == 'e') {
  ------------------
  |  Branch (245:11): [True: 55.9k, False: 32.5k]
  ------------------
  246|  55.9k|	if (curStr->getBlock(endstreamBuf, 8) == 8 &&
  ------------------
  |  Branch (246:6): [True: 55.8k, False: 125]
  ------------------
  247|  55.8k|	    !memcmp(endstreamBuf, "ndstream", 8)) {
  ------------------
  |  Branch (247:6): [True: 53.5k, False: 2.24k]
  ------------------
  248|  53.5k|	  foundEndstream = gTrue;
  ------------------
  |  |   17|  53.5k|#define gTrue 1
  ------------------
  249|  53.5k|	}
  250|  55.9k|      }
  251|  88.5k|    }
  252|  88.5k|    if (!foundEndstream) {
  ------------------
  |  Branch (252:9): [True: 34.9k, False: 53.5k]
  ------------------
  253|  34.9k|      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|  34.9k|      Object obj;
  258|  34.9k|      dict->copy(&obj);
  259|  34.9k|      delete str;
  260|  34.9k|      length += 5000;
  261|  34.9k|      str = baseStr->makeSubStream(pos, gTrue, length, &obj);
  ------------------
  |  |   17|  34.9k|#define gTrue 1
  ------------------
  262|  34.9k|    }
  263|  88.5k|  }
  264|       |
  265|       |  // free the copied base stream
  266|   100k|  delete baseStr;
  267|       |
  268|       |  // handle decryption
  269|   100k|  if (fileKey) {
  ------------------
  |  Branch (269:7): [True: 4.66k, False: 96.1k]
  ------------------
  270|       |    // the 'Crypt' filter is used to mark unencrypted metadata streams
  271|       |    //~ this should also check for an empty DecodeParams entry
  272|  4.66k|    GBool encrypted = gTrue;
  ------------------
  |  |   17|  4.66k|#define gTrue 1
  ------------------
  273|  4.66k|    Object obj;
  274|  4.66k|    dict->dictLookup("Filter", &obj, recursion);
  275|  4.66k|    if (obj.isName("Crypt")) {
  ------------------
  |  Branch (275:9): [True: 244, False: 4.42k]
  ------------------
  276|    244|      encrypted = gFalse;
  ------------------
  |  |   18|    244|#define gFalse 0
  ------------------
  277|  4.42k|    } else if (obj.isArray() && obj.arrayGetLength() >= 1) {
  ------------------
  |  Branch (277:16): [True: 148, False: 4.27k]
  |  Branch (277:33): [True: 103, False: 45]
  ------------------
  278|    103|      Object obj2;
  279|    103|      if (obj.arrayGet(0, &obj2)->isName("Crypt")) {
  ------------------
  |  Branch (279:11): [True: 0, False: 103]
  ------------------
  280|      0|	encrypted = gFalse;
  ------------------
  |  |   18|      0|#define gFalse 0
  ------------------
  281|      0|      }
  282|    103|      obj2.free();
  283|    103|    }
  284|  4.66k|    obj.free();
  285|  4.66k|    if (encrypted) {
  ------------------
  |  Branch (285:9): [True: 4.42k, False: 244]
  ------------------
  286|  4.42k|      str = new DecryptStream(str, fileKey, encAlgorithm, keyLength,
  287|  4.42k|			      objNum, objGen);
  288|  4.42k|    }
  289|  4.66k|  }
  290|       |
  291|       |  // get filters
  292|   100k|  str = str->addFilters(dict, recursion);
  293|       |
  294|   100k|  return str;
  295|   105k|}
_ZN6Parser5shiftEv:
  297|   171M|void Parser::shift() {
  298|   171M|  if (inlineImg > 0) {
  ------------------
  |  Branch (298:7): [True: 535k, False: 171M]
  ------------------
  299|   535k|    if (inlineImg < 2) {
  ------------------
  |  Branch (299:9): [True: 296k, False: 239k]
  ------------------
  300|   296k|      ++inlineImg;
  301|   296k|    } else {
  302|       |      // in a damaged content stream, if 'ID' shows up in the middle
  303|       |      // of a dictionary, we need to reset
  304|   239k|      inlineImg = 0;
  305|   239k|    }
  306|   171M|  } else if (buf2.isCmd("ID")) {
  ------------------
  |  Branch (306:14): [True: 296k, False: 170M]
  ------------------
  307|   296k|    lexer->skipChar();		// skip char after 'ID' command
  308|   296k|    inlineImg = 1;
  309|   296k|  }
  310|   171M|  buf1.free();
  311|   171M|  buf1 = buf2;
  312|   171M|  if (inlineImg > 0)		// don't buffer inline image data
  ------------------
  |  Branch (312:7): [True: 592k, False: 171M]
  ------------------
  313|   592k|    buf2.initNull();
  314|   171M|  else
  315|   171M|    lexer->getObj(&buf2);
  316|   171M|}

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

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

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

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

_ZN10BaseStream13getBaseStreamEv:
  178|   105k|  virtual BaseStream *getBaseStream() { return this; }
_ZN10BaseStream7getDictEv:
  180|   708k|  virtual Dict *getDict() { return dict.getDict(); }
_ZN10BaseStream11getFileNameEv:
  181|  10.5k|  virtual GString *getFileName() { return NULL; }
_ZN12FilterStream6getPosEv:
  206|  11.0M|  virtual GFileOffset getPos() { return str->getPos(); }
_ZN12FilterStream7getDictEv:
  210|   532k|  virtual Dict *getDict() { return str->getDict(); }
_ZN15StreamPredictor4isOkEv:
  277|  13.9k|  GBool isOk() { return ok; }
_ZN15StreamPredictor12getPredictorEv:
  285|  10.4k|  int getPredictor() { return predictor; }
_ZN15StreamPredictor8getWidthEv:
  286|  10.4k|  int getWidth() { return width; }
_ZN15StreamPredictor9getNCompsEv:
  287|  10.4k|  int getNComps() { return nComps; }
_ZN15StreamPredictor8getNBitsEv:
  288|  10.4k|  int getNBits() { return nBits; }
_ZN9MemStream7getCharEv:
  366|   696M|    { return (bufPtr < bufEnd) ? (*bufPtr++ & 0xff) : EOF; }
  ------------------
  |  Branch (366:14): [True: 681M, False: 14.8M]
  ------------------
_ZN9MemStream8lookCharEv:
  368|   150M|    { return (bufPtr < bufEnd) ? (*bufPtr & 0xff) : EOF; }
  ------------------
  |  Branch (368:14): [True: 150M, False: 14.2k]
  ------------------
_ZN9MemStream6getPosEv:
  370|  57.0M|  virtual GFileOffset getPos() { return (GFileOffset)(bufPtr - buf); }
_ZN9MemStream8getStartEv:
  372|  21.0k|  virtual GFileOffset getStart() { return start; }
_ZN11EmbedStream5resetEv:
  405|  45.1k|  virtual void reset() {}
_ZN11EmbedStream6getPosEv:
  409|  37.0k|  virtual GFileOffset getPos() { return str->getPos(); }
_ZN14ASCIIHexStream7getCharEv:
  434|  46.8k|    { int c = lookChar(); buf = EOF; return c; }
_ZN13ASCII85Stream7getCharEv:
  459|  5.29M|    { int ch = lookChar(); ++index; return ch; }
_ZN15RunLengthStream7getCharEv:
  538|  14.5M|    { return (bufPtr >= bufEnd && !fillBuf()) ? EOF : (*bufPtr++ & 0xff); }
  ------------------
  |  Branch (538:15): [True: 1.19M, False: 13.3M]
  |  Branch (538:35): [True: 807k, False: 382k]
  ------------------
_ZN15RunLengthStream8lookCharEv:
  540|   416k|    { return (bufPtr >= bufEnd && !fillBuf()) ? EOF : (*bufPtr & 0xff); }
  ------------------
  |  Branch (540:15): [True: 6.20k, False: 410k]
  |  Branch (540:35): [True: 592, False: 5.61k]
  ------------------
_ZN14CCITTFaxStream7eatBitsEi:
  609|  82.9M|  void eatBits(int n) { if ((inputBits -= n) < 0) inputBits = 0; }
  ------------------
  |  Branch (609:29): [True: 3.49k, False: 82.9M]
  ------------------
_ZN9EOFStream5resetEv:
  873|  1.97k|  virtual void reset() {}
_ZN9EOFStream7getCharEv:
  874|    993|  virtual int getChar() { return EOF; }
_ZN9EOFStream8getBlockEPci:
  876|    336|  virtual int getBlock(char *blk, int size) { return 0; }

_ZN10TextStringC2Ev:
   21|   516k|TextString::TextString() {
   22|       |  u = NULL;
   23|   516k|  len = size = 0;
   24|   516k|}
_ZN10TextStringC2EP7GString:
   26|  67.4k|TextString::TextString(GString *s) {
   27|       |  u = NULL;
   28|  67.4k|  len = size = 0;
   29|  67.4k|  append(s);
   30|  67.4k|}
_ZN10TextStringC2EPS_:
   32|  8.33k|TextString::TextString(TextString *s) {
   33|  8.33k|  len = size = s->len;
   34|  8.33k|  if (len) {
  ------------------
  |  Branch (34:7): [True: 4.72k, False: 3.61k]
  ------------------
   35|  4.72k|    u = (Unicode *)gmallocn(size, sizeof(Unicode));
   36|  4.72k|    memcpy(u, s->u, len * sizeof(Unicode));
   37|  4.72k|  } else {
   38|       |    u = NULL;
   39|  3.61k|  }
   40|  8.33k|}
_ZN10TextStringD2Ev:
   42|   591k|TextString::~TextString() {
   43|   591k|  gfree(u);
   44|   591k|}
_ZN10TextString6appendEP7GString:
   53|  67.4k|TextString *TextString::append(GString *s) {
   54|  67.4k|  return insert(len, s);
   55|  67.4k|}
_ZN10TextString6insertEij:
   57|  33.8k|TextString *TextString::insert(int idx, Unicode c) {
   58|  33.8k|  if (idx >= 0 && idx <= len) {
  ------------------
  |  Branch (58:7): [True: 33.8k, False: 0]
  |  Branch (58:19): [True: 33.8k, False: 0]
  ------------------
   59|  33.8k|    expand(1);
   60|  33.8k|    if (idx < len) {
  ------------------
  |  Branch (60:9): [True: 33.8k, False: 0]
  ------------------
   61|  33.8k|      memmove(u + idx + 1, u + idx, (len - idx) * sizeof(Unicode));
   62|  33.8k|    }
   63|  33.8k|    u[idx] = c;
   64|  33.8k|    ++len;
   65|  33.8k|  }
   66|  33.8k|  return this;
   67|  33.8k|}
_ZN10TextString6insertEiPji:
   69|   208k|TextString *TextString::insert(int idx, Unicode *u2, int n) {
   70|   208k|  if (idx >= 0 && idx <= len) {
  ------------------
  |  Branch (70:7): [True: 208k, False: 0]
  |  Branch (70:19): [True: 208k, False: 0]
  ------------------
   71|   208k|    expand(n);
   72|   208k|    if (idx < len) {
  ------------------
  |  Branch (72:9): [True: 161k, False: 47.6k]
  ------------------
   73|   161k|      memmove(u + idx + n, u + idx, (len - idx) * sizeof(Unicode));
   74|   161k|    }
   75|   208k|    memcpy(u + idx, u2, n * sizeof(Unicode));
   76|   208k|    len += n;
   77|   208k|  }
   78|   208k|  return this;
   79|   208k|}
_ZN10TextString6insertEiP7GString:
   81|   101k|TextString *TextString::insert(int idx, GString *s) {
   82|   101k|  Unicode uBuf[100];
   83|   101k|  int n, i;
   84|       |
   85|   101k|  if (idx >= 0 && idx <= len) {
  ------------------
  |  Branch (85:7): [True: 101k, False: 0]
  |  Branch (85:19): [True: 101k, False: 0]
  ------------------
   86|       |    // look for a UTF-16BE BOM
   87|   101k|    if ((s->getChar(0) & 0xff) == 0xfe &&
  ------------------
  |  Branch (87:9): [True: 28.5k, False: 73.2k]
  ------------------
   88|  28.5k|	(s->getChar(1) & 0xff) == 0xff) {
  ------------------
  |  Branch (88:2): [True: 27.0k, False: 1.51k]
  ------------------
   89|  27.0k|      i = 2;
   90|  27.0k|      n = 0;
   91|  2.24M|      while (getUTF16BE(s, &i, uBuf + n)) {
  ------------------
  |  Branch (91:14): [True: 2.21M, False: 27.0k]
  ------------------
   92|  2.21M|	++n;
   93|  2.21M|	if (n == sizeof(uBuf) / sizeof(Unicode)) {
  ------------------
  |  Branch (93:6): [True: 16.0k, False: 2.20M]
  ------------------
   94|  16.0k|	  insert(idx, uBuf, n);
   95|  16.0k|	  idx += n;
   96|  16.0k|	  n = 0;
   97|  16.0k|	}
   98|  2.21M|      }
   99|  27.0k|      if (n > 0) {
  ------------------
  |  Branch (99:11): [True: 26.7k, False: 328]
  ------------------
  100|  26.7k|	insert(idx, uBuf, n);
  101|  26.7k|      }
  102|       |
  103|       |    // look for a UTF-16LE BOM
  104|       |    // (technically, this isn't allowed by the PDF spec, but some
  105|       |    // PDF files use it)
  106|  74.7k|    } else if ((s->getChar(0) & 0xff) == 0xff &&
  ------------------
  |  Branch (106:16): [True: 5.92k, False: 68.7k]
  ------------------
  107|  5.92k|	       (s->getChar(1) & 0xff) == 0xfe) {
  ------------------
  |  Branch (107:9): [True: 5.52k, False: 401]
  ------------------
  108|  5.52k|      i = 2;
  109|  5.52k|      n = 0;
  110|  13.1M|      while (getUTF16LE(s, &i, uBuf + n)) {
  ------------------
  |  Branch (110:14): [True: 13.1M, False: 5.52k]
  ------------------
  111|  13.1M|	++n;
  112|  13.1M|	if (n == sizeof(uBuf) / sizeof(Unicode)) {
  ------------------
  |  Branch (112:6): [True: 130k, False: 13.0M]
  ------------------
  113|   130k|	  insert(idx, uBuf, n);
  114|   130k|	  idx += n;
  115|   130k|	  n = 0;
  116|   130k|	}
  117|  13.1M|      }
  118|  5.52k|      if (n > 0) {
  ------------------
  |  Branch (118:11): [True: 3.80k, False: 1.72k]
  ------------------
  119|  3.80k|	insert(idx, uBuf, n);
  120|  3.80k|      }
  121|       |
  122|       |    // look for a UTF-8 BOM
  123|  69.1k|    } else if ((s->getChar(0) & 0xff) == 0xef &&
  ------------------
  |  Branch (123:16): [True: 1.54k, False: 67.6k]
  ------------------
  124|  1.54k|	       (s->getChar(1) & 0xff) == 0xbb &&
  ------------------
  |  Branch (124:9): [True: 1.24k, False: 304]
  ------------------
  125|  1.24k|	       (s->getChar(2) & 0xff) == 0xbf) {
  ------------------
  |  Branch (125:9): [True: 1.03k, False: 212]
  ------------------
  126|  1.03k|      i = 3;
  127|  1.03k|      n = 0;
  128|  3.14M|      while (getUTF8(s, &i, uBuf + n)) {
  ------------------
  |  Branch (128:14): [True: 3.14M, False: 1.03k]
  ------------------
  129|  3.14M|	++n;
  130|  3.14M|	if (n == sizeof(uBuf) / sizeof(Unicode)) {
  ------------------
  |  Branch (130:6): [True: 30.8k, False: 3.11M]
  ------------------
  131|  30.8k|	  insert(idx, uBuf, n);
  132|  30.8k|	  idx += n;
  133|  30.8k|	  n = 0;
  134|  30.8k|	}
  135|  3.14M|      }
  136|  1.03k|      if (n > 0) {
  ------------------
  |  Branch (136:11): [True: 891, False: 142]
  ------------------
  137|    891|	insert(idx, uBuf, n);
  138|    891|      }
  139|       |
  140|       |    // otherwise, use PDFDocEncoding
  141|  68.1k|    } else {
  142|  68.1k|      n = s->getLength();
  143|  68.1k|      expand(n);
  144|  68.1k|      if (idx < len) {
  ------------------
  |  Branch (144:11): [True: 8.38k, False: 59.7k]
  ------------------
  145|  8.38k|	memmove(u + idx + n, u + idx, (len - idx) * sizeof(Unicode));
  146|  8.38k|      }
  147|  23.7M|      for (i = 0; i < n; ++i) {
  ------------------
  |  Branch (147:19): [True: 23.6M, False: 68.1k]
  ------------------
  148|  23.6M|	u[idx + i] = pdfDocEncoding[s->getChar(i) & 0xff];
  149|  23.6M|      }
  150|  68.1k|      len += n;
  151|  68.1k|    }
  152|   101k|  }
  153|   101k|  return this;
  154|   101k|}
_ZN10TextString6expandEi:
  156|   310k|void TextString::expand(int delta) {
  157|   310k|  int newLen;
  158|       |
  159|   310k|  newLen = len + delta;
  160|   310k|  if (delta > INT_MAX - len) {
  ------------------
  |  Branch (160:7): [True: 0, False: 310k]
  ------------------
  161|       |    // trigger an out-of-memory error
  162|      0|    size = -1;
  163|   310k|  } else if (newLen <= size) {
  ------------------
  |  Branch (163:14): [True: 234k, False: 75.7k]
  ------------------
  164|   234k|    return;
  165|   234k|  } else if (size > 0 && size <= INT_MAX / 2 && size*2 >= newLen) {
  ------------------
  |  Branch (165:14): [True: 14.1k, False: 61.6k]
  |  Branch (165:26): [True: 14.1k, False: 0]
  |  Branch (165:49): [True: 13.2k, False: 825]
  ------------------
  166|  13.2k|    size *= 2;
  167|  62.4k|  } else {
  168|  62.4k|    size = newLen;
  169|  62.4k|  }
  170|  75.7k|  u = (Unicode *)greallocn(u, size, sizeof(Unicode));
  171|  75.7k|}
_ZN10TextString6toUTF8Ev:
  201|    120|GString *TextString::toUTF8() {
  202|    120|  GString *s = new GString();
  203|  52.0k|  for (int i = 0; i < len; ++i) {
  ------------------
  |  Branch (203:19): [True: 51.9k, False: 120]
  ------------------
  204|  51.9k|    char buf[8];
  205|  51.9k|    int n = mapUTF8(u[i], buf, sizeof(buf));
  206|  51.9k|    s->append(buf, n);
  207|  51.9k|  }
  208|    120|  return s;
  209|    120|}

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

_Z7mapUTF8jPci:
   12|  51.9k|int mapUTF8(Unicode u, char *buf, int bufSize) {
   13|  51.9k|  if        (u <= 0x0000007f) {
  ------------------
  |  Branch (13:14): [True: 48.8k, False: 3.12k]
  ------------------
   14|  48.8k|    if (bufSize < 1) {
  ------------------
  |  Branch (14:9): [True: 0, False: 48.8k]
  ------------------
   15|      0|      return 0;
   16|      0|    }
   17|  48.8k|    buf[0] = (char)u;
   18|  48.8k|    return 1;
   19|  48.8k|  } else if (u <= 0x000007ff) {
  ------------------
  |  Branch (19:14): [True: 975, False: 2.15k]
  ------------------
   20|    975|    if (bufSize < 2) {
  ------------------
  |  Branch (20:9): [True: 0, False: 975]
  ------------------
   21|      0|      return 0;
   22|      0|    }
   23|    975|    buf[0] = (char)(0xc0 + (u >> 6));
   24|    975|    buf[1] = (char)(0x80 + (u & 0x3f));
   25|    975|    return 2;
   26|  2.15k|  } else if (u <= 0x0000ffff) {
  ------------------
  |  Branch (26:14): [True: 1.96k, False: 185]
  ------------------
   27|  1.96k|    if (bufSize < 3) {
  ------------------
  |  Branch (27:9): [True: 0, False: 1.96k]
  ------------------
   28|      0|      return 0;
   29|      0|    }
   30|  1.96k|    buf[0] = (char)(0xe0 + (u >> 12));
   31|  1.96k|    buf[1] = (char)(0x80 + ((u >> 6) & 0x3f));
   32|  1.96k|    buf[2] = (char)(0x80 + (u & 0x3f));
   33|  1.96k|    return 3;
   34|  1.96k|  } else if (u <= 0x0010ffff) {
  ------------------
  |  Branch (34:14): [True: 62, False: 123]
  ------------------
   35|     62|    if (bufSize < 4) {
  ------------------
  |  Branch (35:9): [True: 0, False: 62]
  ------------------
   36|      0|      return 0;
   37|      0|    }
   38|     62|    buf[0] = (char)(0xf0 + (u >> 18));
   39|     62|    buf[1] = (char)(0x80 + ((u >> 12) & 0x3f));
   40|     62|    buf[2] = (char)(0x80 + ((u >> 6) & 0x3f));
   41|     62|    buf[3] = (char)(0x80 + (u & 0x3f));
   42|     62|    return 4;
   43|    123|  } else {
   44|    123|    return 0;
   45|    123|  }
   46|  51.9k|}
_Z7getUTF8P7GStringPiPj:
   61|  3.14M|GBool getUTF8(GString *s, int *i, Unicode *u) {
   62|  3.14M|  Guchar c0, c1, c2, c3, c4, c5;
   63|       |
   64|  3.14M|  if (*i >= s->getLength()) {
  ------------------
  |  Branch (64:7): [True: 1.03k, False: 3.14M]
  ------------------
   65|  1.03k|    return gFalse;
  ------------------
  |  |   18|  1.03k|#define gFalse 0
  ------------------
   66|  1.03k|  }
   67|  3.14M|  c0 = (Guchar)s->getChar((*i)++);
   68|  3.14M|  if (c0 < 0x80) {
  ------------------
  |  Branch (68:7): [True: 2.51M, False: 627k]
  ------------------
   69|  2.51M|    *u = (Unicode)c0;
   70|  2.51M|  } else if (c0 < 0xe0) {
  ------------------
  |  Branch (70:14): [True: 366k, False: 260k]
  ------------------
   71|   366k|    if (*i < s->getLength() &&
  ------------------
  |  Branch (71:9): [True: 366k, False: 53]
  ------------------
   72|   366k|	((c1 = (Guchar)s->getChar(*i)) & 0xc0) == 0x80) {
  ------------------
  |  Branch (72:2): [True: 113k, False: 253k]
  ------------------
   73|   113k|      *i += 1;
   74|   113k|      *u = (Unicode)(((c0 & 0x1f) << 6) |
   75|   113k|		     (c1 & 0x3f));
   76|   253k|    } else {
   77|   253k|      *u =  (Unicode)c0;
   78|   253k|    }
   79|   366k|  } else if (c0 < 0xf0) {
  ------------------
  |  Branch (79:14): [True: 96.6k, False: 164k]
  ------------------
   80|  96.6k|    if (*i < s->getLength() - 1 &&
  ------------------
  |  Branch (80:9): [True: 95.9k, False: 690]
  ------------------
   81|  95.9k|	((c1 = (Guchar)s->getChar(*i)) & 0xc0) == 0x80 &&
  ------------------
  |  Branch (81:2): [True: 13.1k, False: 82.8k]
  ------------------
   82|  13.1k|	((c2 = (Guchar)s->getChar(*i + 1)) & 0xc0) == 0x80) {
  ------------------
  |  Branch (82:2): [True: 4.28k, False: 8.81k]
  ------------------
   83|  4.28k|      *i += 2;
   84|  4.28k|      *u = (Unicode)(((c0 & 0x0f) << 12) |
   85|  4.28k|		     ((c1 & 0x3f) << 6) |
   86|  4.28k|		     (c2 & 0x3f));
   87|  92.3k|    } else {
   88|  92.3k|      *u = (Unicode)c0;
   89|  92.3k|    }
   90|   164k|  } else if (c0 < 0xf8) {
  ------------------
  |  Branch (90:14): [True: 24.9k, False: 139k]
  ------------------
   91|  24.9k|    if (*i < s->getLength() - 2 &&
  ------------------
  |  Branch (91:9): [True: 24.8k, False: 108]
  ------------------
   92|  24.8k|	((c1 = (Guchar)s->getChar(*i)) & 0xc0) == 0x80 &&
  ------------------
  |  Branch (92:2): [True: 9.46k, False: 15.3k]
  ------------------
   93|  9.46k|	((c2 = (Guchar)s->getChar(*i + 1)) & 0xc0) == 0x80 &&
  ------------------
  |  Branch (93:2): [True: 3.26k, False: 6.19k]
  ------------------
   94|  3.26k|	((c3 = (Guchar)s->getChar(*i + 2)) & 0xc0) == 0x80) {
  ------------------
  |  Branch (94:2): [True: 2.35k, False: 914]
  ------------------
   95|  2.35k|      *i += 3;
   96|  2.35k|      *u = (Unicode)(((c0 & 0x07) << 18) |
   97|  2.35k|		     ((c1 & 0x3f) << 12) |
   98|  2.35k|		     ((c2 & 0x3f) << 6) |
   99|  2.35k|		     (c3 & 0x3f));
  100|  22.5k|    } else {
  101|  22.5k|      *u = (Unicode)c0;
  102|  22.5k|    }
  103|   139k|  } else if (c0 < 0xfc) {
  ------------------
  |  Branch (103:14): [True: 6.35k, False: 132k]
  ------------------
  104|  6.35k|    if (*i < s->getLength() - 3 &&
  ------------------
  |  Branch (104:9): [True: 6.02k, False: 336]
  ------------------
  105|  6.02k|	((c1 = (Guchar)s->getChar(*i)) & 0xc0) == 0x80 &&
  ------------------
  |  Branch (105:2): [True: 1.60k, False: 4.41k]
  ------------------
  106|  1.60k|	((c2 = (Guchar)s->getChar(*i + 1)) & 0xc0) == 0x80 &&
  ------------------
  |  Branch (106:2): [True: 868, False: 733]
  ------------------
  107|    868|	((c3 = (Guchar)s->getChar(*i + 2)) & 0xc0) == 0x80 &&
  ------------------
  |  Branch (107:2): [True: 518, False: 350]
  ------------------
  108|    518|	((c4 = (Guchar)s->getChar(*i + 3)) & 0xc0) == 0x80) {
  ------------------
  |  Branch (108:2): [True: 449, False: 69]
  ------------------
  109|    449|      *i += 4;
  110|    449|      *u = (Unicode)(((c0 & 0x03) << 24) |
  111|    449|		     ((c1 & 0x3f) << 18) |
  112|    449|		     ((c2 & 0x3f) << 12) |
  113|    449|		     ((c3 & 0x3f) << 6) |
  114|    449|		     (c4 & 0x3f));
  115|  5.90k|    } else {
  116|  5.90k|      *u = (Unicode)c0;
  117|  5.90k|    }
  118|   132k|  } else if (c0 < 0xfe) {
  ------------------
  |  Branch (118:14): [True: 24.3k, False: 108k]
  ------------------
  119|  24.3k|    if (*i < s->getLength() - 4 &&
  ------------------
  |  Branch (119:9): [True: 23.3k, False: 1.01k]
  ------------------
  120|  23.3k|	((c1 = (Guchar)s->getChar(*i)) & 0xc0) == 0x80 &&
  ------------------
  |  Branch (120:2): [True: 2.23k, False: 21.1k]
  ------------------
  121|  2.23k|	((c2 = (Guchar)s->getChar(*i + 1)) & 0xc0) == 0x80 &&
  ------------------
  |  Branch (121:2): [True: 1.69k, False: 544]
  ------------------
  122|  1.69k|	((c3 = (Guchar)s->getChar(*i + 2)) & 0xc0) == 0x80 &&
  ------------------
  |  Branch (122:2): [True: 1.57k, False: 115]
  ------------------
  123|  1.57k|	((c4 = (Guchar)s->getChar(*i + 3)) & 0xc0) == 0x80 &&
  ------------------
  |  Branch (123:2): [True: 1.48k, False: 90]
  ------------------
  124|  1.48k|	((c5 = (Guchar)s->getChar(*i + 4)) & 0xc0) == 0x80) {
  ------------------
  |  Branch (124:2): [True: 1.24k, False: 239]
  ------------------
  125|  1.24k|      *i += 5;
  126|  1.24k|      *u = (Unicode)(((c0 & 0x01) << 30) |
  127|  1.24k|		     ((c1 & 0x3f) << 24) |
  128|  1.24k|		     ((c2 & 0x3f) << 18) |
  129|  1.24k|		     ((c3 & 0x3f) << 12) |
  130|  1.24k|		     ((c4 & 0x3f) << 6) |
  131|  1.24k|		     (c5 & 0x3f));
  132|  23.1k|    } else {
  133|  23.1k|      *u = (Unicode)c0;
  134|  23.1k|    }
  135|   108k|  } else {
  136|   108k|    *u = (Unicode)c0;
  137|   108k|  }
  138|  3.14M|  return gTrue;
  ------------------
  |  |   17|  3.14M|#define gTrue 1
  ------------------
  139|  3.14M|}
_Z10getUTF16BEP7GStringPiPj:
  141|  2.24M|GBool getUTF16BE(GString *s, int *i, Unicode *u) {
  142|  2.24M|  int w0, w1;
  143|       |
  144|  2.24M|  if (*i >= s->getLength() - 1) {
  ------------------
  |  Branch (144:7): [True: 27.0k, False: 2.21M]
  ------------------
  145|  27.0k|    return gFalse;
  ------------------
  |  |   18|  27.0k|#define gFalse 0
  ------------------
  146|  27.0k|  }
  147|  2.21M|  w0 = ((s->getChar(*i) & 0xff) << 8) | (s->getChar(*i + 1) & 0xff);
  148|  2.21M|  *i += 2;
  149|  2.21M|  if (w0 < 0xd800 || w0 >= 0xe000) {
  ------------------
  |  Branch (149:7): [True: 2.11M, False: 100k]
  |  Branch (149:22): [True: 42.1k, False: 58.0k]
  ------------------
  150|  2.16M|    *u = (Unicode)w0;
  151|  2.16M|  } else {
  152|  58.0k|    if (*i < s->getLength() - 1) {
  ------------------
  |  Branch (152:9): [True: 57.7k, False: 254]
  ------------------
  153|  57.7k|      w1 = ((s->getChar(*i) & 0xff) << 8) | (s->getChar(*i + 1) & 0xff);
  154|  57.7k|      *i += 2;
  155|  57.7k|      *u = 0x10000 + ((w0 - 0xd800) << 10) + (w1 - 0xdc00);
  156|  57.7k|    } else {
  157|    254|      *u = (Unicode)w0;
  158|    254|    }
  159|  58.0k|  }
  160|  2.21M|  return gTrue;
  ------------------
  |  |   17|  2.21M|#define gTrue 1
  ------------------
  161|  2.24M|}
_Z10getUTF16LEP7GStringPiPj:
  163|  13.1M|GBool getUTF16LE(GString *s, int *i, Unicode *u) {
  164|  13.1M|  int w0, w1;
  165|       |
  166|  13.1M|  if (*i >= s->getLength() - 1) {
  ------------------
  |  Branch (166:7): [True: 5.52k, False: 13.1M]
  ------------------
  167|  5.52k|    return gFalse;
  ------------------
  |  |   18|  5.52k|#define gFalse 0
  ------------------
  168|  5.52k|  }
  169|  13.1M|  w0 = (s->getChar(*i) & 0xff) | ((s->getChar(*i + 1) & 0xff) << 8);
  170|  13.1M|  *i += 2;
  171|  13.1M|  if (w0 < 0xd800 || w0 >= 0xe000) {
  ------------------
  |  Branch (171:7): [True: 12.8M, False: 296k]
  |  Branch (171:22): [True: 275k, False: 20.6k]
  ------------------
  172|  13.1M|    *u = (Unicode)w0;
  173|  13.1M|  } else {
  174|  20.6k|    if (*i < s->getLength() - 1) {
  ------------------
  |  Branch (174:9): [True: 20.3k, False: 390]
  ------------------
  175|  20.3k|      w1 = (s->getChar(*i) & 0xff) | ((s->getChar(*i + 1) & 0xff) << 8);
  176|  20.3k|      *i += 2;
  177|  20.3k|      *u = 0x10000 + ((w0 - 0xd800) << 10) + (w1 - 0xdc00);
  178|  20.3k|    } else {
  179|    390|      *u = (Unicode)w0;
  180|    390|    }
  181|  20.6k|  }
  182|  13.1M|  return gTrue;
  ------------------
  |  |   17|  13.1M|#define gTrue 1
  ------------------
  183|  13.1M|}

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

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

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

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

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

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

_ZN6ZxNodeC2Ev:
   64|  2.23M|ZxNode::ZxNode() {
   65|  2.23M|  next = NULL;
   66|  2.23M|  parent = NULL;
   67|       |  firstChild = lastChild = NULL;
   68|  2.23M|}
_ZN6ZxNodeD2Ev:
   70|  2.23M|ZxNode::~ZxNode() {
   71|  2.23M|  ZxNode *child;
   72|       |
   73|  4.46M|  while (firstChild) {
  ------------------
  |  Branch (73:10): [True: 2.23M, False: 2.23M]
  ------------------
   74|  2.23M|    child = firstChild;
   75|  2.23M|    firstChild = firstChild->next;
   76|  2.23M|    delete child;
   77|  2.23M|  }
   78|  2.23M|}
_ZN6ZxNode21findFirstChildElementEPKc:
  143|   254k|ZxElement *ZxNode::findFirstChildElement(const char *type) {
  144|   254k|  ZxNode *child;
  145|       |
  146|   830k|  for (child = firstChild; child; child = child->next) {
  ------------------
  |  Branch (146:28): [True: 597k, False: 233k]
  ------------------
  147|   597k|    if (child->isElement(type)) {
  ------------------
  |  Branch (147:9): [True: 21.2k, False: 576k]
  ------------------
  148|  21.2k|      return (ZxElement *)child;
  149|  21.2k|    }
  150|   597k|  }
  151|   233k|  return NULL;
  152|   254k|}
_ZN6ZxNode8addChildEPS_:
  186|  2.23M|void ZxNode::addChild(ZxNode *child) {
  187|  2.23M|  if (lastChild) {
  ------------------
  |  Branch (187:7): [True: 1.80M, False: 426k]
  ------------------
  188|  1.80M|    lastChild->next = child;
  189|  1.80M|    lastChild = child;
  190|  1.80M|  } else {
  191|   426k|    firstChild = lastChild = child;
  192|   426k|  }
  193|  2.23M|  child->parent = this;
  194|       |  child->next = NULL;
  195|  2.23M|}
_ZN5ZxDocC2Ev:
  199|  1.19k|ZxDoc::ZxDoc() {
  200|  1.19k|  xmlDecl = NULL;
  201|  1.19k|  docTypeDecl = NULL;
  202|       |  root = NULL;
  203|  1.19k|}
_ZN5ZxDoc7loadMemEPKcj:
  205|  1.19k|ZxDoc *ZxDoc::loadMem(const char *data, Guint dataLen) {
  206|  1.19k|  ZxDoc *doc;
  207|       |
  208|  1.19k|  doc = new ZxDoc();
  209|  1.19k|  if (!doc->parse(data, dataLen)) {
  ------------------
  |  Branch (209:7): [True: 407, False: 792]
  ------------------
  210|    407|    delete doc;
  211|    407|    return NULL;
  212|    407|  }
  213|    792|  return doc;
  214|  1.19k|}
_ZN5ZxDoc8addChildEP6ZxNode:
  262|  1.73k|void ZxDoc::addChild(ZxNode *node) {
  263|  1.73k|  if (node->isXMLDecl() && !xmlDecl) {
  ------------------
  |  Branch (263:7): [True: 484, False: 1.24k]
  |  Branch (263:28): [True: 484, False: 0]
  ------------------
  264|    484|    xmlDecl = (ZxXMLDecl *)node;
  265|  1.24k|  } else if (node->isDocTypeDecl() && !docTypeDecl) {
  ------------------
  |  Branch (265:14): [True: 88, False: 1.16k]
  |  Branch (265:39): [True: 88, False: 0]
  ------------------
  266|     88|    docTypeDecl = (ZxDocTypeDecl *)node;
  267|  1.16k|  } else if (node->isElement() && !root) {
  ------------------
  |  Branch (267:14): [True: 792, False: 368]
  |  Branch (267:35): [True: 792, False: 0]
  ------------------
  268|    792|    root = (ZxElement *)node;
  269|    792|  }
  270|  1.73k|  ZxNode::addChild(node);
  271|  1.73k|}
_ZN5ZxDoc5parseEPKcj:
  273|  1.19k|bool ZxDoc::parse(const char *data, Guint dataLen) {
  274|  1.19k|  parsePtr = data;
  275|  1.19k|  parseEnd = data + dataLen;
  276|       |  
  277|  1.19k|  parseSpace();
  278|  1.19k|  parseBOM();
  279|  1.19k|  parseSpace();
  280|  1.19k|  parseXMLDecl(this);
  281|  1.19k|  parseMisc(this);
  282|  1.19k|  parseDocTypeDecl(this);
  283|  1.19k|  parseMisc(this);
  284|  1.19k|  if (match("<")) {
  ------------------
  |  Branch (284:7): [True: 792, False: 407]
  ------------------
  285|    792|    parseElement(this);
  286|    792|  }
  287|  1.19k|  parseMisc(this);
  288|       |  return root != NULL;
  289|  1.19k|}
_ZN5ZxDoc12parseXMLDeclEP6ZxNode:
  291|  1.19k|void ZxDoc::parseXMLDecl(ZxNode *par) {
  292|  1.19k|  GString *version, *encoding, *s;
  293|  1.19k|  bool standalone;
  294|       |
  295|  1.19k|  if (!match("<?xml")) {
  ------------------
  |  Branch (295:7): [True: 715, False: 484]
  ------------------
  296|    715|    return;
  297|    715|  }
  298|    484|  parsePtr += 5;
  299|    484|  parseSpace();
  300|       |
  301|       |  // version
  302|    484|  version = NULL;
  303|    484|  if (match("version")) {
  ------------------
  |  Branch (303:7): [True: 463, False: 21]
  ------------------
  304|    463|    parsePtr += 7;
  305|    463|    parseSpace();
  306|    463|    if (match("=")) {
  ------------------
  |  Branch (306:9): [True: 441, False: 22]
  ------------------
  307|    441|      ++parsePtr;
  308|    441|      parseSpace();
  309|    441|      version = parseQuotedString();
  310|    441|    }
  311|    463|  }
  312|    484|  if (!version) {
  ------------------
  |  Branch (312:7): [True: 43, False: 441]
  ------------------
  313|     43|    version = new GString("1.0");
  314|     43|  }
  315|    484|  parseSpace();
  316|       |	
  317|       |  // encoding
  318|    484|  encoding = NULL;
  319|    484|  if (match("encoding")) {
  ------------------
  |  Branch (319:7): [True: 333, False: 151]
  ------------------
  320|    333|    parsePtr += 8;
  321|    333|    parseSpace();
  322|    333|    if (match("=")) {
  ------------------
  |  Branch (322:9): [True: 312, False: 21]
  ------------------
  323|    312|      ++parsePtr;
  324|    312|      parseSpace();
  325|    312|      encoding = parseQuotedString();
  326|    312|    }
  327|    333|  }
  328|    484|  parseSpace();
  329|       |
  330|       |  // standalone
  331|    484|  standalone = false;
  332|    484|  if (match("standalone")) {
  ------------------
  |  Branch (332:7): [True: 63, False: 421]
  ------------------
  333|     63|    parsePtr += 10;
  334|     63|    parseSpace();
  335|     63|    if (match("=")) {
  ------------------
  |  Branch (335:9): [True: 46, False: 17]
  ------------------
  336|     46|      ++parsePtr;
  337|     46|      parseSpace();
  338|     46|      s = parseQuotedString();
  339|     46|      standalone = !s->cmp("yes");
  340|     46|      delete s;
  341|     46|    }
  342|     63|  }
  343|    484|  parseSpace();
  344|       |
  345|    484|  if (match("?>")) {
  ------------------
  |  Branch (345:7): [True: 275, False: 209]
  ------------------
  346|    275|    parsePtr += 2;
  347|    275|  }
  348|       |
  349|    484|  par->addChild(new ZxXMLDecl(version, encoding, standalone));
  350|    484|}
_ZN5ZxDoc16parseDocTypeDeclEP6ZxNode:
  353|  1.19k|void ZxDoc::parseDocTypeDecl(ZxNode *par) {
  354|  1.19k|  GString *name;
  355|  1.19k|  int state;
  356|  1.19k|  char c, quote;
  357|       |
  358|  1.19k|  if (!match("<!DOCTYPE")) {
  ------------------
  |  Branch (358:7): [True: 1.11k, False: 88]
  ------------------
  359|  1.11k|    return;
  360|  1.11k|  }
  361|     88|  parsePtr += 9;
  362|     88|  parseSpace();
  363|       |
  364|     88|  name = parseName();
  365|     88|  parseSpace();
  366|       |
  367|     88|  state = 0;
  368|     88|  quote = '\0';
  369|   264k|  while (parsePtr < parseEnd && state < 4) {
  ------------------
  |  Branch (369:10): [True: 264k, False: 37]
  |  Branch (369:33): [True: 264k, False: 51]
  ------------------
  370|   264k|    c = *parsePtr++;
  371|   264k|    switch (state) {
  ------------------
  |  Branch (371:13): [True: 264k, False: 0]
  ------------------
  372|  43.7k|    case 0: // not in square brackets; not in quotes
  ------------------
  |  Branch (372:5): [True: 43.7k, False: 220k]
  ------------------
  373|  43.7k|      if (c == '>') {
  ------------------
  |  Branch (373:11): [True: 51, False: 43.7k]
  ------------------
  374|     51|	state = 4;
  375|  43.7k|      } else if (c == '"' || c == '\'') {
  ------------------
  |  Branch (375:18): [True: 468, False: 43.2k]
  |  Branch (375:30): [True: 135, False: 43.1k]
  ------------------
  376|    603|	state = 1;
  377|  43.1k|      } else if (c == '[') {
  ------------------
  |  Branch (377:18): [True: 352, False: 42.7k]
  ------------------
  378|    352|	state = 2;
  379|    352|      }
  380|  43.7k|      break;
  381|  60.4k|    case 1: // not in square brackets; in quotes
  ------------------
  |  Branch (381:5): [True: 60.4k, False: 204k]
  ------------------
  382|  60.4k|      if (c == quote) {
  ------------------
  |  Branch (382:11): [True: 595, False: 59.8k]
  ------------------
  383|    595|	state = 0;
  384|    595|      }
  385|  60.4k|      break;
  386|   100k|    case 2: // in square brackets; not in quotes
  ------------------
  |  Branch (386:5): [True: 100k, False: 164k]
  ------------------
  387|   100k|      if (c == ']') {
  ------------------
  |  Branch (387:11): [True: 331, False: 99.8k]
  ------------------
  388|    331|	state = 0;
  389|  99.8k|      } else if (c == '"' || c == '\'') {
  ------------------
  |  Branch (389:18): [True: 475, False: 99.3k]
  |  Branch (389:30): [True: 214, False: 99.1k]
  ------------------
  390|    689|	state = 3;
  391|    689|      }
  392|   100k|      break;
  393|  60.1k|    case 3: // in square brackets; in quotes
  ------------------
  |  Branch (393:5): [True: 60.1k, False: 204k]
  ------------------
  394|  60.1k|      if (c == quote) {
  ------------------
  |  Branch (394:11): [True: 684, False: 59.4k]
  ------------------
  395|    684|	state = 2;
  396|    684|      }
  397|  60.1k|      break;
  398|   264k|    }
  399|   264k|  }
  400|       |
  401|     88|  par->addChild(new ZxDocTypeDecl(name));
  402|     88|}
_ZN5ZxDoc12parseElementEP6ZxNode:
  405|  1.30M|void ZxDoc::parseElement(ZxNode *par) {
  406|  1.30M|  GString *type;
  407|  1.30M|  ZxElement *elem;
  408|  1.30M|  ZxAttr *attr;
  409|       |
  410|  1.30M|  ++parsePtr;
  411|  1.30M|  type = parseName();
  412|  1.30M|  elem = new ZxElement(type);
  413|  1.30M|  parseSpace();
  414|  1.48M|  while ((attr = parseAttr())) {
  ------------------
  |  Branch (414:10): [True: 173k, False: 1.30M]
  ------------------
  415|   173k|    elem->addAttr(attr);
  416|   173k|    parseSpace();
  417|   173k|  }
  418|  1.30M|  if (match("/>")) {
  ------------------
  |  Branch (418:7): [True: 46.5k, False: 1.26M]
  ------------------
  419|  46.5k|    parsePtr += 2;
  420|  1.26M|  } else if (match(">")) {
  ------------------
  |  Branch (420:14): [True: 425k, False: 837k]
  ------------------
  421|   425k|    ++parsePtr;
  422|   425k|    parseContent(elem);
  423|   425k|  }
  424|  1.30M|  par->addChild(elem);
  425|  1.30M|}
_ZN5ZxDoc9parseAttrEv:
  427|  1.48M|ZxAttr *ZxDoc::parseAttr() {
  428|  1.48M|  GString *name, *value;
  429|  1.48M|  const char *start;
  430|  1.48M|  char quote, c;
  431|  1.48M|  unsigned int x;
  432|  1.48M|  int n;
  433|       |
  434|  1.48M|  name = parseName();
  435|  1.48M|  parseSpace();
  436|  1.48M|  if (!match("=")) {
  ------------------
  |  Branch (436:7): [True: 1.28M, False: 192k]
  ------------------
  437|  1.28M|    delete name;
  438|  1.28M|    return NULL;
  439|  1.28M|  }
  440|   192k|  ++parsePtr;
  441|   192k|  parseSpace();
  442|   192k|  if (!(parsePtr < parseEnd && (*parsePtr == '"' || *parsePtr == '\''))) {
  ------------------
  |  Branch (442:9): [True: 192k, False: 2]
  |  Branch (442:33): [True: 172k, False: 20.1k]
  |  Branch (442:53): [True: 488, False: 19.6k]
  ------------------
  443|  19.6k|    delete name;
  444|  19.6k|    return NULL;
  445|  19.6k|  }
  446|   173k|  quote = *parsePtr++;
  447|   173k|  value = new GString();
  448|   409k|  while (parsePtr < parseEnd && *parsePtr != quote) {
  ------------------
  |  Branch (448:10): [True: 408k, False: 98]
  |  Branch (448:33): [True: 235k, False: 173k]
  ------------------
  449|   235k|    if (*parsePtr == '&') {
  ------------------
  |  Branch (449:9): [True: 40.9k, False: 195k]
  ------------------
  450|  40.9k|      ++parsePtr;
  451|  40.9k|      if (parsePtr < parseEnd && *parsePtr == '#') {
  ------------------
  |  Branch (451:11): [True: 40.8k, False: 5]
  |  Branch (451:34): [True: 22.1k, False: 18.7k]
  ------------------
  452|  22.1k|	++parsePtr;
  453|  22.1k|	if (parsePtr < parseEnd && *parsePtr == 'x') {
  ------------------
  |  Branch (453:6): [True: 22.1k, False: 2]
  |  Branch (453:29): [True: 9.65k, False: 12.4k]
  ------------------
  454|  9.65k|	  ++parsePtr;
  455|  9.65k|	  x = 0;
  456|  17.0k|	  while (parsePtr < parseEnd) {
  ------------------
  |  Branch (456:11): [True: 17.0k, False: 4]
  ------------------
  457|  17.0k|	    c = *parsePtr;
  458|  17.0k|	    if (c >= '0' && c <= '9') {
  ------------------
  |  Branch (458:10): [True: 13.6k, False: 3.36k]
  |  Branch (458:22): [True: 1.33k, False: 12.3k]
  ------------------
  459|  1.33k|	      x = (x << 4) + (c - '0');
  460|  15.7k|	    } else if (c >= 'a' && c <= 'f') {
  ------------------
  |  Branch (460:17): [True: 6.19k, False: 9.51k]
  |  Branch (460:29): [True: 2.12k, False: 4.06k]
  ------------------
  461|  2.12k|	      x = (x << 4) + (10 + c - 'a');
  462|  13.5k|	    } else if (c >= 'A' && c <= 'F') {
  ------------------
  |  Branch (462:17): [True: 8.73k, False: 4.84k]
  |  Branch (462:29): [True: 3.93k, False: 4.80k]
  ------------------
  463|  3.93k|	      x = (x << 4) + (10 + c - 'A');
  464|  9.64k|	    } else {
  465|  9.64k|	      break;
  466|  9.64k|	    }
  467|  7.40k|	    ++parsePtr;
  468|  7.40k|	  }
  469|  9.65k|	  if (parsePtr < parseEnd && *parsePtr == ';') {
  ------------------
  |  Branch (469:8): [True: 9.64k, False: 4]
  |  Branch (469:31): [True: 433, False: 9.21k]
  ------------------
  470|    433|	    ++parsePtr;
  471|    433|	  }
  472|  9.65k|	  appendUTF8(value, x);
  473|  12.4k|	} else {
  474|  12.4k|	  x = 0;
  475|  13.5k|	  while (parsePtr < parseEnd) {
  ------------------
  |  Branch (475:11): [True: 13.5k, False: 3]
  ------------------
  476|  13.5k|	    c = *parsePtr;
  477|  13.5k|	    if (c >= '0' && c <= '9') {
  ------------------
  |  Branch (477:10): [True: 7.76k, False: 5.75k]
  |  Branch (477:22): [True: 1.06k, False: 6.70k]
  ------------------
  478|  1.06k|	      x = x * 10 + (c - '0');
  479|  12.4k|	    } else {
  480|  12.4k|	      break;
  481|  12.4k|	    }
  482|  1.06k|	    ++parsePtr;
  483|  1.06k|	  }
  484|  12.4k|	  if (parsePtr < parseEnd && *parsePtr == ';') {
  ------------------
  |  Branch (484:8): [True: 12.4k, False: 3]
  |  Branch (484:31): [True: 265, False: 12.1k]
  ------------------
  485|    265|	    ++parsePtr;
  486|    265|	  }
  487|  12.4k|	  appendUTF8(value, x);
  488|  12.4k|	}
  489|  22.1k|      } else {
  490|  18.7k|	start = parsePtr;
  491|  18.7k|	for (++parsePtr;
  492|  1.25M|	     parsePtr < parseEnd && *parsePtr != ';' &&
  ------------------
  |  Branch (492:7): [True: 1.25M, False: 24]
  |  Branch (492:30): [True: 1.25M, False: 338]
  ------------------
  493|  1.25M|	       *parsePtr != quote && *parsePtr != '&';
  ------------------
  |  Branch (493:9): [True: 1.25M, False: 3.35k]
  |  Branch (493:31): [True: 1.24M, False: 15.0k]
  ------------------
  494|  1.24M|	     ++parsePtr) ;
  495|  18.7k|	n = (int)(parsePtr - start);
  496|  18.7k|	if (parsePtr < parseEnd && *parsePtr == ';') {
  ------------------
  |  Branch (496:6): [True: 18.7k, False: 24]
  |  Branch (496:29): [True: 338, False: 18.4k]
  ------------------
  497|    338|	  ++parsePtr;
  498|    338|	}
  499|  18.7k|	if (n == 2 && !strncmp(start, "lt", 2)) {
  ------------------
  |  Branch (499:6): [True: 2.01k, False: 16.7k]
  |  Branch (499:16): [True: 453, False: 1.55k]
  ------------------
  500|    453|	  value->append('<');
  501|  18.3k|	} else if (n == 2 && !strncmp(start, "gt", 2)) {
  ------------------
  |  Branch (501:13): [True: 1.55k, False: 16.7k]
  |  Branch (501:23): [True: 285, False: 1.27k]
  ------------------
  502|    285|	  value->append('>');
  503|  18.0k|	} else if (n == 3 && !strncmp(start, "amp", 3)) {
  ------------------
  |  Branch (503:13): [True: 577, False: 17.4k]
  |  Branch (503:23): [True: 85, False: 492]
  ------------------
  504|     85|	  value->append('&');
  505|  17.9k|	} else if (n == 4 && !strncmp(start, "apos", 4)) {
  ------------------
  |  Branch (505:13): [True: 701, False: 17.2k]
  |  Branch (505:23): [True: 0, False: 701]
  ------------------
  506|      0|	  value->append('\'');
  507|  17.9k|	} else if (n == 4 && !strncmp(start, "quot", 4)) {
  ------------------
  |  Branch (507:13): [True: 701, False: 17.2k]
  |  Branch (507:23): [True: 0, False: 701]
  ------------------
  508|      0|	  value->append('"');
  509|  17.9k|	} else {
  510|  17.9k|	  value->append(start - 1, (int)(parsePtr - start) + 1);
  511|  17.9k|	}
  512|  18.7k|      }
  513|   195k|    } else {
  514|   195k|      start = parsePtr;
  515|   195k|      for (++parsePtr;
  516|  19.1M|	   parsePtr < parseEnd && *parsePtr != quote && *parsePtr != '&';
  ------------------
  |  Branch (516:5): [True: 19.1M, False: 66]
  |  Branch (516:28): [True: 19.0M, False: 169k]
  |  Branch (516:50): [True: 18.9M, False: 25.7k]
  ------------------
  517|  18.9M|	   ++parsePtr) ;
  518|   195k|      value->append(start, (int)(parsePtr - start));
  519|   195k|    }
  520|   235k|  }
  521|   173k|  if (parsePtr < parseEnd && *parsePtr == quote) {
  ------------------
  |  Branch (521:7): [True: 173k, False: 98]
  |  Branch (521:30): [True: 173k, False: 0]
  ------------------
  522|   173k|    ++parsePtr;
  523|   173k|  }
  524|   173k|  return new ZxAttr(name, value);
  525|   192k|}
_ZN5ZxDoc12parseContentEP9ZxElement:
  528|   425k|void ZxDoc::parseContent(ZxElement *par) {
  529|   425k|  GString *endType;
  530|       |
  531|   425k|  endType = (new GString("</"))->append(par->getType());
  532|       |
  533|  2.65M|  while (parsePtr < parseEnd) {
  ------------------
  |  Branch (533:10): [True: 2.33M, False: 325k]
  ------------------
  534|  2.33M|    if (match(endType->getCString())) {
  ------------------
  |  Branch (534:9): [True: 100k, False: 2.23M]
  ------------------
  535|   100k|      parsePtr += endType->getLength();
  536|   100k|      parseSpace();
  537|   100k|      if (match(">")) {
  ------------------
  |  Branch (537:11): [True: 63.3k, False: 37.3k]
  ------------------
  538|  63.3k|	++parsePtr;
  539|  63.3k|      }
  540|   100k|      break;
  541|  2.23M|    } else if (match("<?")) {
  ------------------
  |  Branch (541:16): [True: 30.6k, False: 2.20M]
  ------------------
  542|  30.6k|      parsePI(par);
  543|  2.20M|    } else if (match("<![CDATA[")) {
  ------------------
  |  Branch (543:16): [True: 48, False: 2.20M]
  ------------------
  544|     48|      parseCDSect(par);
  545|  2.20M|    } else if (match("<!--")) {
  ------------------
  |  Branch (545:16): [True: 2.24k, False: 2.19M]
  ------------------
  546|  2.24k|      parseComment(par);
  547|  2.19M|    } else if (match("<")) {
  ------------------
  |  Branch (547:16): [True: 1.30M, False: 890k]
  ------------------
  548|  1.30M|      parseElement(par);
  549|  1.30M|    } else {
  550|   890k|      parseCharData(par);
  551|   890k|    }
  552|  2.33M|  }
  553|       |
  554|   425k|  delete endType;
  555|   425k|}
_ZN5ZxDoc13parseCharDataEP9ZxElement:
  557|   890k|void ZxDoc::parseCharData(ZxElement *par) {
  558|   890k|  GString *data;
  559|   890k|  const char *start;
  560|   890k|  char c;
  561|   890k|  unsigned int x;
  562|   890k|  int n;
  563|       |
  564|   890k|  data = new GString();
  565|  1.93M|  while (parsePtr < parseEnd && *parsePtr != '<') {
  ------------------
  |  Branch (565:10): [True: 1.93M, False: 498]
  |  Branch (565:33): [True: 1.04M, False: 889k]
  ------------------
  566|  1.04M|    if (*parsePtr == '&') {
  ------------------
  |  Branch (566:9): [True: 112k, False: 931k]
  ------------------
  567|   112k|      ++parsePtr;
  568|   112k|      if (parsePtr < parseEnd && *parsePtr == '#') {
  ------------------
  |  Branch (568:11): [True: 112k, False: 7]
  |  Branch (568:34): [True: 52.0k, False: 60.5k]
  ------------------
  569|  52.0k|	++parsePtr;
  570|  52.0k|	if (parsePtr < parseEnd && *parsePtr == 'x') {
  ------------------
  |  Branch (570:6): [True: 52.0k, False: 2]
  |  Branch (570:29): [True: 10.5k, False: 41.4k]
  ------------------
  571|  10.5k|	  ++parsePtr;
  572|  10.5k|	  x = 0;
  573|  20.4k|	  while (parsePtr < parseEnd) {
  ------------------
  |  Branch (573:11): [True: 20.4k, False: 5]
  ------------------
  574|  20.4k|	    c = *parsePtr;
  575|  20.4k|	    if (c >= '0' && c <= '9') {
  ------------------
  |  Branch (575:10): [True: 16.1k, False: 4.32k]
  |  Branch (575:22): [True: 1.35k, False: 14.8k]
  ------------------
  576|  1.35k|	      x = (x << 4) + (c - '0');
  577|  19.1k|	    } else if (c >= 'a' && c <= 'f') {
  ------------------
  |  Branch (577:17): [True: 6.79k, False: 12.3k]
  |  Branch (577:29): [True: 3.06k, False: 3.73k]
  ------------------
  578|  3.06k|	      x = (x << 4) + (10 + c - 'a');
  579|  16.0k|	    } else if (c >= 'A' && c <= 'F') {
  ------------------
  |  Branch (579:17): [True: 10.1k, False: 5.91k]
  |  Branch (579:29): [True: 5.50k, False: 4.64k]
  ------------------
  580|  5.50k|	      x = (x << 4) + (10 + c - 'A');
  581|  10.5k|	    } else {
  582|  10.5k|	      break;
  583|  10.5k|	    }
  584|  9.92k|	    ++parsePtr;
  585|  9.92k|	  }
  586|  10.5k|	  if (parsePtr < parseEnd && *parsePtr == ';') {
  ------------------
  |  Branch (586:8): [True: 10.5k, False: 5]
  |  Branch (586:31): [True: 322, False: 10.2k]
  ------------------
  587|    322|	    ++parsePtr;
  588|    322|	  }
  589|  10.5k|	  appendUTF8(data, x);
  590|  41.4k|	} else {
  591|  41.4k|	  x = 0;
  592|  51.6k|	  while (parsePtr < parseEnd) {
  ------------------
  |  Branch (592:11): [True: 51.6k, False: 6]
  ------------------
  593|  51.6k|	    c = *parsePtr;
  594|  51.6k|	    if (c >= '0' && c <= '9') {
  ------------------
  |  Branch (594:10): [True: 25.3k, False: 26.2k]
  |  Branch (594:22): [True: 10.1k, False: 15.1k]
  ------------------
  595|  10.1k|	      x = x * 10 + (c - '0');
  596|  41.4k|	    } else {
  597|  41.4k|	      break;
  598|  41.4k|	    }
  599|  10.1k|	    ++parsePtr;
  600|  10.1k|	  }
  601|  41.4k|	  if (parsePtr < parseEnd && *parsePtr == ';') {
  ------------------
  |  Branch (601:8): [True: 41.4k, False: 6]
  |  Branch (601:31): [True: 340, False: 41.1k]
  ------------------
  602|    340|	    ++parsePtr;
  603|    340|	  }
  604|  41.4k|	  appendUTF8(data, x);
  605|  41.4k|	}
  606|  60.5k|      } else {
  607|  60.5k|	start = parsePtr;
  608|  60.5k|	for (++parsePtr;
  609|  3.90M|	     parsePtr < parseEnd && *parsePtr != ';' &&
  ------------------
  |  Branch (609:7): [True: 3.90M, False: 61]
  |  Branch (609:30): [True: 3.90M, False: 608]
  ------------------
  610|  3.90M|	       *parsePtr != '<' && *parsePtr != '&';
  ------------------
  |  Branch (610:9): [True: 3.88M, False: 19.1k]
  |  Branch (610:29): [True: 3.84M, False: 40.7k]
  ------------------
  611|  3.84M|	     ++parsePtr) ;
  612|  60.5k|	n = (int)(parsePtr - start);
  613|  60.5k|	if (parsePtr < parseEnd && *parsePtr == ';') {
  ------------------
  |  Branch (613:6): [True: 60.4k, False: 61]
  |  Branch (613:29): [True: 608, False: 59.8k]
  ------------------
  614|    608|	  ++parsePtr;
  615|    608|	}
  616|  60.5k|	if (n == 2 && !strncmp(start, "lt", 2)) {
  ------------------
  |  Branch (616:6): [True: 3.37k, False: 57.1k]
  |  Branch (616:16): [True: 471, False: 2.90k]
  ------------------
  617|    471|	  data->append('<');
  618|  60.0k|	} else if (n == 2 && !strncmp(start, "gt", 2)) {
  ------------------
  |  Branch (618:13): [True: 2.90k, False: 57.1k]
  |  Branch (618:23): [True: 282, False: 2.62k]
  ------------------
  619|    282|	  data->append('>');
  620|  59.7k|	} else if (n == 3 && !strncmp(start, "amp", 3)) {
  ------------------
  |  Branch (620:13): [True: 2.11k, False: 57.6k]
  |  Branch (620:23): [True: 109, False: 2.00k]
  ------------------
  621|    109|	  data->append('&');
  622|  59.6k|	} else if (n == 4 && !strncmp(start, "apos", 4)) {
  ------------------
  |  Branch (622:13): [True: 2.91k, False: 56.7k]
  |  Branch (622:23): [True: 0, False: 2.91k]
  ------------------
  623|      0|	  data->append('\'');
  624|  59.6k|	} else if (n == 4 && !strncmp(start, "quot", 4)) {
  ------------------
  |  Branch (624:13): [True: 2.91k, False: 56.7k]
  |  Branch (624:23): [True: 0, False: 2.91k]
  ------------------
  625|      0|	  data->append('"');
  626|  59.6k|	} else {
  627|  59.6k|	  data->append(start - 1, (int)(parsePtr - start) + 1);
  628|  59.6k|	}
  629|  60.5k|      }
  630|   931k|    } else {
  631|   931k|      start = parsePtr;
  632|   931k|      for (++parsePtr;
  633|  26.8M|	   parsePtr < parseEnd && *parsePtr != '<' && *parsePtr != '&';
  ------------------
  |  Branch (633:5): [True: 26.8M, False: 425]
  |  Branch (633:28): [True: 25.9M, False: 868k]
  |  Branch (633:48): [True: 25.8M, False: 62.4k]
  ------------------
  634|  25.8M|	   ++parsePtr) ;
  635|   931k|      data->append(start, (int)(parsePtr - start));
  636|   931k|    }
  637|  1.04M|  }
  638|   890k|  par->addChild(new ZxCharData(data, true));
  639|   890k|}
_ZN5ZxDoc10appendUTF8EP7GStringj:
  641|  74.1k|void ZxDoc::appendUTF8(GString *s, unsigned int c) {
  642|  74.1k|  if (c <= 0x7f) {
  ------------------
  |  Branch (642:7): [True: 69.1k, False: 4.99k]
  ------------------
  643|  69.1k|    s->append((char)c);
  644|  69.1k|  } else if (c <= 0x7ff) {
  ------------------
  |  Branch (644:14): [True: 1.33k, False: 3.65k]
  ------------------
  645|  1.33k|    s->append((char)(0xc0 + (c >> 6)));
  646|  1.33k|    s->append((char)(0x80 + (c & 0x3f)));
  647|  3.65k|  } else if (c <= 0xffff) {
  ------------------
  |  Branch (647:14): [True: 1.52k, False: 2.13k]
  ------------------
  648|  1.52k|    s->append((char)(0xe0 + (c >> 12)));
  649|  1.52k|    s->append((char)(0x80 + ((c >> 6) & 0x3f)));
  650|  1.52k|    s->append((char)(0x80 + (c & 0x3f)));
  651|  2.13k|  } else if (c <= 0x1fffff) {
  ------------------
  |  Branch (651:14): [True: 976, False: 1.16k]
  ------------------
  652|    976|    s->append((char)(0xf0 + (c >> 18)));
  653|    976|    s->append((char)(0x80 + ((c >> 12) & 0x3f)));
  654|    976|    s->append((char)(0x80 + ((c >> 6) & 0x3f)));
  655|    976|    s->append((char)(0x80 + (c & 0x3f)));
  656|  1.16k|  } else if (c <= 0x3ffffff) {
  ------------------
  |  Branch (656:14): [True: 347, False: 814]
  ------------------
  657|    347|    s->append((char)(0xf8 + (c >> 24)));
  658|    347|    s->append((char)(0x80 + ((c >> 18) & 0x3f)));
  659|    347|    s->append((char)(0x80 + ((c >> 12) & 0x3f)));
  660|    347|    s->append((char)(0x80 + ((c >> 6) & 0x3f)));
  661|    347|    s->append((char)(0x80 + (c & 0x3f)));
  662|    814|  } else if (c <= 0x7fffffff) {
  ------------------
  |  Branch (662:14): [True: 374, False: 440]
  ------------------
  663|    374|    s->append((char)(0xfc + (c >> 30)));
  664|    374|    s->append((char)(0x80 + ((c >> 24) & 0x3f)));
  665|    374|    s->append((char)(0x80 + ((c >> 18) & 0x3f)));
  666|    374|    s->append((char)(0x80 + ((c >> 12) & 0x3f)));
  667|    374|    s->append((char)(0x80 + ((c >> 6) & 0x3f)));
  668|    374|    s->append((char)(0x80 + (c & 0x3f)));
  669|    374|  }
  670|  74.1k|}
_ZN5ZxDoc11parseCDSectEP6ZxNode:
  673|     48|void ZxDoc::parseCDSect(ZxNode *par) {
  674|     48|  const char *start;
  675|       |
  676|     48|  parsePtr += 9;
  677|     48|  start = parsePtr;
  678|  99.0k|  while (parsePtr < parseEnd - 3) {
  ------------------
  |  Branch (678:10): [True: 99.0k, False: 7]
  ------------------
  679|  99.0k|    if (!strncmp(parsePtr, "]]>", 3)) {
  ------------------
  |  Branch (679:9): [True: 41, False: 99.0k]
  ------------------
  680|     41|      par->addChild(new ZxCharData(new GString(start, (int)(parsePtr - start)),
  681|     41|				   false));
  682|     41|      parsePtr += 3;
  683|     41|      return;
  684|     41|    }
  685|  99.0k|    ++parsePtr;
  686|  99.0k|  }
  687|      7|  parsePtr = parseEnd;
  688|      7|  par->addChild(new ZxCharData(new GString(start, (int)(parsePtr - start)),
  689|      7|			       false));
  690|      7|}
_ZN5ZxDoc9parseMiscEP6ZxNode:
  692|  3.59k|void ZxDoc::parseMisc(ZxNode *par) {
  693|  12.9k|  while (1) {
  ------------------
  |  Branch (693:10): [True: 12.9k, Folded]
  ------------------
  694|  12.9k|    if (match("<!--")) {
  ------------------
  |  Branch (694:9): [True: 136, False: 12.7k]
  ------------------
  695|    136|      parseComment(par);
  696|  12.7k|    } else if (match("<?")) {
  ------------------
  |  Branch (696:16): [True: 247, False: 12.5k]
  ------------------
  697|    247|      parsePI(par);
  698|  12.5k|    } else if (parsePtr < parseEnd && (*parsePtr == '\x20' ||
  ------------------
  |  Branch (698:16): [True: 11.5k, False: 961]
  |  Branch (698:40): [True: 2.25k, False: 9.32k]
  ------------------
  699|  9.32k|				       *parsePtr == '\x09' ||
  ------------------
  |  Branch (699:12): [True: 3.67k, False: 5.65k]
  ------------------
  700|  5.65k|				       *parsePtr == '\x0d' ||
  ------------------
  |  Branch (700:12): [True: 1.22k, False: 4.42k]
  ------------------
  701|  8.94k|				       *parsePtr == '\x0a')) {
  ------------------
  |  Branch (701:12): [True: 1.78k, False: 2.63k]
  ------------------
  702|  8.94k|      ++parsePtr;
  703|  8.94k|    } else {
  704|  3.59k|      break;
  705|  3.59k|    }
  706|  12.9k|  }
  707|  3.59k|}
_ZN5ZxDoc12parseCommentEP6ZxNode:
  710|  2.37k|void ZxDoc::parseComment(ZxNode *par) {
  711|  2.37k|  const char *start;
  712|       |
  713|  2.37k|  parsePtr += 4;
  714|  2.37k|  start = parsePtr;
  715|   451k|  while (parsePtr <= parseEnd - 3) {
  ------------------
  |  Branch (715:10): [True: 451k, False: 25]
  ------------------
  716|   451k|    if (!strncmp(parsePtr, "-->", 3)) {
  ------------------
  |  Branch (716:9): [True: 2.35k, False: 449k]
  ------------------
  717|  2.35k|      par->addChild(new ZxComment(new GString(start, (int)(parsePtr - start))));
  718|  2.35k|      parsePtr += 3;
  719|  2.35k|      return;
  720|  2.35k|    }
  721|   449k|    ++parsePtr;
  722|   449k|  }
  723|     25|  parsePtr = parseEnd;
  724|     25|}
_ZN5ZxDoc7parsePIEP6ZxNode:
  727|  30.8k|void ZxDoc::parsePI(ZxNode *par) {
  728|  30.8k|  GString *target;
  729|  30.8k|  const char *start;
  730|       |
  731|  30.8k|  parsePtr += 2;
  732|  30.8k|  target = parseName();
  733|  30.8k|  parseSpace();
  734|  30.8k|  start = parsePtr;
  735|  1.93M|  while (parsePtr <= parseEnd - 2) {
  ------------------
  |  Branch (735:10): [True: 1.93M, False: 75]
  ------------------
  736|  1.93M|    if (!strncmp(parsePtr, "?>", 2)) {
  ------------------
  |  Branch (736:9): [True: 30.7k, False: 1.90M]
  ------------------
  737|  30.7k|      par->addChild(new ZxPI(target, new GString(start,
  738|  30.7k|						 (int)(parsePtr - start))));
  739|  30.7k|      parsePtr += 2;
  740|  30.7k|      return;
  741|  30.7k|    }
  742|  1.90M|    ++parsePtr;
  743|  1.90M|  }
  744|     75|  parsePtr = parseEnd;
  745|     75|  par->addChild(new ZxPI(target, new GString(start, (int)(parsePtr - start))));
  746|     75|}
_ZN5ZxDoc9parseNameEv:
  750|  2.82M|GString *ZxDoc::parseName() {
  751|  2.82M|  GString *name;
  752|       |
  753|  2.82M|  name = new GString();
  754|  2.82M|  if (parsePtr < parseEnd && nameStartChar[*parsePtr & 0xff]) {
  ------------------
  |  Branch (754:7): [True: 2.82M, False: 135]
  |  Branch (754:30): [True: 1.31M, False: 1.50M]
  ------------------
  755|  1.31M|    name->append(*parsePtr++);
  756|  5.44M|    while (parsePtr < parseEnd && nameChar[*parsePtr & 0xff]) {
  ------------------
  |  Branch (756:12): [True: 5.44M, False: 23]
  |  Branch (756:35): [True: 4.12M, False: 1.31M]
  ------------------
  757|  4.12M|      name->append(*parsePtr++);
  758|  4.12M|    }
  759|  1.31M|  }
  760|  2.82M|  return name;
  761|  2.82M|}
_ZN5ZxDoc17parseQuotedStringEv:
  763|    799|GString *ZxDoc::parseQuotedString() {
  764|    799|  GString *s;
  765|    799|  const char *start;
  766|    799|  char quote;
  767|       |
  768|    799|  if (parsePtr < parseEnd && (*parsePtr == '"' || *parsePtr == '\'')) {
  ------------------
  |  Branch (768:7): [True: 793, False: 6]
  |  Branch (768:31): [True: 696, False: 97]
  |  Branch (768:51): [True: 46, False: 51]
  ------------------
  769|    742|    quote = *parsePtr++;
  770|    742|    start = parsePtr;
  771|  33.8k|    while (parsePtr < parseEnd && *parsePtr != quote) {
  ------------------
  |  Branch (771:12): [True: 33.8k, False: 1]
  |  Branch (771:35): [True: 33.1k, False: 741]
  ------------------
  772|  33.1k|      ++parsePtr;
  773|  33.1k|    }
  774|    742|    s = new GString(start, (int)(parsePtr - start));
  775|    742|    if (parsePtr < parseEnd && *parsePtr == quote) {
  ------------------
  |  Branch (775:9): [True: 741, False: 1]
  |  Branch (775:32): [True: 741, False: 0]
  ------------------
  776|    741|      ++parsePtr;
  777|    741|    }
  778|    742|  } else {
  779|     57|    s = new GString();
  780|     57|  }
  781|    799|  return s;
  782|    799|}
_ZN5ZxDoc8parseBOMEv:
  784|  1.19k|void ZxDoc::parseBOM() {
  785|  1.19k|  if (match("\xef\xbb\xbf")) {
  ------------------
  |  Branch (785:7): [True: 25, False: 1.17k]
  ------------------
  786|     25|    parsePtr += 3;
  787|     25|  }
  788|  1.19k|}
_ZN5ZxDoc10parseSpaceEv:
  790|  3.29M|void ZxDoc::parseSpace() {
  791|  4.48M|  while (parsePtr < parseEnd && (*parsePtr == '\x20' ||
  ------------------
  |  Branch (791:10): [True: 4.48M, False: 366]
  |  Branch (791:34): [True: 831k, False: 3.65M]
  ------------------
  792|  3.65M|				 *parsePtr == '\x09' ||
  ------------------
  |  Branch (792:6): [True: 15.0k, False: 3.63M]
  ------------------
  793|  3.63M|				 *parsePtr == '\x0d' ||
  ------------------
  |  Branch (793:6): [True: 51.8k, False: 3.58M]
  ------------------
  794|  3.58M|				 *parsePtr == '\x0a')) {
  ------------------
  |  Branch (794:6): [True: 291k, False: 3.29M]
  ------------------
  795|  1.19M|    ++parsePtr;
  796|  1.19M|  }
  797|  3.29M|}
_ZN5ZxDoc5matchEPKc:
  799|  15.3M|bool ZxDoc::match(const char *s) {
  800|  15.3M|  int n;
  801|       |
  802|  15.3M|  n = (int)strlen(s);
  803|  15.3M|  return parseEnd - parsePtr >= n && !strncmp(parsePtr, s, n);
  ------------------
  |  Branch (803:10): [True: 15.3M, False: 3.26k]
  |  Branch (803:38): [True: 2.17M, False: 13.1M]
  ------------------
  804|  15.3M|}
_ZN9ZxXMLDeclC2EP7GStringS1_b:
  822|    484|ZxXMLDecl::ZxXMLDecl(GString *versionA, GString *encodingA, bool standaloneA) {
  823|    484|  version = versionA;
  824|    484|  encoding = encodingA;
  825|    484|  standalone = standaloneA;
  826|    484|}
_ZN9ZxXMLDeclD2Ev:
  828|    484|ZxXMLDecl::~ZxXMLDecl() {
  829|    484|  delete version;
  830|    484|  if (encoding) {
  ------------------
  |  Branch (830:7): [True: 312, False: 172]
  ------------------
  831|    312|    delete encoding;
  832|    312|  }
  833|    484|}
_ZN13ZxDocTypeDeclC2EP7GString:
  858|     88|ZxDocTypeDecl::ZxDocTypeDecl(GString *nameA) {
  859|     88|  name = nameA;
  860|     88|}
_ZN13ZxDocTypeDeclD2Ev:
  862|     88|ZxDocTypeDecl::~ZxDocTypeDecl() {
  863|     88|  delete name;
  864|     88|}
_ZN9ZxCommentC2EP7GString:
  880|  2.35k|ZxComment::ZxComment(GString *textA) {
  881|  2.35k|  text = textA;
  882|  2.35k|}
_ZN9ZxCommentD2Ev:
  884|  2.35k|ZxComment::~ZxComment() {
  885|  2.35k|  delete text;
  886|  2.35k|}
_ZN4ZxPIC2EP7GStringS1_:
  902|  30.8k|ZxPI::ZxPI(GString *targetA, GString *textA) {
  903|  30.8k|  target = targetA;
  904|  30.8k|  text = textA;
  905|  30.8k|}
_ZN4ZxPID2Ev:
  907|  30.8k|ZxPI::~ZxPI() {
  908|  30.8k|  delete target;
  909|  30.8k|  delete text;
  910|  30.8k|}
_ZN9ZxElementC2EP7GString:
  928|  1.30M|ZxElement::ZxElement(GString *typeA) {
  929|  1.30M|  type = typeA;
  930|  1.30M|  attrs = new GHash();
  931|       |  firstAttr = lastAttr = NULL;
  932|  1.30M|}
_ZN9ZxElementD2Ev:
  934|  1.30M|ZxElement::~ZxElement() {
  935|  1.30M|  delete type;
  936|  1.30M|  deleteGHash(attrs, ZxAttr);
  ------------------
  |  |   60|  1.30M|  do {                                             \
  |  |   61|  1.30M|    GHash *_hash = (hash);                         \
  |  |   62|  1.30M|    {                                              \
  |  |   63|  1.30M|      GHashIter *_iter;                            \
  |  |   64|  1.30M|      GString *_key;                               \
  |  |   65|  1.30M|      void *_p;                                    \
  |  |   66|  1.30M|      _hash->startIter(&_iter);                    \
  |  |   67|  1.48M|      while (_hash->getNext(&_iter, &_key, &_p)) { \
  |  |  ------------------
  |  |  |  Branch (67:14): [True: 173k, False: 1.30M]
  |  |  ------------------
  |  |   68|   173k|        delete (T*)_p;                             \
  |  |   69|   173k|      }                                            \
  |  |   70|  1.30M|      delete _hash;                                \
  |  |   71|  1.30M|    }                                              \
  |  |   72|  1.30M|  } while(0)
  |  |  ------------------
  |  |  |  Branch (72:11): [Folded, False: 1.30M]
  |  |  ------------------
  ------------------
  937|  1.30M|}
_ZN9ZxElement9isElementEPKc:
  939|  1.84M|bool ZxElement::isElement(const char *typeA) {
  940|  1.84M|  return !type->cmp(typeA);
  941|  1.84M|}
_ZN9ZxElement8findAttrEPKc:
  943|   386k|ZxAttr *ZxElement::findAttr(const char *attrName) {
  944|   386k|  return (ZxAttr *)attrs->lookup(attrName);
  945|   386k|}
_ZN9ZxElement7addAttrEP6ZxAttr:
  947|   173k|void ZxElement::addAttr(ZxAttr *attr) {
  948|   173k|  attrs->add(attr->getName(), attr);
  949|   173k|  if (lastAttr) {
  ------------------
  |  Branch (949:7): [True: 63.2k, False: 109k]
  ------------------
  950|  63.2k|    lastAttr->next = attr;
  951|  63.2k|    lastAttr= attr;
  952|   109k|  } else {
  953|   109k|    firstAttr = lastAttr = attr;
  954|   109k|  }
  955|   173k|  attr->parent = this;
  956|       |  attr->next = NULL;
  957|   173k|}
_ZN6ZxAttrC2EP7GStringS1_:
 1025|   173k|ZxAttr::ZxAttr(GString *nameA, GString *valueA) {
 1026|   173k|  name = nameA;
 1027|   173k|  value = valueA;
 1028|   173k|  parent = NULL;
 1029|       |  next = NULL;
 1030|   173k|}
_ZN6ZxAttrD2Ev:
 1032|   173k|ZxAttr::~ZxAttr() {
 1033|   173k|  delete name;
 1034|   173k|  delete value;
 1035|   173k|}
_ZN10ZxCharDataC2EP7GStringb:
 1039|   890k|ZxCharData::ZxCharData(GString *dataA, bool parsedA) {
 1040|   890k|  data = dataA;
 1041|   890k|  parsed = parsedA;
 1042|   890k|}
_ZN10ZxCharDataD2Ev:
 1044|   890k|ZxCharData::~ZxCharData() {
 1045|   890k|  delete data;
 1046|   890k|}

_ZN5ZxDoc7getRootEv:
   88|  3.16k|  ZxElement *getRoot() { return root; }
_ZN10ZxCharData7getDataEv:
  257|  3.79k|  GString *getData() { return data; }
_ZN6ZxAttr8getValueEv:
  234|  56.7k|  GString *getValue() { return value; }
_ZN9ZxElement7getTypeEv:
  209|   538k|  GString *getType() { return type; }
_ZN6ZxNode9isXMLDeclEv:
   36|  1.24k|  virtual bool isXMLDecl()  { return false; }
_ZN6ZxNode13isDocTypeDeclEv:
   37|  1.16k|  virtual bool isDocTypeDecl() { return false; }
_ZN6ZxNode9isElementEv:
   40|   185k|  virtual bool isElement() { return false; }
_ZN6ZxNode9isElementEPKc:
   41|   246k|  virtual bool isElement(const char *type) { return false; }
_ZN6ZxNode10isCharDataEv:
   42|  1.34k|  virtual bool isCharData() { return false; }
_ZN6ZxNode13getFirstChildEv:
   43|   209k|  virtual ZxNode *getFirstChild() { return firstChild; }
_ZN6ZxNode12getNextChildEv:
   44|   497k|  virtual ZxNode *getNextChild() { return next; }
_ZN9ZxXMLDecl9isXMLDeclEv:
  129|    484|  virtual bool isXMLDecl() { return true; }
_ZN13ZxDocTypeDecl13isDocTypeDeclEv:
  151|     88|  virtual bool isDocTypeDecl() { return true; }
_ZN9ZxElement9isElementEv:
  207|   318k|  virtual bool isElement() { return true; }
_ZN6ZxAttr7getNameEv:
  233|   173k|  GString *getName() { return name; }
_ZN10ZxCharData10isCharDataEv:
  256|  3.79k|  virtual bool isCharData() { return true; }

