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

_ZN5GHashC2Ei:
   34|  1.08M|GHash::GHash(GBool deleteKeysA) {
   35|  1.08M|  int h;
   36|       |
   37|  1.08M|  deleteKeys = deleteKeysA;
   38|  1.08M|  size = 7;
   39|  1.08M|  tab = (GHashBucket **)gmallocn(size, sizeof(GHashBucket *));
   40|  8.66M|  for (h = 0; h < size; ++h) {
  ------------------
  |  Branch (40:15): [True: 7.58M, False: 1.08M]
  ------------------
   41|       |    tab[h] = NULL;
   42|  7.58M|  }
   43|  1.08M|  len = 0;
   44|  1.08M|}
_ZN5GHashD2Ev:
   46|  1.08M|GHash::~GHash() {
   47|  1.08M|  GHashBucket *p;
   48|  1.08M|  int h;
   49|       |
   50|  8.67M|  for (h = 0; h < size; ++h) {
  ------------------
  |  Branch (50:15): [True: 7.59M, False: 1.08M]
  ------------------
   51|  7.74M|    while (tab[h]) {
  ------------------
  |  Branch (51:12): [True: 150k, False: 7.59M]
  ------------------
   52|   150k|      p = tab[h];
   53|   150k|      tab[h] = p->next;
   54|   150k|      if (deleteKeys) {
  ------------------
  |  Branch (54:11): [True: 8.34k, False: 142k]
  ------------------
   55|  8.34k|	delete p->key;
   56|  8.34k|      }
   57|   150k|      delete p;
   58|   150k|    }
   59|  7.59M|  }
   60|  1.08M|  gfree(tab);
   61|  1.08M|}
_ZN5GHash3addEP7GStringPv:
   63|   133k|void GHash::add(GString *key, void *val) {
   64|   133k|  GHashBucket *p;
   65|   133k|  int h;
   66|       |
   67|       |  // expand the table if necessary
   68|   133k|  if (len >= size) {
  ------------------
  |  Branch (68:7): [True: 671, False: 132k]
  ------------------
   69|    671|    expand();
   70|    671|  }
   71|       |
   72|       |  // add the new symbol
   73|   133k|  p = new GHashBucket;
   74|   133k|  p->key = key;
   75|   133k|  p->val.p = val;
   76|   133k|  h = hash(key);
   77|   133k|  p->next = tab[h];
   78|   133k|  tab[h] = p;
   79|   133k|  ++len;
   80|   133k|}
_ZN5GHash3addEP7GStringi:
   82|  17.4k|void GHash::add(GString *key, int val) {
   83|  17.4k|  GHashBucket *p;
   84|  17.4k|  int h;
   85|       |
   86|       |  // expand the table if necessary
   87|  17.4k|  if (len >= size) {
  ------------------
  |  Branch (87:7): [True: 216, False: 17.2k]
  ------------------
   88|    216|    expand();
   89|    216|  }
   90|       |
   91|       |  // add the new symbol
   92|  17.4k|  p = new GHashBucket;
   93|  17.4k|  p->key = key;
   94|  17.4k|  p->val.i = val;
   95|  17.4k|  h = hash(key);
   96|  17.4k|  p->next = tab[h];
   97|  17.4k|  tab[h] = p;
   98|  17.4k|  ++len;
   99|  17.4k|}
_ZN5GHash7replaceEP7GStringi:
  115|  25.2k|void GHash::replace(GString *key, int val) {
  116|  25.2k|  GHashBucket *p;
  117|  25.2k|  int h;
  118|       |
  119|  25.2k|  if ((p = find(key, &h))) {
  ------------------
  |  Branch (119:7): [True: 7.76k, False: 17.4k]
  ------------------
  120|  7.76k|    p->val.i = val;
  121|  7.76k|    if (deleteKeys) {
  ------------------
  |  Branch (121:9): [True: 0, False: 7.76k]
  ------------------
  122|      0|      delete key;
  123|      0|    }
  124|  17.4k|  } else {
  125|  17.4k|    add(key, val);
  126|  17.4k|  }
  127|  25.2k|}
_ZN5GHash6lookupEP7GString:
  129|  2.05k|void *GHash::lookup(GString *key) {
  130|  2.05k|  GHashBucket *p;
  131|  2.05k|  int h;
  132|       |
  133|  2.05k|  if (!(p = find(key, &h))) {
  ------------------
  |  Branch (133:7): [True: 2.04k, False: 14]
  ------------------
  134|  2.04k|    return NULL;
  135|  2.04k|  }
  136|     14|  return p->val.p;
  137|  2.05k|}
_ZN5GHash9lookupIntEP7GString:
  139|  25.2k|int GHash::lookupInt(GString *key) {
  140|  25.2k|  GHashBucket *p;
  141|  25.2k|  int h;
  142|       |
  143|  25.2k|  if (!(p = find(key, &h))) {
  ------------------
  |  Branch (143:7): [True: 17.4k, False: 7.76k]
  ------------------
  144|  17.4k|    return 0;
  145|  17.4k|  }
  146|  7.76k|  return p->val.i;
  147|  25.2k|}
_ZN5GHash6lookupEPKc:
  149|   801k|void *GHash::lookup(const char *key) {
  150|   801k|  GHashBucket *p;
  151|   801k|  int h;
  152|       |
  153|   801k|  if (!(p = find(key, &h))) {
  ------------------
  |  Branch (153:7): [True: 776k, False: 25.7k]
  ------------------
  154|   776k|    return NULL;
  155|   776k|  }
  156|  25.7k|  return p->val.p;
  157|   801k|}
_ZN5GHash9startIterEPP9GHashIter:
  261|  1.04M|void GHash::startIter(GHashIter **iter) {
  262|  1.04M|  *iter = new GHashIter;
  263|  1.04M|  (*iter)->h = -1;
  264|       |  (*iter)->p = NULL;
  265|  1.04M|}
_ZN5GHash7getNextEPP9GHashIterPP7GStringPPv:
  267|  1.18M|GBool GHash::getNext(GHashIter **iter, GString **key, void **val) {
  268|  1.18M|  if (!*iter) {
  ------------------
  |  Branch (268:7): [True: 0, False: 1.18M]
  ------------------
  269|      0|    return gFalse;
  ------------------
  |  |   18|      0|#define gFalse 0
  ------------------
  270|      0|  }
  271|  1.18M|  if ((*iter)->p) {
  ------------------
  |  Branch (271:7): [True: 133k, False: 1.04M]
  ------------------
  272|   133k|    (*iter)->p = (*iter)->p->next;
  273|   133k|  }
  274|  8.53M|  while (!(*iter)->p) {
  ------------------
  |  Branch (274:10): [True: 8.40M, False: 133k]
  ------------------
  275|  8.40M|    if (++(*iter)->h == size) {
  ------------------
  |  Branch (275:9): [True: 1.04M, False: 7.35M]
  ------------------
  276|  1.04M|      delete *iter;
  277|  1.04M|      *iter = NULL;
  278|  1.04M|      return gFalse;
  ------------------
  |  |   18|  1.04M|#define gFalse 0
  ------------------
  279|  1.04M|    }
  280|  7.35M|    (*iter)->p = tab[(*iter)->h];
  281|  7.35M|  }
  282|   133k|  *key = (*iter)->p->key;
  283|   133k|  *val = (*iter)->p->val.p;
  284|   133k|  return gTrue;
  ------------------
  |  |   17|   133k|#define gTrue 1
  ------------------
  285|  1.18M|}
_ZN5GHash6expandEv:
  312|    887|void GHash::expand() {
  313|    887|  GHashBucket **oldTab;
  314|    887|  GHashBucket *p;
  315|    887|  int oldSize, h, i;
  316|       |
  317|    887|  oldSize = size;
  318|    887|  oldTab = tab;
  319|    887|  size = 2*size + 1;
  320|    887|  tab = (GHashBucket **)gmallocn(size, sizeof(GHashBucket *));
  321|  22.4k|  for (h = 0; h < size; ++h) {
  ------------------
  |  Branch (321:15): [True: 21.5k, False: 887]
  ------------------
  322|  21.5k|    tab[h] = NULL;
  323|  21.5k|  }
  324|  11.2k|  for (i = 0; i < oldSize; ++i) {
  ------------------
  |  Branch (324:15): [True: 10.3k, False: 887]
  ------------------
  325|  20.6k|    while (oldTab[i]) {
  ------------------
  |  Branch (325:12): [True: 10.3k, False: 10.3k]
  ------------------
  326|  10.3k|      p = oldTab[i];
  327|  10.3k|      oldTab[i] = oldTab[i]->next;
  328|  10.3k|      h = hash(p->key);
  329|  10.3k|      p->next = tab[h];
  330|  10.3k|      tab[h] = p;
  331|  10.3k|    }
  332|  10.3k|  }
  333|    887|  gfree(oldTab);
  334|    887|}
_ZN5GHash4findEP7GStringPi:
  336|  52.5k|GHashBucket *GHash::find(GString *key, int *h) {
  337|  52.5k|  GHashBucket *p;
  338|       |
  339|  52.5k|  *h = hash(key);
  340|  60.2k|  for (p = tab[*h]; p; p = p->next) {
  ------------------
  |  Branch (340:21): [True: 23.2k, False: 37.0k]
  ------------------
  341|  23.2k|    if (!p->key->cmp(key)) {
  ------------------
  |  Branch (341:9): [True: 15.5k, False: 7.73k]
  ------------------
  342|  15.5k|      return p;
  343|  15.5k|    }
  344|  23.2k|  }
  345|  37.0k|  return NULL;
  346|  52.5k|}
_ZN5GHash4findEPKcPi:
  348|   801k|GHashBucket *GHash::find(const char *key, int *h) {
  349|   801k|  GHashBucket *p;
  350|       |
  351|   801k|  *h = hash(key);
  352|   807k|  for (p = tab[*h]; p; p = p->next) {
  ------------------
  |  Branch (352:21): [True: 31.8k, False: 776k]
  ------------------
  353|  31.8k|    if (!p->key->cmp(key)) {
  ------------------
  |  Branch (353:9): [True: 25.7k, False: 6.09k]
  ------------------
  354|  25.7k|      return p;
  355|  25.7k|    }
  356|  31.8k|  }
  357|   776k|  return NULL;
  358|   801k|}
_ZN5GHash4hashEP7GString:
  360|   213k|int GHash::hash(GString *key) {
  361|   213k|  const char *p;
  362|   213k|  unsigned int h;
  363|   213k|  int i;
  364|       |
  365|   213k|  h = 0;
  366|  39.3M|  for (p = key->getCString(), i = 0; i < key->getLength(); ++p, ++i) {
  ------------------
  |  Branch (366:38): [True: 39.1M, False: 213k]
  ------------------
  367|  39.1M|    h = 17 * h + (int)(*p & 0xff);
  368|  39.1M|  }
  369|   213k|  return (int)(h % size);
  370|   213k|}
_ZN5GHash4hashEPKc:
  372|   801k|int GHash::hash(const char *key) {
  373|   801k|  const char *p;
  374|   801k|  unsigned int h;
  375|       |
  376|   801k|  h = 0;
  377|  7.29M|  for (p = key; *p; ++p) {
  ------------------
  |  Branch (377:17): [True: 6.49M, False: 801k]
  ------------------
  378|  6.49M|    h = 17 * h + (int)(*p & 0xff);
  379|  6.49M|  }
  380|   801k|  return (int)(h % size);
  381|   801k|}

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

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

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

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

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

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

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

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

_ZN8AcroForm4loadEP6PDFDocP7CatalogP6Object:
  337|  1.63k|AcroForm *AcroForm::load(PDFDoc *docA, Catalog *catalog, Object *acroFormObjA) {
  338|  1.63k|  Object acroFormObj2;
  339|  1.63k|  AcroForm *acroForm;
  340|  1.63k|  AcroFormField *field;
  341|  1.63k|  Object xfaObj, fieldsObj, annotsObj, annotRef, annotObj, obj1, obj2;
  342|  1.63k|  char *touchedObjs;
  343|  1.63k|  int pageNum, i, j;
  344|       |
  345|  1.63k|  touchedObjs = (char *)gmalloc(docA->getXRef()->getNumObjects());
  346|  1.63k|  memset(touchedObjs, 0, docA->getXRef()->getNumObjects());
  347|       |
  348|       |  // this is the normal case: acroFormObj is a dictionary, as expected
  349|  1.63k|  if (acroFormObjA->isDict()) {
  ------------------
  |  Branch (349:7): [True: 796, False: 834]
  ------------------
  350|    796|    acroForm = new AcroForm(docA, acroFormObjA);
  351|       |
  352|    796|    if (globalParams->getEnableXFA()) {
  ------------------
  |  Branch (352:9): [True: 796, False: 0]
  ------------------
  353|    796|      if (!acroFormObjA->dictLookup("XFA", &xfaObj)->isNull()) {
  ------------------
  |  Branch (353:11): [True: 654, False: 142]
  ------------------
  354|    654|	acroForm->xfaScanner = XFAScanner::load(&xfaObj);
  355|    654|	if (!catalog->getNeedsRendering()) {
  ------------------
  |  Branch (355:6): [True: 649, False: 5]
  ------------------
  356|    649|	  acroForm->isStaticXFA = gTrue;
  ------------------
  |  |   17|    649|#define gTrue 1
  ------------------
  357|    649|	}
  358|    654|      }
  359|    796|      xfaObj.free();
  360|    796|    }
  361|       |
  362|    796|    if (acroFormObjA->dictLookup("NeedAppearances", &obj1)->isBool()) {
  ------------------
  |  Branch (362:9): [True: 29, False: 767]
  ------------------
  363|     29|      acroForm->needAppearances = obj1.getBool();
  364|     29|    }
  365|    796|    obj1.free();
  366|       |
  367|    796|    acroForm->buildAnnotPageList(catalog);
  368|       |
  369|    796|    if (!acroFormObjA->dictLookup("Fields", &obj1)->isArray()) {
  ------------------
  |  Branch (369:9): [True: 2, False: 794]
  ------------------
  370|      2|      if (!obj1.isNull()) {
  ------------------
  |  Branch (370:11): [True: 0, False: 2]
  ------------------
  371|      0|	error(errSyntaxError, -1, "AcroForm Fields entry is wrong type");
  372|      0|      }
  373|      2|      obj1.free();
  374|      2|      delete acroForm;
  375|      2|      gfree(touchedObjs);
  376|      2|      return NULL;
  377|      2|    }
  378|  14.4k|    for (i = 0; i < obj1.arrayGetLength(); ++i) {
  ------------------
  |  Branch (378:17): [True: 13.6k, False: 794]
  ------------------
  379|  13.6k|      obj1.arrayGetNF(i, &obj2);
  380|  13.6k|      acroForm->scanField(&obj2, touchedObjs);
  381|  13.6k|      obj2.free();
  382|  13.6k|    }
  383|    794|    obj1.free();
  384|       |
  385|       |    // scan the annotations, looking for Widget-type annots that are
  386|       |    // not attached to the AcroForm object
  387|   125k|    for (pageNum = 1; pageNum <= catalog->getNumPages(); ++pageNum) {
  ------------------
  |  Branch (387:23): [True: 124k, False: 794]
  ------------------
  388|   124k|      if (catalog->getPage(pageNum)->getAnnots(&annotsObj)->isArray()) {
  ------------------
  |  Branch (388:11): [True: 123k, False: 1.55k]
  ------------------
  389|  2.66M|	for (i = 0; i < annotsObj.arrayGetLength(); ++i) {
  ------------------
  |  Branch (389:14): [True: 2.54M, False: 123k]
  ------------------
  390|  2.54M|	  if (annotsObj.arrayGetNF(i, &annotRef)->isRef()) {
  ------------------
  |  Branch (390:8): [True: 637k, False: 1.90M]
  ------------------
  391|   803k|	    for (j = 0; j < acroForm->fields->getLength(); ++j) {
  ------------------
  |  Branch (391:18): [True: 256k, False: 546k]
  ------------------
  392|   256k|	      field = (AcroFormField *)acroForm->fields->get(j);
  393|   256k|	      if (field->fieldRef.isRef()) {
  ------------------
  |  Branch (393:12): [True: 235k, False: 21.7k]
  ------------------
  394|   235k|		if (field->fieldRef.getRefNum() == annotRef.getRefNum() &&
  ------------------
  |  Branch (394:7): [True: 120k, False: 114k]
  ------------------
  395|   120k|		    field->fieldRef.getRefGen() == annotRef.getRefGen()) {
  ------------------
  |  Branch (395:7): [True: 90.5k, False: 30.1k]
  ------------------
  396|  90.5k|		  break;
  397|  90.5k|		}
  398|   235k|	      }
  399|   256k|	    }
  400|   637k|	    if (j == acroForm->fields->getLength()) {
  ------------------
  |  Branch (400:10): [True: 546k, False: 90.5k]
  ------------------
  401|   546k|	      annotRef.fetch(acroForm->doc->getXRef(), &annotObj);
  402|   546k|	      if (annotObj.isDict()) {
  ------------------
  |  Branch (402:12): [True: 102k, False: 444k]
  ------------------
  403|   102k|		if (annotObj.dictLookup("Subtype", &obj1)->isName("Widget")) {
  ------------------
  |  Branch (403:7): [True: 57.4k, False: 44.5k]
  ------------------
  404|  57.4k|		  acroForm->scanField(&annotRef, touchedObjs);
  405|  57.4k|		}
  406|   102k|		obj1.free();
  407|   102k|	      }
  408|   546k|	      annotObj.free();
  409|   546k|	    }
  410|   637k|	  }
  411|  2.54M|	  annotRef.free();
  412|  2.54M|	}
  413|   123k|      }
  414|   124k|      annotsObj.free();
  415|   124k|    }
  416|       |
  417|       |  // if acroFormObjA is a null object, but there are Widget-type
  418|       |  // annots, we still create an AcroForm
  419|    834|  } else {
  420|       |    // create an empty dict for acroFormObj
  421|    834|    acroFormObj2.initDict(docA->getXRef());
  422|    834|    acroForm = new AcroForm(docA, &acroFormObj2);
  423|    834|    acroFormObj2.free();
  424|       |
  425|    834|    acroForm->buildAnnotPageList(catalog);
  426|       |
  427|       |    // scan the annotations, looking for any Widget-type annots
  428|  91.3k|    for (pageNum = 1; pageNum <= catalog->getNumPages(); ++pageNum) {
  ------------------
  |  Branch (428:23): [True: 90.4k, False: 834]
  ------------------
  429|  90.4k|      if (catalog->getPage(pageNum)->getAnnots(&annotsObj)->isArray()) {
  ------------------
  |  Branch (429:11): [True: 13.3k, False: 77.0k]
  ------------------
  430|   347k|	for (i = 0; i < annotsObj.arrayGetLength(); ++i) {
  ------------------
  |  Branch (430:14): [True: 333k, False: 13.3k]
  ------------------
  431|   333k|	  if (annotsObj.arrayGetNF(i, &annotRef)->isRef()) {
  ------------------
  |  Branch (431:8): [True: 74.9k, False: 258k]
  ------------------
  432|  74.9k|	    annotRef.fetch(acroForm->doc->getXRef(), &annotObj);
  433|  74.9k|	    if (annotObj.isDict()) {
  ------------------
  |  Branch (433:10): [True: 35.1k, False: 39.7k]
  ------------------
  434|  35.1k|	      if (annotObj.dictLookup("Subtype", &obj1)->isName("Widget")) {
  ------------------
  |  Branch (434:12): [True: 22.2k, False: 12.8k]
  ------------------
  435|  22.2k|		acroForm->scanField(&annotRef, touchedObjs);
  436|  22.2k|	      }
  437|  35.1k|	      obj1.free();
  438|  35.1k|	    }
  439|  74.9k|	    annotObj.free();
  440|  74.9k|	  }
  441|   333k|	  annotRef.free();
  442|   333k|	}
  443|  13.3k|      }
  444|  90.4k|      annotsObj.free();
  445|  90.4k|    }
  446|       |
  447|    834|    if (acroForm->fields->getLength() == 0) {
  ------------------
  |  Branch (447:9): [True: 826, False: 8]
  ------------------
  448|    826|      delete acroForm;
  449|    826|      acroForm = NULL;
  450|    826|    }
  451|    834|  }
  452|       |
  453|  1.62k|  gfree(touchedObjs);
  454|       |
  455|  1.62k|  return acroForm;
  456|  1.63k|}
_ZN8AcroFormC2EP6PDFDocP6Object:
  458|  1.63k|AcroForm::AcroForm(PDFDoc *docA, Object *acroFormObjA) {
  459|  1.63k|  doc = docA;
  460|  1.63k|  acroFormObjA->copy(&acroFormObj);
  461|  1.63k|  needAppearances = gFalse;
  ------------------
  |  |   18|  1.63k|#define gFalse 0
  ------------------
  462|  1.63k|  annotPages = new GList();
  463|  1.63k|  fields = new GList();
  464|  1.63k|  xfaScanner = NULL;
  465|  1.63k|  isStaticXFA = gFalse;
  ------------------
  |  |   18|  1.63k|#define gFalse 0
  ------------------
  466|  1.63k|}
_ZN8AcroFormD2Ev:
  468|  1.63k|AcroForm::~AcroForm() {
  469|  1.63k|  acroFormObj.free();
  470|  1.63k|  deleteGList(annotPages, AcroFormAnnotPage);
  ------------------
  |  |   94|  1.63k|  do {                                              \
  |  |   95|  1.63k|    GList *_list = (list);                          \
  |  |   96|  1.63k|    {                                               \
  |  |   97|  1.63k|      int _i;                                       \
  |  |   98|   713k|      for (_i = 0; _i < _list->getLength(); ++_i) { \
  |  |  ------------------
  |  |  |  Branch (98:20): [True: 711k, False: 1.63k]
  |  |  ------------------
  |  |   99|   711k|        delete (T*)_list->get(_i);                  \
  |  |  100|   711k|      }                                             \
  |  |  101|  1.63k|      delete _list;                                 \
  |  |  102|  1.63k|    }                                               \
  |  |  103|  1.63k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (103:12): [Folded, False: 1.63k]
  |  |  ------------------
  ------------------
  471|  1.63k|  deleteGList(fields, AcroFormField);
  ------------------
  |  |   94|  1.63k|  do {                                              \
  |  |   95|  1.63k|    GList *_list = (list);                          \
  |  |   96|  1.63k|    {                                               \
  |  |   97|  1.63k|      int _i;                                       \
  |  |   98|  2.65k|      for (_i = 0; _i < _list->getLength(); ++_i) { \
  |  |  ------------------
  |  |  |  Branch (98:20): [True: 1.02k, False: 1.63k]
  |  |  ------------------
  |  |   99|  1.02k|        delete (T*)_list->get(_i);                  \
  |  |  100|  1.02k|      }                                             \
  |  |  101|  1.63k|      delete _list;                                 \
  |  |  102|  1.63k|    }                                               \
  |  |  103|  1.63k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (103:12): [Folded, False: 1.63k]
  |  |  ------------------
  ------------------
  472|  1.63k|  delete xfaScanner;
  473|  1.63k|}
_ZN8AcroForm18buildAnnotPageListEP7Catalog:
  479|  1.63k|void AcroForm::buildAnnotPageList(Catalog *catalog) {
  480|  1.63k|  Object annotsObj, annotObj;
  481|  1.63k|  int pageNum, i;
  482|       |
  483|   217k|  for (pageNum = 1; pageNum <= catalog->getNumPages(); ++pageNum) {
  ------------------
  |  Branch (483:21): [True: 215k, False: 1.63k]
  ------------------
  484|   215k|    if (catalog->getPage(pageNum)->getAnnots(&annotsObj)->isArray()) {
  ------------------
  |  Branch (484:9): [True: 136k, False: 78.6k]
  ------------------
  485|  3.01M|      for (i = 0; i < annotsObj.arrayGetLength(); ++i) {
  ------------------
  |  Branch (485:19): [True: 2.87M, False: 136k]
  ------------------
  486|  2.87M|	if (annotsObj.arrayGetNF(i, &annotObj)->isRef()) {
  ------------------
  |  Branch (486:6): [True: 711k, False: 2.16M]
  ------------------
  487|   711k|	  annotPages->append(new AcroFormAnnotPage(annotObj.getRefNum(),
  488|   711k|						   annotObj.getRefGen(),
  489|   711k|						   pageNum));
  490|   711k|	}
  491|  2.87M|	annotObj.free();
  492|  2.87M|      }
  493|   136k|    }
  494|   215k|    annotsObj.free();
  495|   215k|  }
  496|       |  //~ sort the list
  497|  1.63k|}
_ZN8AcroForm9scanFieldEP6ObjectPc:
  518|  94.0k|void AcroForm::scanField(Object *fieldRef, char *touchedObjs) {
  519|  94.0k|  AcroFormField *field;
  520|  94.0k|  Object fieldObj, kidsRef, kidsObj, kidRef, kidObj, subtypeObj;
  521|  94.0k|  GBool isTerminal;
  522|  94.0k|  int i;
  523|       |
  524|       |  // check for an object loop
  525|  94.0k|  if (fieldRef->isRef()) {
  ------------------
  |  Branch (525:7): [True: 81.9k, False: 12.0k]
  ------------------
  526|  81.9k|    if (fieldRef->getRefNum() < 0 ||
  ------------------
  |  Branch (526:9): [True: 0, False: 81.9k]
  ------------------
  527|  81.9k|	fieldRef->getRefNum() >= doc->getXRef()->getNumObjects() ||
  ------------------
  |  Branch (527:2): [True: 140, False: 81.8k]
  ------------------
  528|  81.8k|	touchedObjs[fieldRef->getRefNum()]) {
  ------------------
  |  Branch (528:2): [True: 79.5k, False: 2.30k]
  ------------------
  529|  79.6k|      return;
  530|  79.6k|    }
  531|  2.30k|    touchedObjs[fieldRef->getRefNum()] = 1;
  532|  2.30k|  }
  533|       |
  534|  14.3k|  fieldRef->fetch(doc->getXRef(), &fieldObj);
  535|  14.3k|  if (!fieldObj.isDict()) {
  ------------------
  |  Branch (535:7): [True: 12.4k, False: 1.88k]
  ------------------
  536|  12.4k|    error(errSyntaxError, -1, "AcroForm field object is wrong type");
  537|  12.4k|    fieldObj.free();
  538|  12.4k|    return;
  539|  12.4k|  }
  540|       |
  541|       |  // look for a Kids entry, and check for an object loop there
  542|  1.88k|  if (fieldObj.dictLookupNF("Kids", &kidsRef)->isRef()) {
  ------------------
  |  Branch (542:7): [True: 56, False: 1.83k]
  ------------------
  543|     56|    if (kidsRef.getRefNum() < 0 ||
  ------------------
  |  Branch (543:9): [True: 0, False: 56]
  ------------------
  544|     56|	kidsRef.getRefNum() >= doc->getXRef()->getNumObjects() ||
  ------------------
  |  Branch (544:2): [True: 25, False: 31]
  ------------------
  545|     47|	touchedObjs[kidsRef.getRefNum()]) {
  ------------------
  |  Branch (545:2): [True: 22, False: 9]
  ------------------
  546|     47|      kidsRef.free();
  547|     47|      fieldObj.free();
  548|     47|      return;
  549|     47|    }
  550|      9|    touchedObjs[kidsRef.getRefNum()] = 1;
  551|      9|    kidsRef.fetch(doc->getXRef(), &kidsObj);
  552|  1.83k|  } else {
  553|  1.83k|    kidsRef.copy(&kidsObj);
  554|  1.83k|  }
  555|  1.84k|  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|  1.84k|  isTerminal = gTrue;
  ------------------
  |  |   17|  1.84k|#define gTrue 1
  ------------------
  562|  1.84k|  if (kidsObj.isArray()) {
  ------------------
  |  Branch (562:7): [True: 106, False: 1.73k]
  ------------------
  563|    106|    isTerminal = gFalse;
  ------------------
  |  |   18|    106|#define gFalse 0
  ------------------
  564|  1.80k|    for (i = 0; !isTerminal && i < kidsObj.arrayGetLength(); ++i) {
  ------------------
  |  Branch (564:17): [True: 1.76k, False: 35]
  |  Branch (564:32): [True: 1.69k, False: 71]
  ------------------
  565|  1.69k|      kidsObj.arrayGet(i, &kidObj);
  566|  1.69k|      if (kidObj.isDict()) {
  ------------------
  |  Branch (566:11): [True: 219, False: 1.47k]
  ------------------
  567|    219|	if (kidObj.dictLookup("Parent", &subtypeObj)->isNull()) {
  ------------------
  |  Branch (567:6): [True: 35, False: 184]
  ------------------
  568|     35|	  isTerminal = gTrue;
  ------------------
  |  |   17|     35|#define gTrue 1
  ------------------
  569|     35|	}
  570|    219|	subtypeObj.free();
  571|    219|      }
  572|  1.69k|      kidObj.free();
  573|  1.69k|    }
  574|    106|    if (!isTerminal) {
  ------------------
  |  Branch (574:9): [True: 71, False: 35]
  ------------------
  575|    722|      for (i = 0; !isTerminal && i < kidsObj.arrayGetLength(); ++i) {
  ------------------
  |  Branch (575:19): [True: 722, False: 0]
  |  Branch (575:34): [True: 651, False: 71]
  ------------------
  576|    651|	kidsObj.arrayGetNF(i, &kidRef);
  577|    651|	scanField(&kidRef, touchedObjs);
  578|    651|	kidRef.free();
  579|    651|      }
  580|     71|    }
  581|    106|  }
  582|  1.84k|  kidsObj.free();
  583|       |
  584|  1.84k|  if (isTerminal) {
  ------------------
  |  Branch (584:7): [True: 1.77k, False: 71]
  ------------------
  585|  1.77k|    if ((field = AcroFormField::load(this, fieldRef))) {
  ------------------
  |  Branch (585:9): [True: 1.02k, False: 741]
  ------------------
  586|  1.02k|      fields->append(field);
  587|  1.02k|    }
  588|  1.77k|  }
  589|       |
  590|  1.84k|  fieldObj.free();
  591|  1.84k|}
_ZN13AcroFormField4loadEP8AcroFormP6Object:
  647|  1.77k|AcroFormField *AcroFormField::load(AcroForm *acroFormA, Object *fieldRefA) {
  648|  1.77k|  GString *typeStr;
  649|  1.77k|  TextString *nameA;
  650|  1.77k|  GString *xfaName;
  651|  1.77k|  Guint flagsA;
  652|  1.77k|  GBool haveFlags, typeFromParentA;
  653|  1.77k|  Object fieldObjA, parentObj, parentObj2, obj1, obj2;
  654|  1.77k|  AcroFormFieldType typeA;
  655|  1.77k|  XFAField *xfaFieldA;
  656|  1.77k|  AcroFormField *field;
  657|  1.77k|  int depth, i0, i1;
  658|       |
  659|  1.77k|  fieldRefA->fetch(acroFormA->doc->getXRef(), &fieldObjA);
  660|       |
  661|       |  //----- get field info
  662|       |
  663|  1.77k|  if (fieldObjA.dictLookup("T", &obj1)->isString()) {
  ------------------
  |  Branch (663:7): [True: 974, False: 796]
  ------------------
  664|    974|    nameA = new TextString(obj1.getString());
  665|    974|  } else {
  666|    796|    nameA = new TextString();
  667|    796|  }
  668|  1.77k|  obj1.free();
  669|       |
  670|  1.77k|  if (fieldObjA.dictLookup("FT", &obj1)->isName()) {
  ------------------
  |  Branch (670:7): [True: 947, False: 823]
  ------------------
  671|    947|    typeStr = new GString(obj1.getName());
  672|    947|    typeFromParentA = gFalse;
  ------------------
  |  |   18|    947|#define gFalse 0
  ------------------
  673|    947|  } else {
  674|    823|    typeStr = NULL;
  675|    823|    typeFromParentA = gTrue;
  ------------------
  |  |   17|    823|#define gTrue 1
  ------------------
  676|    823|  }
  677|  1.77k|  obj1.free();
  678|       |
  679|  1.77k|  if (fieldObjA.dictLookup("Ff", &obj1)->isInt()) {
  ------------------
  |  Branch (679:7): [True: 647, False: 1.12k]
  ------------------
  680|    647|    flagsA = (Guint)obj1.getInt();
  681|    647|    haveFlags = gTrue;
  ------------------
  |  |   17|    647|#define gTrue 1
  ------------------
  682|  1.12k|  } else {
  683|  1.12k|    flagsA = 0;
  684|  1.12k|    haveFlags = gFalse;
  ------------------
  |  |   18|  1.12k|#define gFalse 0
  ------------------
  685|  1.12k|  }
  686|  1.77k|  obj1.free();
  687|       |
  688|       |  //----- get info from parent non-terminal fields
  689|       |
  690|  1.77k|  fieldObjA.dictLookup("Parent", &parentObj);
  691|  1.77k|  depth = 0;
  692|  18.8k|  while (parentObj.isDict() && depth < maxFieldObjectDepth) {
  ------------------
  |  |   72|  17.4k|#define maxFieldObjectDepth 50
  ------------------
  |  Branch (692:10): [True: 17.4k, False: 1.43k]
  |  Branch (692:32): [True: 17.0k, False: 331]
  ------------------
  693|       |
  694|  17.0k|    if (parentObj.dictLookup("T", &obj1)->isString()) {
  ------------------
  |  Branch (694:9): [True: 16.7k, False: 276]
  ------------------
  695|  16.7k|      if (nameA->getLength()) {
  ------------------
  |  Branch (695:11): [True: 16.4k, False: 395]
  ------------------
  696|  16.4k|	nameA->insert(0, (Unicode)'.');
  697|  16.4k|      }
  698|  16.7k|      nameA->insert(0, obj1.getString());
  699|  16.7k|    }
  700|  17.0k|    obj1.free();
  701|       |
  702|  17.0k|    if (!typeStr) {
  ------------------
  |  Branch (702:9): [True: 1.96k, False: 15.1k]
  ------------------
  703|  1.96k|      if (parentObj.dictLookup("FT", &obj1)->isName()) {
  ------------------
  |  Branch (703:11): [True: 117, False: 1.84k]
  ------------------
  704|    117|	typeStr = new GString(obj1.getName());
  705|    117|      }
  706|  1.96k|      obj1.free();
  707|  1.96k|    }
  708|       |
  709|  17.0k|    if (!haveFlags) {
  ------------------
  |  Branch (709:9): [True: 2.47k, False: 14.5k]
  ------------------
  710|  2.47k|      if (parentObj.dictLookup("Ff", &obj1)->isInt()) {
  ------------------
  |  Branch (710:11): [True: 189, False: 2.28k]
  ------------------
  711|    189|	flagsA = (Guint)obj1.getInt();
  712|    189|	haveFlags = gTrue;
  ------------------
  |  |   17|    189|#define gTrue 1
  ------------------
  713|    189|      }
  714|  2.47k|      obj1.free();
  715|  2.47k|    }
  716|       |
  717|  17.0k|    parentObj.dictLookup("Parent", &parentObj2);
  718|  17.0k|    parentObj.free();
  719|  17.0k|    parentObj = parentObj2;
  720|       |
  721|  17.0k|    ++depth;
  722|  17.0k|  }
  723|  1.77k|  parentObj.free();
  724|       |
  725|  1.77k|  if (!typeStr) {
  ------------------
  |  Branch (725:7): [True: 706, False: 1.06k]
  ------------------
  726|    706|    error(errSyntaxError, -1, "Missing type in AcroForm field");
  727|    706|    goto err1;
  728|    706|  }
  729|       |
  730|       |  //----- get static XFA info
  731|       |
  732|  1.06k|  xfaFieldA = NULL;
  733|  1.06k|  if (acroFormA->xfaScanner) {
  ------------------
  |  Branch (733:7): [True: 55, False: 1.00k]
  ------------------
  734|       |    // convert field name to UTF-8, and remove segments that start
  735|       |    // with '#' -- to match the XFA field name
  736|     55|    xfaName = nameA->toUTF8();
  737|     55|    i0 = 0;
  738|    262|    while (i0 < xfaName->getLength()) {
  ------------------
  |  Branch (738:12): [True: 207, False: 55]
  ------------------
  739|    207|      i1 = i0;
  740|  18.8k|      while (i1 < xfaName->getLength()) {
  ------------------
  |  Branch (740:14): [True: 18.8k, False: 32]
  ------------------
  741|  18.8k|	if (xfaName->getChar(i1) == '.') {
  ------------------
  |  Branch (741:6): [True: 175, False: 18.6k]
  ------------------
  742|    175|	  ++i1;
  743|    175|	  break;
  744|    175|	}
  745|  18.6k|	++i1;
  746|  18.6k|      }
  747|    207|      if (xfaName->getChar(i0) == '#') {
  ------------------
  |  Branch (747:11): [True: 18, False: 189]
  ------------------
  748|     18|	xfaName->del(i0, i1 - i0);
  749|    189|      } else {
  750|    189|	i0 = i1;
  751|    189|      }
  752|    207|    }
  753|     55|    xfaFieldA = acroFormA->xfaScanner->findField(xfaName);
  754|     55|    delete xfaName;
  755|     55|  }
  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|  1.06k|  if (typeFromParentA && !typeStr->cmp("Btn") && !haveFlags) {
  ------------------
  |  Branch (761:7): [True: 117, False: 947]
  |  Branch (761:26): [True: 28, False: 89]
  |  Branch (761:50): [True: 0, False: 28]
  ------------------
  762|      0|    flagsA = acroFormFlagRadio;
  ------------------
  |  |   40|      0|#define acroFormFlagRadio              (1 << 15)  // button
  ------------------
  763|      0|  }
  764|       |
  765|       |  //----- determine field type
  766|       |
  767|  1.06k|  if (!typeStr->cmp("Btn")) {
  ------------------
  |  Branch (767:7): [True: 233, False: 831]
  ------------------
  768|    233|    if (flagsA & acroFormFlagPushbutton) {
  ------------------
  |  |   41|    233|#define acroFormFlagPushbutton         (1 << 16)  // button
  ------------------
  |  Branch (768:9): [True: 17, False: 216]
  ------------------
  769|     17|      typeA = acroFormFieldPushbutton;
  770|    216|    } else if (flagsA & acroFormFlagRadio) {
  ------------------
  |  |   40|    216|#define acroFormFlagRadio              (1 << 15)  // button
  ------------------
  |  Branch (770:16): [True: 35, False: 181]
  ------------------
  771|     35|      typeA = acroFormFieldRadioButton;
  772|    181|    } else {
  773|    181|      typeA = acroFormFieldCheckbox;
  774|    181|    }
  775|    831|  } else if (!typeStr->cmp("Tx")) {
  ------------------
  |  Branch (775:14): [True: 778, False: 53]
  ------------------
  776|    778|    if (xfaFieldA && xfaFieldA->getBarcodeInfo()) {
  ------------------
  |  Branch (776:9): [True: 0, False: 778]
  |  Branch (776:22): [True: 0, False: 0]
  ------------------
  777|      0|      typeA = acroFormFieldBarcode;
  778|    778|    } else if (flagsA & acroFormFlagFileSelect) {
  ------------------
  |  |   45|    778|#define acroFormFlagFileSelect         (1 << 20)  // text
  ------------------
  |  Branch (778:16): [True: 30, False: 748]
  ------------------
  779|     30|      typeA = acroFormFieldFileSelect;
  780|    748|    } else if (flagsA & acroFormFlagMultiline) {
  ------------------
  |  |   37|    748|#define acroFormFlagMultiline          (1 << 12)  // text
  ------------------
  |  Branch (780:16): [True: 121, False: 627]
  ------------------
  781|    121|      typeA = acroFormFieldMultilineText;
  782|    627|    } else {
  783|    627|      typeA = acroFormFieldText;
  784|    627|    }
  785|    778|  } else if (!typeStr->cmp("Ch")) {
  ------------------
  |  Branch (785:14): [True: 18, False: 35]
  ------------------
  786|     18|    if (flagsA & acroFormFlagCombo) {
  ------------------
  |  |   42|     18|#define acroFormFlagCombo              (1 << 17)  // choice
  ------------------
  |  Branch (786:9): [True: 10, False: 8]
  ------------------
  787|     10|      typeA = acroFormFieldComboBox;
  788|     10|    } else {
  789|      8|      typeA = acroFormFieldListBox;
  790|      8|    }
  791|     35|  } else if (!typeStr->cmp("Sig")) {
  ------------------
  |  Branch (791:14): [True: 0, False: 35]
  ------------------
  792|      0|    typeA = acroFormFieldSignature;
  793|     35|  } else {
  794|     35|    error(errSyntaxError, -1, "Invalid type in AcroForm field");
  795|     35|    goto err1;
  796|     35|  }
  797|  1.02k|  delete typeStr;
  798|       |
  799|  1.02k|  field = new AcroFormField(acroFormA, fieldRefA, &fieldObjA,
  800|  1.02k|			    typeA, nameA, flagsA, typeFromParentA, xfaFieldA);
  801|  1.02k|  fieldObjA.free();
  802|  1.02k|  return field;
  803|       |
  804|    741| err1:
  805|    741|  delete typeStr;
  806|    741|  delete nameA;
  807|    741|  fieldObjA.free();
  808|       |  return NULL;
  809|  1.06k|}
_ZN13AcroFormFieldC2EP8AcroFormP6ObjectS3_17AcroFormFieldTypeP10TextStringjiP8XFAField:
  815|  1.02k|			     XFAField *xfaFieldA) {
  816|  1.02k|  acroForm = acroFormA;
  817|  1.02k|  fieldRefA->copy(&fieldRef);
  818|  1.02k|  fieldObjA->copy(&fieldObj);
  819|  1.02k|  type = typeA;
  820|  1.02k|  name = nameA;
  821|  1.02k|  flags = flagsA;
  822|  1.02k|  typeFromParent = typeFromParentA;
  823|  1.02k|  xfaField = xfaFieldA;
  824|  1.02k|}
_ZN13AcroFormFieldD2Ev:
  826|  1.02k|AcroFormField::~AcroFormField() {
  827|  1.02k|  fieldRef.free();
  828|  1.02k|  fieldObj.free();
  829|  1.02k|  delete name;
  830|  1.02k|}
_ZN17AcroFormAnnotPageC2Eiii:
  327|   711k|    { annotNum = annotNumA; annotGen = annotGenA; pageNum = pageNumA; }

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

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

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

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

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

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

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

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

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

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

_ZN4DictC2EP4XRef:
   31|   436k|Dict::Dict(XRef *xrefA) {
   32|   436k|  xref = xrefA;
   33|   436k|  size = 8;
   34|   436k|  length = 0;
   35|   436k|  entries = (DictEntry *)gmallocn(size, sizeof(DictEntry));
   36|   436k|  hashTab = (DictEntry **)gmallocn(2 * size - 1, sizeof(DictEntry *));
   37|   436k|  memset(hashTab, 0, (2 * size - 1) * sizeof(DictEntry *));
   38|   436k|  ref = 1;
   39|   436k|}
_ZN4DictD2Ev:
   41|   435k|Dict::~Dict() {
   42|   435k|  int i;
   43|       |
   44|  1.65M|  for (i = 0; i < length; ++i) {
  ------------------
  |  Branch (44:15): [True: 1.22M, False: 435k]
  ------------------
   45|  1.22M|    gfree(entries[i].key);
   46|  1.22M|    entries[i].val.free();
   47|  1.22M|  }
   48|   435k|  gfree(entries);
   49|   435k|  gfree(hashTab);
   50|   435k|}
_ZN4Dict3addEPcP6Object:
   52|  1.68M|void Dict::add(char *key, Object *val) {
   53|  1.68M|  DictEntry *e;
   54|  1.68M|  int h;
   55|       |
   56|  1.68M|  if ((e = find(key))) {
  ------------------
  |  Branch (56:7): [True: 461k, False: 1.22M]
  ------------------
   57|   461k|    e->val.free();
   58|   461k|    e->val = *val;
   59|   461k|    gfree(key);
   60|  1.22M|  } else {
   61|  1.22M|    if (length == size) {
  ------------------
  |  Branch (61:9): [True: 27.9k, False: 1.19M]
  ------------------
   62|  27.9k|      expand();
   63|  27.9k|    }
   64|  1.22M|    h = hash(key);
   65|  1.22M|    entries[length].key = key;
   66|  1.22M|    entries[length].val = *val;
   67|  1.22M|    entries[length].next = hashTab[h];
   68|  1.22M|    hashTab[h] = &entries[length];
   69|  1.22M|    ++length;
   70|  1.22M|  }
   71|  1.68M|}
_ZN4Dict6expandEv:
   73|  27.9k|void Dict::expand() {
   74|  27.9k|  int h, i;
   75|       |
   76|  27.9k|  size *= 2;
   77|  27.9k|  entries = (DictEntry *)greallocn(entries, size, sizeof(DictEntry));
   78|  27.9k|  hashTab = (DictEntry **)greallocn(hashTab, 2 * size - 1,
   79|  27.9k|				    sizeof(DictEntry *));
   80|  27.9k|  memset(hashTab, 0, (2 * size - 1) * sizeof(DictEntry *));
   81|   258k|  for (i = 0; i < length; ++i) {
  ------------------
  |  Branch (81:15): [True: 230k, False: 27.9k]
  ------------------
   82|   230k|    h = hash(entries[i].key);
   83|   230k|    entries[i].next = hashTab[h];
   84|   230k|    hashTab[h] = &entries[i];
   85|   230k|  }
   86|  27.9k|}
_ZN4Dict4hashEPKc:
  101|  7.57M|int Dict::hash(const char *key) {
  102|  7.57M|  const char *p;
  103|  7.57M|  unsigned int h;
  104|       |
  105|  7.57M|  h = 0;
  106|  52.4M|  for (p = key; *p; ++p) {
  ------------------
  |  Branch (106:17): [True: 44.8M, False: 7.57M]
  ------------------
  107|  44.8M|    h = 17 * h + (int)(*p & 0xff);
  108|  44.8M|  }
  109|  7.57M|  return (int)(h % (2 * size - 1));
  110|  7.57M|}
_ZN4Dict6lookupEPKcP6Objecti:
  118|  3.81M|Object *Dict::lookup(const char *key, Object *obj, int recursion) {
  119|  3.81M|  DictEntry *e;
  120|       |
  121|  3.81M|  return (e = find(key)) ? e->val.fetch(xref, obj, recursion)
  ------------------
  |  Branch (121:10): [True: 822k, False: 2.98M]
  ------------------
  122|  3.81M|                         : obj->initNull();
  123|  3.81M|}
_ZN4Dict8lookupNFEPKcP6Object:
  125|   621k|Object *Dict::lookupNF(const char *key, Object *obj) {
  126|   621k|  DictEntry *e;
  127|       |
  128|   621k|  return (e = find(key)) ? e->val.copy(obj) : obj->initNull();
  ------------------
  |  Branch (128:10): [True: 196k, False: 424k]
  ------------------
  129|   621k|}
_ZN4Dict6getKeyEi:
  131|   122k|char *Dict::getKey(int i) {
  132|   122k|  return entries[i].key;
  133|   122k|}
_ZN4Dict6getValEiP6Object:
  135|  48.8k|Object *Dict::getVal(int i, Object *obj) {
  136|  48.8k|  return entries[i].val.fetch(xref, obj);
  137|  48.8k|}
_ZN4Dict8getValNFEiP6Object:
  139|  73.8k|Object *Dict::getValNF(int i, Object *obj) {
  140|  73.8k|  return entries[i].val.copy(obj);
  141|  73.8k|}
_ZN4Dict4findEPKc:
   88|  6.11M|inline DictEntry *Dict::find(const char *key) {
   89|  6.11M|  DictEntry *e;
   90|  6.11M|  int h;
   91|       |
   92|  6.11M|  h = hash(key);
   93|  8.01M|  for (e = hashTab[h]; e; e = e->next) {
  ------------------
  |  Branch (93:24): [True: 3.37M, False: 4.63M]
  ------------------
   94|  3.37M|    if (!strcmp(key, e->key)) {
  ------------------
  |  Branch (94:9): [True: 1.48M, False: 1.89M]
  ------------------
   95|  1.48M|      return e;
   96|  1.48M|    }
   97|  3.37M|  }
   98|  4.63M|  return NULL;
   99|  6.11M|}

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

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

_ZN23JArithmeticDecoderStatsC2Ei:
   20|  6.85M|JArithmeticDecoderStats::JArithmeticDecoderStats(int contextSizeA) {
   21|  6.85M|  contextSize = contextSizeA;
   22|  6.85M|  cxTab = (Guchar *)gmallocn(contextSize, sizeof(Guchar));
   23|  6.85M|  reset();
   24|  6.85M|}
_ZN23JArithmeticDecoderStatsD2Ev:
   26|  6.84M|JArithmeticDecoderStats::~JArithmeticDecoderStats() {
   27|  6.84M|  gfree(cxTab);
   28|  6.84M|}
_ZN23JArithmeticDecoderStats4copyEv:
   30|    841|JArithmeticDecoderStats *JArithmeticDecoderStats::copy() {
   31|    841|  JArithmeticDecoderStats *stats;
   32|       |
   33|    841|  stats = new JArithmeticDecoderStats(contextSize);
   34|    841|  memcpy(stats->cxTab, cxTab, contextSize);
   35|    841|  return stats;
   36|    841|}
_ZN23JArithmeticDecoderStats5resetEv:
   38|  7.18M|void JArithmeticDecoderStats::reset() {
   39|  7.18M|  memset(cxTab, 0, contextSize);
   40|  7.18M|}
_ZN23JArithmeticDecoderStats8setEntryEjii:
   46|  1.19M|void JArithmeticDecoderStats::setEntry(Guint cx, int i, int mps) {
   47|  1.19M|  cxTab[cx] = (Guchar)((i << 1) + mps);
   48|  1.19M|}
_ZN18JArithmeticDecoderC2Ev:
   87|   526k|JArithmeticDecoder::JArithmeticDecoder() {
   88|   526k|  str = NULL;
   89|   526k|  dataLen = 0;
   90|   526k|  limitStream = gFalse;
  ------------------
  |  |   18|   526k|#define gFalse 0
  ------------------
   91|   526k|  nBytesRead = 0;
   92|   526k|  readBufNext = 0;
   93|   526k|  readBufLength = 0;
   94|   526k|}
_ZN18JArithmeticDecoderD2Ev:
  110|   525k|JArithmeticDecoder::~JArithmeticDecoder() {
  111|   525k|  cleanup();
  112|   525k|}
_ZN18JArithmeticDecoder5startEv:
  114|   263k|void JArithmeticDecoder::start() {
  115|   263k|  buf0 = readByte();
  116|   263k|  buf1 = readByte();
  117|       |
  118|       |  // INITDEC
  119|   263k|  c = (buf0 ^ 0xff) << 16;
  120|   263k|  byteIn();
  121|   263k|  c <<= 7;
  122|   263k|  ct -= 7;
  123|   263k|  a = 0x80000000;
  124|   263k|}
_ZN18JArithmeticDecoder7restartEi:
  126|  13.6k|void JArithmeticDecoder::restart(int dataLenA) {
  127|  13.6k|  Guint cAdd;
  128|  13.6k|  GBool prevFF;
  129|  13.6k|  int k, nBits;
  130|       |
  131|  13.6k|  if (dataLen >= 0) {
  ------------------
  |  Branch (131:7): [True: 8.71k, False: 4.94k]
  ------------------
  132|  8.71k|    dataLen = dataLenA;
  133|  8.71k|  } else if (dataLen == -1) {
  ------------------
  |  Branch (133:14): [True: 1.21k, False: 3.72k]
  ------------------
  134|  1.21k|    dataLen = dataLenA;
  135|  1.21k|    buf1 = readByte();
  136|  3.72k|  } else {
  137|  3.72k|    k = (-dataLen - 1) * 8 - ct;
  138|  3.72k|    dataLen = dataLenA;
  139|  3.72k|    cAdd = 0;
  140|  3.72k|    prevFF = gFalse;
  ------------------
  |  |   18|  3.72k|#define gFalse 0
  ------------------
  141|  1.09M|    while (k > 0) {
  ------------------
  |  Branch (141:12): [True: 1.09M, False: 3.72k]
  ------------------
  142|  1.09M|      buf0 = readByte();
  143|  1.09M|      if (prevFF) {
  ------------------
  |  Branch (143:11): [True: 1.06M, False: 29.2k]
  ------------------
  144|  1.06M|	cAdd += 0xfe00 - (buf0 << 9);
  145|  1.06M|	nBits = 7;
  146|  1.06M|      } else {
  147|  29.2k|	cAdd += 0xff00 - (buf0 << 8);
  148|  29.2k|	nBits = 8;
  149|  29.2k|      }
  150|  1.09M|      prevFF = buf0 == 0xff;
  151|  1.09M|      if (k > nBits) {
  ------------------
  |  Branch (151:11): [True: 1.08M, False: 3.72k]
  ------------------
  152|  1.08M|	cAdd <<= nBits;
  153|  1.08M|	k -= nBits;
  154|  1.08M|      } else {
  155|  3.72k|	cAdd <<= k;
  156|  3.72k|	ct = nBits - k;
  157|  3.72k|	k = 0;
  158|  3.72k|      }
  159|  1.09M|    }
  160|  3.72k|    c += cAdd;
  161|  3.72k|    buf1 = readByte();
  162|  3.72k|  }
  163|  13.6k|}
_ZN18JArithmeticDecoder7cleanupEv:
  165|   842k|void JArithmeticDecoder::cleanup() {
  166|   842k|  if (limitStream) {
  ------------------
  |  Branch (166:7): [True: 421k, False: 420k]
  ------------------
  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|   421k|    readBufLength = 0;
  175|  4.07G|    while (dataLen > 0) {
  ------------------
  |  Branch (175:12): [True: 4.07G, False: 421k]
  ------------------
  176|  4.07G|      if (readBufLength < (int)sizeof(readBuf)) {
  ------------------
  |  Branch (176:11): [True: 1.96M, False: 4.06G]
  ------------------
  177|  1.96M|	readBuf[readBufLength++] = (Guchar)str->getChar();
  178|  1.96M|	++nBytesRead;
  179|  1.96M|      }
  180|  4.07G|      --dataLen;
  181|  4.07G|    }
  182|   421k|    readBufNext = 0;
  183|   421k|  }
  184|   842k|}
_ZN18JArithmeticDecoder9decodeBitEjP23JArithmeticDecoderStats:
  187|  2.28G|				  JArithmeticDecoderStats *stats) {
  188|  2.28G|  int bit;
  189|  2.28G|  Guint qe;
  190|  2.28G|  int iCX, mpsCX;
  191|       |
  192|  2.28G|  iCX = stats->cxTab[context] >> 1;
  193|  2.28G|  mpsCX = stats->cxTab[context] & 1;
  194|  2.28G|  qe = qeTab[iCX];
  195|  2.28G|  a -= qe;
  196|  2.28G|  if (c < a) {
  ------------------
  |  Branch (196:7): [True: 2.27G, False: 19.0M]
  ------------------
  197|  2.27G|    if (a & 0x80000000) {
  ------------------
  |  Branch (197:9): [True: 2.24G, False: 21.2M]
  ------------------
  198|  2.24G|      bit = mpsCX;
  199|  2.24G|    } else {
  200|       |      // MPS_EXCHANGE
  201|  21.2M|      if (a < qe) {
  ------------------
  |  Branch (201:11): [True: 3.10M, False: 18.1M]
  ------------------
  202|  3.10M|	bit = 1 - mpsCX;
  203|  3.10M|	if (switchTab[iCX]) {
  ------------------
  |  Branch (203:6): [True: 1.63M, False: 1.47M]
  ------------------
  204|  1.63M|	  stats->cxTab[context] = (Guchar)((nlpsTab[iCX] << 1) | (1 - mpsCX));
  205|  1.63M|	} else {
  206|  1.47M|	  stats->cxTab[context] = (Guchar)((nlpsTab[iCX] << 1) | mpsCX);
  207|  1.47M|	}
  208|  18.1M|      } else {
  209|  18.1M|	bit = mpsCX;
  210|  18.1M|	stats->cxTab[context] = (Guchar)((nmpsTab[iCX] << 1) | mpsCX);
  211|  18.1M|      }
  212|       |      // RENORMD
  213|  22.4M|      do {
  214|  22.4M|	if (ct == 0) {
  ------------------
  |  Branch (214:6): [True: 2.82M, False: 19.6M]
  ------------------
  215|  2.82M|	  byteIn();
  216|  2.82M|	}
  217|  22.4M|	a <<= 1;
  218|  22.4M|	c <<= 1;
  219|  22.4M|	--ct;
  220|  22.4M|      } while (!(a & 0x80000000));
  ------------------
  |  Branch (220:16): [True: 1.25M, False: 21.2M]
  ------------------
  221|  21.2M|    }
  222|  2.27G|  } else {
  223|  19.0M|    c -= a;
  224|       |    // LPS_EXCHANGE
  225|  19.0M|    if (a < qe) {
  ------------------
  |  Branch (225:9): [True: 3.62M, False: 15.4M]
  ------------------
  226|  3.62M|      bit = mpsCX;
  227|  3.62M|      stats->cxTab[context] = (Guchar)((nmpsTab[iCX] << 1) | mpsCX);
  228|  15.4M|    } else {
  229|  15.4M|      bit = 1 - mpsCX;
  230|  15.4M|      if (switchTab[iCX]) {
  ------------------
  |  Branch (230:11): [True: 1.54M, False: 13.8M]
  ------------------
  231|  1.54M|	stats->cxTab[context] = (Guchar)((nlpsTab[iCX] << 1) | (1 - mpsCX));
  232|  13.8M|      } else {
  233|  13.8M|	stats->cxTab[context] = (Guchar)((nlpsTab[iCX] << 1) | mpsCX);
  234|  13.8M|      }
  235|  15.4M|    }
  236|  19.0M|    a = qe;
  237|       |    // RENORMD
  238|  30.6M|    do {
  239|  30.6M|      if (ct == 0) {
  ------------------
  |  Branch (239:11): [True: 3.85M, False: 26.8M]
  ------------------
  240|  3.85M|	byteIn();
  241|  3.85M|      }
  242|  30.6M|      a <<= 1;
  243|  30.6M|      c <<= 1;
  244|  30.6M|      --ct;
  245|  30.6M|    } while (!(a & 0x80000000));
  ------------------
  |  Branch (245:14): [True: 11.6M, False: 19.0M]
  ------------------
  246|  19.0M|  }
  247|  2.28G|  return bit;
  248|  2.28G|}
_ZN18JArithmeticDecoder9decodeIntEPiP23JArithmeticDecoderStats:
  262|  9.05M|GBool JArithmeticDecoder::decodeInt(int *x, JArithmeticDecoderStats *stats) {
  263|  9.05M|  int s;
  264|  9.05M|  Guint v;
  265|  9.05M|  int i;
  266|       |
  267|  9.05M|  prev = 1;
  268|  9.05M|  s = decodeIntBit(stats);
  269|  9.05M|  if (decodeIntBit(stats)) {
  ------------------
  |  Branch (269:7): [True: 6.36M, False: 2.69M]
  ------------------
  270|  6.36M|    if (decodeIntBit(stats)) {
  ------------------
  |  Branch (270:9): [True: 5.01M, False: 1.34M]
  ------------------
  271|  5.01M|      if (decodeIntBit(stats)) {
  ------------------
  |  Branch (271:11): [True: 4.73M, False: 272k]
  ------------------
  272|  4.73M|	if (decodeIntBit(stats)) {
  ------------------
  |  Branch (272:6): [True: 4.53M, False: 200k]
  ------------------
  273|  4.53M|	  if (decodeIntBit(stats)) {
  ------------------
  |  Branch (273:8): [True: 4.48M, False: 53.3k]
  ------------------
  274|  4.48M|	    v = 0;
  275|   148M|	    for (i = 0; i < 32; ++i) {
  ------------------
  |  Branch (275:18): [True: 143M, False: 4.48M]
  ------------------
  276|   143M|	      v = (v << 1) | decodeIntBit(stats);
  277|   143M|	    }
  278|  4.48M|	    v += 4436;
  279|  4.48M|	  } else {
  280|  53.3k|	    v = 0;
  281|   693k|	    for (i = 0; i < 12; ++i) {
  ------------------
  |  Branch (281:18): [True: 639k, False: 53.3k]
  ------------------
  282|   639k|	      v = (v << 1) | decodeIntBit(stats);
  283|   639k|	    }
  284|  53.3k|	    v += 340;
  285|  53.3k|	  }
  286|  4.53M|	} else {
  287|   200k|	  v = 0;
  288|  1.80M|	  for (i = 0; i < 8; ++i) {
  ------------------
  |  Branch (288:16): [True: 1.60M, False: 200k]
  ------------------
  289|  1.60M|	    v = (v << 1) | decodeIntBit(stats);
  290|  1.60M|	  }
  291|   200k|	  v += 84;
  292|   200k|	}
  293|  4.73M|      } else {
  294|   272k|	v = 0;
  295|  1.91M|	for (i = 0; i < 6; ++i) {
  ------------------
  |  Branch (295:14): [True: 1.63M, False: 272k]
  ------------------
  296|  1.63M|	  v = (v << 1) | decodeIntBit(stats);
  297|  1.63M|	}
  298|   272k|	v += 20;
  299|   272k|      }
  300|  5.01M|    } else {
  301|  1.34M|      v = decodeIntBit(stats);
  302|  1.34M|      v = (v << 1) | decodeIntBit(stats);
  303|  1.34M|      v = (v << 1) | decodeIntBit(stats);
  304|  1.34M|      v = (v << 1) | decodeIntBit(stats);
  305|  1.34M|      v += 4;
  306|  1.34M|    }
  307|  6.36M|  } else {
  308|  2.69M|    v = decodeIntBit(stats);
  309|  2.69M|    v = (v << 1) | decodeIntBit(stats);
  310|  2.69M|  }
  311|       |
  312|  9.05M|  if (s) {
  ------------------
  |  Branch (312:7): [True: 7.76M, False: 1.28M]
  ------------------
  313|  7.76M|    if (v == 0) {
  ------------------
  |  Branch (313:9): [True: 654k, False: 7.11M]
  ------------------
  314|   654k|      return gFalse;
  ------------------
  |  |   18|   654k|#define gFalse 0
  ------------------
  315|   654k|    }
  316|  7.11M|    *x = -(int)v;
  317|  7.11M|  } else {
  318|  1.28M|    *x = (int)v;
  319|  1.28M|  }
  320|  8.39M|  return gTrue;
  ------------------
  |  |   17|  8.39M|#define gTrue 1
  ------------------
  321|  9.05M|}
_ZN18JArithmeticDecoder12decodeIntBitEP23JArithmeticDecoderStats:
  323|   196M|int JArithmeticDecoder::decodeIntBit(JArithmeticDecoderStats *stats) {
  324|   196M|  int bit;
  325|       |
  326|   196M|  bit = decodeBit(prev, stats);
  327|   196M|  if (prev < 0x100) {
  ------------------
  |  Branch (327:7): [True: 60.3M, False: 136M]
  ------------------
  328|  60.3M|    prev = (prev << 1) | bit;
  329|   136M|  } else {
  330|   136M|    prev = (((prev << 1) | bit) & 0x1ff) | 0x100;
  331|   136M|  }
  332|   196M|  return bit;
  333|   196M|}
_ZN18JArithmeticDecoder10decodeIAIDEjP23JArithmeticDecoderStats:
  336|  5.64M|				     JArithmeticDecoderStats *stats) {
  337|  5.64M|  Guint i;
  338|  5.64M|  int bit;
  339|       |
  340|  5.64M|  prev = 1;
  341|  14.0M|  for (i = 0; i < codeLen; ++i) {
  ------------------
  |  Branch (341:15): [True: 8.41M, False: 5.64M]
  ------------------
  342|  8.41M|    bit = decodeBit(prev, stats);
  343|  8.41M|    prev = (prev << 1) | bit;
  344|  8.41M|  }
  345|  5.64M|  return prev - (1 << codeLen);
  346|  5.64M|}
_ZN18JArithmeticDecoder6byteInEv:
  348|  6.94M|void JArithmeticDecoder::byteIn() {
  349|  6.94M|  if (buf0 == 0xff) {
  ------------------
  |  Branch (349:7): [True: 6.16M, False: 781k]
  ------------------
  350|  6.16M|    if (buf1 > 0x8f) {
  ------------------
  |  Branch (350:9): [True: 6.16M, False: 5.63k]
  ------------------
  351|  6.16M|      if (limitStream) {
  ------------------
  |  Branch (351:11): [True: 1.12M, False: 5.03M]
  ------------------
  352|  1.12M|	buf0 = buf1;
  353|  1.12M|	buf1 = readByte();
  354|  1.12M|	c = c + 0xff00 - (buf0 << 8);
  355|  1.12M|      }
  356|  6.16M|      ct = 8;
  357|  6.16M|    } else {
  358|  5.63k|      buf0 = buf1;
  359|  5.63k|      buf1 = readByte();
  360|  5.63k|      c = c + 0xfe00 - (buf0 << 9);
  361|  5.63k|      ct = 7;
  362|  5.63k|    }
  363|  6.16M|  } else {
  364|   781k|    buf0 = buf1;
  365|   781k|    buf1 = readByte();
  366|   781k|    c = c + 0xff00 - (buf0 << 8);
  367|   781k|    ct = 8;
  368|   781k|  }
  369|  6.94M|}
_ZN18JArithmeticDecoder8readByteEv:
   96|  3.53M|inline Guint JArithmeticDecoder::readByte() {
   97|  3.53M|  if (limitStream) {
  ------------------
  |  Branch (97:7): [True: 3.22M, False: 310k]
  ------------------
   98|  3.22M|    if (readBufNext < readBufLength) {
  ------------------
  |  Branch (98:9): [True: 299k, False: 2.92M]
  ------------------
   99|   299k|      return readBuf[readBufNext++];
  100|   299k|    }
  101|  2.92M|    --dataLen;
  102|  2.92M|    if (dataLen < 0) {
  ------------------
  |  Branch (102:9): [True: 2.14M, False: 782k]
  ------------------
  103|  2.14M|      return 0xff;
  104|  2.14M|    }
  105|  2.92M|  }
  106|  1.09M|  ++nBytesRead;
  107|  1.09M|  return (Guint)str->getChar() & 0xff;
  108|  3.53M|}

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

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

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

_ZN5LexerC2EP4XRefP6Stream:
   46|   205k|Lexer::Lexer(XRef *xref, Stream *str) {
   47|   205k|  Object obj;
   48|       |
   49|   205k|  curStr.initStream(str);
   50|   205k|  streams = new Array(xref);
   51|   205k|  streams->add(curStr.copy(&obj));
   52|   205k|  strPtr = 0;
   53|   205k|  freeArray = gTrue;
  ------------------
  |  |   17|   205k|#define gTrue 1
  ------------------
   54|   205k|  curStr.streamReset();
   55|   205k|}
_ZN5LexerD2Ev:
   75|   205k|Lexer::~Lexer() {
   76|   205k|  if (!curStr.isNone()) {
  ------------------
  |  Branch (76:7): [True: 68.6k, False: 137k]
  ------------------
   77|  68.6k|    curStr.streamClose();
   78|  68.6k|    curStr.free();
   79|  68.6k|  }
   80|   205k|  if (freeArray) {
  ------------------
  |  Branch (80:7): [True: 205k, False: 0]
  ------------------
   81|   205k|    delete streams;
   82|   205k|  }
   83|   205k|}
_ZN5Lexer7getCharEv:
   85|  1.98G|int Lexer::getChar() {
   86|  1.98G|  int c;
   87|       |
   88|  1.98G|  c = EOF;
   89|  1.98G|  while (!curStr.isNone() && (c = curStr.streamGetChar()) == EOF) {
  ------------------
  |  Branch (89:10): [True: 1.88G, False: 104M]
  |  Branch (89:30): [True: 137k, False: 1.88G]
  ------------------
   90|   137k|    curStr.streamClose();
   91|   137k|    curStr.free();
   92|   137k|    ++strPtr;
   93|   137k|    if (strPtr < streams->getLength()) {
  ------------------
  |  Branch (93:9): [True: 0, False: 137k]
  ------------------
   94|      0|      streams->get(strPtr, &curStr);
   95|      0|      curStr.streamReset();
   96|      0|    }
   97|   137k|  }
   98|  1.98G|  return c;
   99|  1.98G|}
_ZN5Lexer8lookCharEv:
  101|   206M|int Lexer::lookChar() {
  102|   206M|  if (curStr.isNone()) {
  ------------------
  |  Branch (102:7): [True: 1.21k, False: 206M]
  ------------------
  103|  1.21k|    return EOF;
  104|  1.21k|  }
  105|   206M|  return curStr.streamLookChar();
  106|   206M|}
_ZN5Lexer6getObjEP6Object:
  108|   143M|Object *Lexer::getObj(Object *obj) {
  109|   143M|  char *p;
  110|   143M|  int c, c2;
  111|   143M|  GBool comment, neg, doubleMinus, done, invalid;
  112|   143M|  int numParen, nErrors;
  113|   143M|  int xi;
  114|   143M|  double xf, scale;
  115|   143M|  GString *s;
  116|   143M|  int n, m;
  117|       |
  118|       |  // skip whitespace and comments
  119|   143M|  comment = gFalse;
  ------------------
  |  |   18|   143M|#define gFalse 0
  ------------------
  120|  1.28G|  while (1) {
  ------------------
  |  Branch (120:10): [True: 1.28G, Folded]
  ------------------
  121|  1.28G|    if ((c = getChar()) == EOF) {
  ------------------
  |  Branch (121:9): [True: 104M, False: 1.18G]
  ------------------
  122|   104M|      return obj->initEOF();
  123|   104M|    }
  124|  1.18G|    if (comment) {
  ------------------
  |  Branch (124:9): [True: 11.5M, False: 1.17G]
  ------------------
  125|  11.5M|      if (c == '\r' || c == '\n')
  ------------------
  |  Branch (125:11): [True: 93.0k, False: 11.4M]
  |  Branch (125:24): [True: 118k, False: 11.3M]
  ------------------
  126|   211k|	comment = gFalse;
  ------------------
  |  |   18|   211k|#define gFalse 0
  ------------------
  127|  1.17G|    } else if (c == '%') {
  ------------------
  |  Branch (127:16): [True: 212k, False: 1.17G]
  ------------------
  128|   212k|      comment = gTrue;
  ------------------
  |  |   17|   212k|#define gTrue 1
  ------------------
  129|  1.17G|    } else if (specialChars[c] != 1) {
  ------------------
  |  Branch (129:16): [True: 38.0M, False: 1.13G]
  ------------------
  130|  38.0M|      break;
  131|  38.0M|    }
  132|  1.18G|  }
  133|       |
  134|       |  // start reading token
  135|  38.0M|  switch (c) {
  136|       |
  137|       |  // number
  138|  3.28M|  case '0': case '1': case '2': case '3': case '4':
  ------------------
  |  Branch (138:3): [True: 1.80M, False: 36.2M]
  |  Branch (138:13): [True: 520k, False: 37.5M]
  |  Branch (138:23): [True: 590k, False: 37.5M]
  |  Branch (138:33): [True: 144k, False: 37.9M]
  |  Branch (138:43): [True: 231k, False: 37.8M]
  ------------------
  139|  4.38M|  case '5': case '6': case '7': case '8': case '9':
  ------------------
  |  Branch (139:3): [True: 105k, False: 37.9M]
  |  Branch (139:13): [True: 251k, False: 37.8M]
  |  Branch (139:23): [True: 83.2k, False: 38.0M]
  |  Branch (139:33): [True: 467k, False: 37.6M]
  |  Branch (139:43): [True: 192k, False: 37.8M]
  ------------------
  140|  4.88M|  case '+': case '-': case '.':
  ------------------
  |  Branch (140:3): [True: 32.3k, False: 38.0M]
  |  Branch (140:13): [True: 258k, False: 37.8M]
  |  Branch (140:23): [True: 200k, False: 37.8M]
  ------------------
  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|  4.88M|    neg = gFalse;
  ------------------
  |  |   18|  4.88M|#define gFalse 0
  ------------------
  156|  4.88M|    doubleMinus = gFalse;
  ------------------
  |  |   18|  4.88M|#define gFalse 0
  ------------------
  157|  4.88M|    xf = xi = 0;
  158|  4.88M|    if (c == '+') {
  ------------------
  |  Branch (158:9): [True: 32.3k, False: 4.84M]
  ------------------
  159|       |      // just ignore it
  160|  4.84M|    } else if (c == '-') {
  ------------------
  |  Branch (160:16): [True: 258k, False: 4.58M]
  ------------------
  161|   258k|      neg = gTrue;
  ------------------
  |  |   17|   258k|#define gTrue 1
  ------------------
  162|   258k|      if (lookChar() == '-') {
  ------------------
  |  Branch (162:11): [True: 10.3k, False: 248k]
  ------------------
  163|  10.3k|	doubleMinus = gTrue;
  ------------------
  |  |   17|  10.3k|#define gTrue 1
  ------------------
  164|  16.4k|	do {
  165|  16.4k|	  getChar();
  166|  16.4k|	} while (lookChar() == '-');
  ------------------
  |  Branch (166:11): [True: 6.11k, False: 10.3k]
  ------------------
  167|  10.3k|      }
  168|  4.58M|    } else if (c == '.') {
  ------------------
  |  Branch (168:16): [True: 200k, False: 4.38M]
  ------------------
  169|   200k|      goto doReal;
  170|  4.38M|    } else {
  171|  4.38M|      xf = xi = c - '0';
  172|  4.38M|    }
  173|  11.0M|    while (1) {
  ------------------
  |  Branch (173:12): [True: 11.0M, Folded]
  ------------------
  174|  11.0M|      c = lookChar();
  175|  11.0M|      if (isdigit(c)) {
  ------------------
  |  Branch (175:11): [True: 6.40M, False: 4.67M]
  ------------------
  176|  6.40M|	getChar();
  177|  6.40M|	xi = xi * 10 + (c - '0');
  178|  6.40M|	if (xf < 1e20) {
  ------------------
  |  Branch (178:6): [True: 4.28M, False: 2.11M]
  ------------------
  179|  4.28M|	  xf = xf * 10 + (c - '0');
  180|  4.28M|	}
  181|  6.40M|      } else if (c == '.') {
  ------------------
  |  Branch (181:18): [True: 106k, False: 4.57M]
  ------------------
  182|   106k|	getChar();
  183|   106k|	goto doReal;
  184|  4.57M|      } else {
  185|  4.57M|	break;
  186|  4.57M|      }
  187|  11.0M|    }
  188|  4.71M|    while ((c = lookChar()) == '-' || isdigit(c)) {
  ------------------
  |  Branch (188:12): [True: 2.91k, False: 4.71M]
  |  Branch (188:39): [True: 138k, False: 4.57M]
  ------------------
  189|   141k|      getChar();
  190|   141k|    }
  191|  4.57M|    if (neg) {
  ------------------
  |  Branch (191:9): [True: 253k, False: 4.31M]
  ------------------
  192|   253k|      xi = -xi;
  193|   253k|    }
  194|  4.57M|    if (doubleMinus) {
  ------------------
  |  Branch (194:9): [True: 10.3k, False: 4.56M]
  ------------------
  195|  10.3k|      xi = 0;
  196|  10.3k|    }
  197|  4.57M|    obj->initInt(xi);
  198|  4.57M|    break;
  199|   307k|  doReal:
  200|   307k|    scale = 0.1;
  201|   484k|    while (1) {
  ------------------
  |  Branch (201:12): [True: 484k, Folded]
  ------------------
  202|   484k|      c = lookChar();
  203|   484k|      if (c == '-') {
  ------------------
  |  Branch (203:11): [True: 18.8k, False: 465k]
  ------------------
  204|  18.8k|	error(errSyntaxWarning, getPos(), "Badly formatted number");
  205|  18.8k|	getChar();
  206|  18.8k|	continue;
  207|  18.8k|      }
  208|   465k|      if (!isdigit(c)) {
  ------------------
  |  Branch (208:11): [True: 307k, False: 158k]
  ------------------
  209|   307k|	break;
  210|   307k|      }
  211|   158k|      getChar();
  212|   158k|      xf = xf + scale * (c - '0');
  213|   158k|      scale *= 0.1;
  214|   158k|    }
  215|   307k|    while ((c = lookChar()) == '-' || isdigit(c)) {
  ------------------
  |  Branch (215:12): [True: 0, False: 307k]
  |  Branch (215:39): [True: 0, False: 307k]
  ------------------
  216|      0|      getChar();
  217|      0|    }
  218|   307k|    if (neg) {
  ------------------
  |  Branch (218:9): [True: 4.99k, False: 302k]
  ------------------
  219|  4.99k|      xf = -xf;
  220|  4.99k|    }
  221|   307k|    obj->initReal(xf);
  222|   307k|    break;
  223|       |
  224|       |  // string
  225|   126k|  case '(':
  ------------------
  |  Branch (225:3): [True: 126k, False: 37.9M]
  ------------------
  226|   126k|    p = tokBuf;
  227|   126k|    n = 0;
  228|   126k|    numParen = 1;
  229|   126k|    done = gFalse;
  ------------------
  |  |   18|   126k|#define gFalse 0
  ------------------
  230|   126k|    s = NULL;
  231|   479M|    do {
  232|   479M|      c2 = EOF;
  233|   479M|      switch (c = getChar()) {
  234|       |
  235|  5.38k|      case EOF:
  ------------------
  |  Branch (235:7): [True: 5.38k, False: 479M]
  ------------------
  236|  5.38k|	error(errSyntaxError, getPos(), "Unterminated string");
  237|  5.38k|	done = gTrue;
  ------------------
  |  |   17|  5.38k|#define gTrue 1
  ------------------
  238|  5.38k|	break;
  239|       |
  240|  3.28M|      case '(':
  ------------------
  |  Branch (240:7): [True: 3.28M, False: 475M]
  ------------------
  241|  3.28M|	++numParen;
  242|  3.28M|	c2 = c;
  243|  3.28M|	break;
  244|       |
  245|  1.26M|      case ')':
  ------------------
  |  Branch (245:7): [True: 1.26M, False: 477M]
  ------------------
  246|  1.26M|	if (--numParen == 0) {
  ------------------
  |  Branch (246:6): [True: 119k, False: 1.14M]
  ------------------
  247|   119k|	  done = gTrue;
  ------------------
  |  |   17|   119k|#define gTrue 1
  ------------------
  248|  1.14M|	} else {
  249|  1.14M|	  c2 = c;
  250|  1.14M|	}
  251|  1.26M|	break;
  252|       |
  253|  5.47M|      case '\r':
  ------------------
  |  Branch (253:7): [True: 5.47M, False: 473M]
  ------------------
  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.47M|	c = lookChar();
  257|  5.47M|	if (c == '\n') {
  ------------------
  |  Branch (257:6): [True: 86.0k, False: 5.38M]
  ------------------
  258|  86.0k|	  getChar();
  259|  86.0k|	}
  260|  5.47M|	c2 = '\n';
  261|  5.47M|	break;
  262|       |
  263|   884k|      case '\\':
  ------------------
  |  Branch (263:7): [True: 884k, False: 478M]
  ------------------
  264|   884k|	switch (c = getChar()) {
  265|  5.58k|	case 'n':
  ------------------
  |  Branch (265:2): [True: 5.58k, False: 879k]
  ------------------
  266|  5.58k|	  c2 = '\n';
  267|  5.58k|	  break;
  268|  14.2k|	case 'r':
  ------------------
  |  Branch (268:2): [True: 14.2k, False: 870k]
  ------------------
  269|  14.2k|	  c2 = '\r';
  270|  14.2k|	  break;
  271|  24.6k|	case 't':
  ------------------
  |  Branch (271:2): [True: 24.6k, False: 860k]
  ------------------
  272|  24.6k|	  c2 = '\t';
  273|  24.6k|	  break;
  274|  4.97k|	case 'b':
  ------------------
  |  Branch (274:2): [True: 4.97k, False: 879k]
  ------------------
  275|  4.97k|	  c2 = '\b';
  276|  4.97k|	  break;
  277|  3.27k|	case 'f':
  ------------------
  |  Branch (277:2): [True: 3.27k, False: 881k]
  ------------------
  278|  3.27k|	  c2 = '\f';
  279|  3.27k|	  break;
  280|  2.84k|	case '\\':
  ------------------
  |  Branch (280:2): [True: 2.84k, False: 881k]
  ------------------
  281|  8.48k|	case '(':
  ------------------
  |  Branch (281:2): [True: 5.63k, False: 879k]
  ------------------
  282|  14.1k|	case ')':
  ------------------
  |  Branch (282:2): [True: 5.63k, False: 879k]
  ------------------
  283|  14.1k|	  c2 = c;
  284|  14.1k|	  break;
  285|  14.6k|	case '0': case '1': case '2': case '3':
  ------------------
  |  Branch (285:2): [True: 8.15k, False: 876k]
  |  Branch (285:12): [True: 2.48k, False: 882k]
  |  Branch (285:22): [True: 2.03k, False: 882k]
  |  Branch (285:32): [True: 1.94k, False: 882k]
  ------------------
  286|  43.2k|	case '4': case '5': case '6': case '7':
  ------------------
  |  Branch (286:2): [True: 5.61k, False: 879k]
  |  Branch (286:12): [True: 7.40k, False: 877k]
  |  Branch (286:22): [True: 7.59k, False: 877k]
  |  Branch (286:32): [True: 8.06k, False: 876k]
  ------------------
  287|  43.2k|	  c2 = c - '0';
  288|  43.2k|	  c = lookChar();
  289|  43.2k|	  if (c >= '0' && c <= '7') {
  ------------------
  |  Branch (289:8): [True: 22.6k, False: 20.6k]
  |  Branch (289:20): [True: 6.50k, False: 16.1k]
  ------------------
  290|  6.50k|	    getChar();
  291|  6.50k|	    c2 = (c2 << 3) + (c - '0');
  292|  6.50k|	    c = lookChar();
  293|  6.50k|	    if (c >= '0' && c <= '7') {
  ------------------
  |  Branch (293:10): [True: 1.49k, False: 5.01k]
  |  Branch (293:22): [True: 166, False: 1.33k]
  ------------------
  294|    166|	      getChar();
  295|    166|	      c2 = (c2 << 3) + (c - '0');
  296|    166|	    }
  297|  6.50k|	  }
  298|  43.2k|	  break;
  299|  6.42k|	case '\r':
  ------------------
  |  Branch (299:2): [True: 6.42k, False: 878k]
  ------------------
  300|  6.42k|	  c = lookChar();
  301|  6.42k|	  if (c == '\n') {
  ------------------
  |  Branch (301:8): [True: 1.33k, False: 5.09k]
  ------------------
  302|  1.33k|	    getChar();
  303|  1.33k|	  }
  304|  6.42k|	  break;
  305|  7.55k|	case '\n':
  ------------------
  |  Branch (305:2): [True: 7.55k, False: 877k]
  ------------------
  306|  7.55k|	  break;
  307|    879|	case EOF:
  ------------------
  |  Branch (307:2): [True: 879, False: 883k]
  ------------------
  308|    879|	  error(errSyntaxError, getPos(), "Unterminated string");
  309|    879|	  done = gTrue;
  ------------------
  |  |   17|    879|#define gTrue 1
  ------------------
  310|    879|	  break;
  311|   759k|	default:
  ------------------
  |  Branch (311:2): [True: 759k, False: 124k]
  ------------------
  312|   759k|	  c2 = c;
  313|   759k|	  break;
  314|   884k|	}
  315|   884k|	break;
  316|       |
  317|   468M|      default:
  ------------------
  |  Branch (317:7): [True: 468M, False: 10.9M]
  ------------------
  318|   468M|	c2 = c;
  319|   468M|	break;
  320|   479M|      }
  321|       |
  322|   479M|      if (c2 != EOF) {
  ------------------
  |  Branch (322:11): [True: 478M, False: 140k]
  ------------------
  323|   478M|	if (n == tokBufSize) {
  ------------------
  |  |   19|   478M|#define tokBufSize 128		// size of token buffer
  ------------------
  |  Branch (323:6): [True: 3.69M, False: 475M]
  ------------------
  324|  3.69M|	  if (!s)
  ------------------
  |  Branch (324:8): [True: 59.2k, False: 3.63M]
  ------------------
  325|  59.2k|	    s = new GString(tokBuf, tokBufSize);
  ------------------
  |  |   19|  59.2k|#define tokBufSize 128		// size of token buffer
  ------------------
  326|  3.63M|	  else
  327|  3.63M|	    s->append(tokBuf, tokBufSize);
  ------------------
  |  |   19|  3.63M|#define tokBufSize 128		// size of token buffer
  ------------------
  328|  3.69M|	  p = tokBuf;
  329|  3.69M|	  n = 0;
  330|  3.69M|	}
  331|   478M|	*p++ = (char)c2;
  332|   478M|	++n;
  333|   478M|      }
  334|   479M|    } while (!done);
  ------------------
  |  Branch (334:14): [True: 478M, False: 126k]
  ------------------
  335|   126k|    if (!s)
  ------------------
  |  Branch (335:9): [True: 66.9k, False: 59.2k]
  ------------------
  336|  66.9k|      s = new GString(tokBuf, n);
  337|  59.2k|    else
  338|  59.2k|      s->append(tokBuf, n);
  339|   126k|    obj->initString(s);
  340|   126k|    break;
  341|       |
  342|       |  // name
  343|  5.20M|  case '/':
  ------------------
  |  Branch (343:3): [True: 5.20M, False: 32.8M]
  ------------------
  344|  5.20M|    p = tokBuf;
  345|  5.20M|    n = 0;
  346|  5.20M|    s = NULL;
  347|  5.20M|    invalid = gFalse;
  ------------------
  |  |   18|  5.20M|#define gFalse 0
  ------------------
  348|  19.5M|    while ((c = lookChar()) != EOF && !specialChars[c]) {
  ------------------
  |  Branch (348:12): [True: 19.5M, False: 2.82k]
  |  Branch (348:39): [True: 14.3M, False: 5.19M]
  ------------------
  349|  14.3M|      getChar();
  350|  14.3M|      if (c == '#') {
  ------------------
  |  Branch (350:11): [True: 818k, False: 13.4M]
  ------------------
  351|   818k|	c2 = lookChar();
  352|   818k|	if (c2 >= '0' && c2 <= '9') {
  ------------------
  |  Branch (352:6): [True: 403k, False: 415k]
  |  Branch (352:19): [True: 1.25k, False: 401k]
  ------------------
  353|  1.25k|	  c = c2 - '0';
  354|   817k|	} else if (c2 >= 'A' && c2 <= 'F') {
  ------------------
  |  Branch (354:13): [True: 401k, False: 415k]
  |  Branch (354:26): [True: 46.9k, False: 354k]
  ------------------
  355|  46.9k|	  c = c2 - 'A' + 10;
  356|   770k|	} else if (c2 >= 'a' && c2 <= 'f') {
  ------------------
  |  Branch (356:13): [True: 354k, False: 415k]
  |  Branch (356:26): [True: 95.8k, False: 258k]
  ------------------
  357|  95.8k|	  c = c2 - 'a' + 10;
  358|   674k|	} else {
  359|   674k|	  error(errSyntaxError, getPos(), "Invalid hex escape in name");
  360|   674k|	  goto notEscChar;
  361|   674k|	}
  362|   144k|	getChar();
  363|   144k|	c2 = lookChar();
  364|   144k|	if (c2 >= '0' && c2 <= '9') {
  ------------------
  |  Branch (364:6): [True: 143k, False: 783]
  |  Branch (364:19): [True: 26.8k, False: 116k]
  ------------------
  365|  26.8k|	  c = (c << 4) + (c2 - '0');
  366|   117k|	} else if (c2 >= 'A' && c2 <= 'F') {
  ------------------
  |  Branch (366:13): [True: 93.8k, False: 23.3k]
  |  Branch (366:26): [True: 46.6k, False: 47.1k]
  ------------------
  367|  46.6k|	  c = (c << 4) + (c2 - 'A' + 10);
  368|  70.5k|	} else if (c2 >= 'a' && c2 <= 'f') {
  ------------------
  |  Branch (368:13): [True: 600, False: 69.9k]
  |  Branch (368:26): [True: 177, False: 423]
  ------------------
  369|    177|	  c = (c << 4) + (c2 - 'a' + 10);
  370|  70.4k|	} else {
  371|  70.4k|	  error(errSyntaxError, getPos(), "Invalid hex escape in name");
  372|  70.4k|	  goto notEscChar;
  373|  70.4k|	}
  374|  73.6k|	getChar();
  375|  73.6k|	if (c == 0) {
  ------------------
  |  Branch (375:6): [True: 484, False: 73.2k]
  ------------------
  376|    484|	  invalid = gTrue;
  ------------------
  |  |   17|    484|#define gTrue 1
  ------------------
  377|    484|	}
  378|  73.6k|      }
  379|  14.3M|     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|  14.3M|      ++n;
  384|  14.3M|      if (n < tokBufSize) {
  ------------------
  |  |   19|  14.3M|#define tokBufSize 128		// size of token buffer
  ------------------
  |  Branch (384:11): [True: 13.2M, False: 1.09M]
  ------------------
  385|  13.2M|	*p++ = (char)c;
  386|  13.2M|      } else if (n == tokBufSize) {
  ------------------
  |  |   19|  1.09M|#define tokBufSize 128		// size of token buffer
  ------------------
  |  Branch (386:18): [True: 785, False: 1.09M]
  ------------------
  387|    785|	*p = (char)c;
  388|    785|	s = new GString(tokBuf, n);
  389|  1.09M|      } else {
  390|  1.09M|	s->append((char)c);
  391|  1.09M|      }
  392|  14.3M|    }
  393|  5.20M|    if (invalid) {
  ------------------
  |  Branch (393:9): [True: 484, False: 5.19M]
  ------------------
  394|    484|      error(errSyntaxError, getPos(), "Null character in name");
  395|    484|      obj->initError();
  396|    484|      if (s) {
  ------------------
  |  Branch (396:11): [True: 237, False: 247]
  ------------------
  397|    237|	delete s;
  398|    237|      }
  399|  5.19M|    } else if (n < tokBufSize) {
  ------------------
  |  |   19|  5.19M|#define tokBufSize 128		// size of token buffer
  ------------------
  |  Branch (399:16): [True: 5.19M, False: 548]
  ------------------
  400|  5.19M|      *p = '\0';
  401|  5.19M|      obj->initName(tokBuf);
  402|  5.19M|    } else {
  403|    548|      obj->initName(s->getCString());
  404|    548|      delete s;
  405|    548|    }
  406|  5.20M|    break;
  407|       |
  408|       |  // array punctuation
  409|  5.00M|  case '[':
  ------------------
  |  Branch (409:3): [True: 5.00M, False: 33.0M]
  ------------------
  410|  5.36M|  case ']':
  ------------------
  |  Branch (410:3): [True: 362k, False: 37.7M]
  ------------------
  411|  5.36M|    tokBuf[0] = (char)c;
  412|  5.36M|    tokBuf[1] = '\0';
  413|  5.36M|    obj->initCmd(tokBuf);
  414|  5.36M|    break;
  415|       |
  416|       |  // hex string or dict punctuation
  417|  3.62M|  case '<':
  ------------------
  |  Branch (417:3): [True: 3.62M, False: 34.4M]
  ------------------
  418|  3.62M|    c = lookChar();
  419|       |
  420|       |    // dict punctuation
  421|  3.62M|    if (c == '<') {
  ------------------
  |  Branch (421:9): [True: 2.92M, False: 697k]
  ------------------
  422|  2.92M|      getChar();
  423|  2.92M|      tokBuf[0] = tokBuf[1] = '<';
  424|  2.92M|      tokBuf[2] = '\0';
  425|  2.92M|      obj->initCmd(tokBuf);
  426|       |
  427|       |    // hex string
  428|  2.92M|    } else {
  429|   697k|      p = tokBuf;
  430|   697k|      m = n = 0;
  431|   697k|      c2 = 0;
  432|   697k|      s = NULL;
  433|   697k|      nErrors = 0;
  434|  47.7M|      while (nErrors < 100) {
  ------------------
  |  Branch (434:14): [True: 47.6M, False: 154k]
  ------------------
  435|  47.6M|	c = getChar();
  436|  47.6M|	if (c == '>') {
  ------------------
  |  Branch (436:6): [True: 541k, False: 47.0M]
  ------------------
  437|   541k|	  break;
  438|  47.0M|	} else if (c == EOF) {
  ------------------
  |  Branch (438:13): [True: 1.26k, False: 47.0M]
  ------------------
  439|  1.26k|	  error(errSyntaxError, getPos(), "Unterminated hex string");
  440|  1.26k|	  break;
  441|  47.0M|	} else if (specialChars[c] != 1) {
  ------------------
  |  Branch (441:13): [True: 41.8M, False: 5.23M]
  ------------------
  442|  41.8M|	  c2 = c2 << 4;
  443|  41.8M|	  if (c >= '0' && c <= '9') {
  ------------------
  |  Branch (443:8): [True: 37.4M, False: 4.40M]
  |  Branch (443:20): [True: 3.94M, False: 33.5M]
  ------------------
  444|  3.94M|	    c2 += c - '0';
  445|  37.9M|	  } else if (c >= 'A' && c <= 'F') {
  ------------------
  |  Branch (445:15): [True: 29.7M, False: 8.19M]
  |  Branch (445:27): [True: 534k, False: 29.1M]
  ------------------
  446|   534k|	    c2 += c - 'A' + 10;
  447|  37.3M|	  } else if (c >= 'a' && c <= 'f') {
  ------------------
  |  Branch (447:15): [True: 26.7M, False: 10.6M]
  |  Branch (447:27): [True: 5.83M, False: 20.8M]
  ------------------
  448|  5.83M|	    c2 += c - 'a' + 10;
  449|  31.5M|	  } else {
  450|  31.5M|	    error(errSyntaxError, getPos(),
  451|  31.5M|		  "Illegal character <{0:02x}> in hex string", c);
  452|  31.5M|	    ++nErrors;
  453|  31.5M|	  }
  454|  41.8M|	  if (++m == 2) {
  ------------------
  |  Branch (454:8): [True: 20.7M, False: 21.0M]
  ------------------
  455|  20.7M|	    if (n == tokBufSize) {
  ------------------
  |  |   19|  20.7M|#define tokBufSize 128		// size of token buffer
  ------------------
  |  Branch (455:10): [True: 1.87k, False: 20.7M]
  ------------------
  456|  1.87k|	      if (!s)
  ------------------
  |  Branch (456:12): [True: 870, False: 1.00k]
  ------------------
  457|    870|		s = new GString(tokBuf, tokBufSize);
  ------------------
  |  |   19|    870|#define tokBufSize 128		// size of token buffer
  ------------------
  458|  1.00k|	      else
  459|  1.00k|		s->append(tokBuf, tokBufSize);
  ------------------
  |  |   19|  1.00k|#define tokBufSize 128		// size of token buffer
  ------------------
  460|  1.87k|	      p = tokBuf;
  461|  1.87k|	      n = 0;
  462|  1.87k|	    }
  463|  20.7M|	    *p++ = (char)c2;
  464|  20.7M|	    ++n;
  465|  20.7M|	    c2 = 0;
  466|  20.7M|	    m = 0;
  467|  20.7M|	  }
  468|  41.8M|	}
  469|  47.6M|      }
  470|   697k|      if (!s)
  ------------------
  |  Branch (470:11): [True: 696k, False: 870]
  ------------------
  471|   696k|	s = new GString(tokBuf, n);
  472|    870|      else
  473|    870|	s->append(tokBuf, n);
  474|   697k|      if (m == 1)
  ------------------
  |  Branch (474:11): [True: 318k, False: 378k]
  ------------------
  475|   318k|	s->append((char)(c2 << 4));
  476|   697k|      obj->initString(s);
  477|   697k|    }
  478|  3.62M|    break;
  479|       |
  480|       |  // dict punctuation
  481|  2.62M|  case '>':
  ------------------
  |  Branch (481:3): [True: 2.62M, False: 35.4M]
  ------------------
  482|  2.62M|    c = lookChar();
  483|  2.62M|    if (c == '>') {
  ------------------
  |  Branch (483:9): [True: 1.59M, False: 1.03M]
  ------------------
  484|  1.59M|      getChar();
  485|  1.59M|      tokBuf[0] = tokBuf[1] = '>';
  486|  1.59M|      tokBuf[2] = '\0';
  487|  1.59M|      obj->initCmd(tokBuf);
  488|  1.59M|    } else {
  489|  1.03M|      error(errSyntaxError, getPos(), "Illegal character '>'");
  490|  1.03M|      obj->initError();
  491|  1.03M|    }
  492|  2.62M|    break;
  493|       |
  494|       |  // error
  495|   795k|  case ')':
  ------------------
  |  Branch (495:3): [True: 795k, False: 37.2M]
  ------------------
  496|   969k|  case '{':
  ------------------
  |  Branch (496:3): [True: 174k, False: 37.9M]
  ------------------
  497|  1.08M|  case '}':
  ------------------
  |  Branch (497:3): [True: 112k, False: 37.9M]
  ------------------
  498|  1.08M|    error(errSyntaxError, getPos(), "Illegal character '{0:c}'", c);
  499|  1.08M|    obj->initError();
  500|  1.08M|    break;
  501|       |
  502|       |  // command
  503|  15.1M|  default:
  ------------------
  |  Branch (503:3): [True: 15.1M, False: 22.9M]
  ------------------
  504|  15.1M|    p = tokBuf;
  505|  15.1M|    *p++ = (char)c;
  506|  15.1M|    n = 1;
  507|   156M|    while ((c = lookChar()) != EOF && !specialChars[c]) {
  ------------------
  |  Branch (507:12): [True: 156M, False: 13.9k]
  |  Branch (507:39): [True: 142M, False: 14.6M]
  ------------------
  508|   142M|      getChar();
  509|   142M|      if (++n == tokBufSize) {
  ------------------
  |  |   19|   142M|#define tokBufSize 128		// size of token buffer
  ------------------
  |  Branch (509:11): [True: 535k, False: 141M]
  ------------------
  510|   535k|	error(errSyntaxError, getPos(), "Command token too long");
  511|   535k|	break;
  512|   535k|      }
  513|   141M|      *p++ = (char)c;
  514|   141M|    }
  515|  15.1M|    *p = '\0';
  516|  15.1M|    if (tokBuf[0] == 't' && !strcmp(tokBuf, "true")) {
  ------------------
  |  Branch (516:9): [True: 1.94M, False: 13.2M]
  |  Branch (516:29): [True: 66.6k, False: 1.87M]
  ------------------
  517|  66.6k|      obj->initBool(gTrue);
  ------------------
  |  |   17|  66.6k|#define gTrue 1
  ------------------
  518|  15.1M|    } else if (tokBuf[0] == 'f' && !strcmp(tokBuf, "false")) {
  ------------------
  |  Branch (518:16): [True: 13.6k, False: 15.1M]
  |  Branch (518:36): [True: 1.93k, False: 11.7k]
  ------------------
  519|  1.93k|      obj->initBool(gFalse);
  ------------------
  |  |   18|  1.93k|#define gFalse 0
  ------------------
  520|  15.1M|    } else if (tokBuf[0] == 'n' && !strcmp(tokBuf, "null")) {
  ------------------
  |  Branch (520:16): [True: 62.8k, False: 15.0M]
  |  Branch (520:36): [True: 850, False: 61.9k]
  ------------------
  521|    850|      obj->initNull();
  522|  15.1M|    } else {
  523|  15.1M|      obj->initCmd(tokBuf);
  524|  15.1M|    }
  525|  15.1M|    break;
  526|  38.0M|  }
  527|       |
  528|  38.0M|  return obj;
  529|  38.0M|}
_ZN5Lexer14skipToNextLineEv:
  531|  52.0k|void Lexer::skipToNextLine() {
  532|  52.0k|  int c;
  533|       |
  534|   288k|  while (1) {
  ------------------
  |  Branch (534:10): [True: 288k, Folded]
  ------------------
  535|   288k|    c = getChar();
  536|   288k|    if (c == EOF || c == '\n') {
  ------------------
  |  Branch (536:9): [True: 1.58k, False: 286k]
  |  Branch (536:21): [True: 19.1k, False: 267k]
  ------------------
  537|  20.7k|      return;
  538|  20.7k|    }
  539|   267k|    if (c == '\r') {
  ------------------
  |  Branch (539:9): [True: 31.3k, False: 235k]
  ------------------
  540|  31.3k|      if ((c = lookChar()) == '\n') {
  ------------------
  |  Branch (540:11): [True: 25.0k, False: 6.30k]
  ------------------
  541|  25.0k|	getChar();
  542|  25.0k|      }
  543|  31.3k|      return;
  544|  31.3k|    }
  545|   267k|  }
  546|  52.0k|}
_ZN5Lexer9skipToEOFEv:
  548|  19.9k|void Lexer::skipToEOF() {
  549|  1.16M|  while (getChar() != EOF) ;
  ------------------
  |  Branch (549:10): [True: 1.14M, False: 19.9k]
  ------------------
  550|  19.9k|}
_ZN5Lexer7isSpaceEi:
  552|  26.1M|GBool Lexer::isSpace(int c) {
  553|  26.1M|  return c >= 0 && c <= 0xff && specialChars[c] == 1;
  ------------------
  |  Branch (553:10): [True: 26.1M, False: 6.12k]
  |  Branch (553:20): [True: 26.1M, False: 0]
  |  Branch (553:33): [True: 6.35M, False: 19.8M]
  ------------------
  554|  26.1M|}

_ZN5Lexer8skipCharEv:
   49|   288k|  void skipChar() { getChar(); }
_ZN5Lexer9getStreamEv:
   56|   203k|    { return curStr.isNone() ? (Stream *)NULL : curStr.getStream(); }
  ------------------
  |  Branch (56:14): [True: 1.58k, False: 202k]
  ------------------
_ZN5Lexer6getPosEv:
   60|  47.8M|    { return curStr.isNone() ? -1 : curStr.streamGetPos(); }
  ------------------
  |  Branch (60:14): [True: 404k, False: 47.4M]
  ------------------
_ZN5Lexer6setPosEli:
   64|  40.2k|    { if (!curStr.isNone()) curStr.streamSetPos(pos, dir); }
  ------------------
  |  Branch (64:11): [True: 40.2k, False: 0]
  ------------------

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

_ZN10LinkActionD2Ev:
   41|    456|  virtual ~LinkAction() {}
_ZN8LinkDest4isOkEv:
   85|    277|  GBool isOk() { return ok; }
_ZN8LinkGoTo4isOkEv:
  135|    291|  virtual GBool isOk() { return dest || namedDest; }
  ------------------
  |  Branch (135:33): [True: 183, False: 108]
  |  Branch (135:41): [True: 18, False: 90]
  ------------------
_ZN9LinkGoToR4isOkEv:
  165|     89|  virtual GBool isOk() { return fileName && (dest || namedDest); }
  ------------------
  |  Branch (165:33): [True: 12, False: 77]
  |  Branch (165:46): [True: 2, False: 10]
  |  Branch (165:54): [True: 5, False: 5]
  ------------------
_ZN7LinkURI4isOkEv:
  223|     10|  virtual GBool isOk() { return uri != NULL; }
_ZN9LinkNamed4isOkEv:
  247|      9|  virtual GBool isOk() { return name != NULL; }
_ZN14LinkJavaScript4isOkEv:
  296|     18|  virtual GBool isOk() { return js != NULL; }
_ZN11LinkUnknown4isOkEv:
  373|     39|  virtual GBool isOk() { return action != NULL; }

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

_ZN6Object9initArrayEP4XRef:
   51|   544k|Object *Object::initArray(XRef *xref) {
   52|   544k|  initObj(objArray);
  ------------------
  |  |   77|   544k|#define initObj(t) type = t
  ------------------
   53|   544k|  array = new Array(xref);
   54|   544k|  return this;
   55|   544k|}
_ZN6Object8initDictEP4XRef:
   57|   436k|Object *Object::initDict(XRef *xref) {
   58|   436k|  initObj(objDict);
  ------------------
  |  |   77|   436k|#define initObj(t) type = t
  ------------------
   59|   436k|  dict = new Dict(xref);
   60|   436k|  return this;
   61|   436k|}
_ZN6Object8initDictEP4Dict:
   63|  3.27k|Object *Object::initDict(Dict *dictA) {
   64|  3.27k|  initObj(objDict);
  ------------------
  |  |   77|  3.27k|#define initObj(t) type = t
  ------------------
   65|  3.27k|  dict = dictA;
   66|  3.27k|  dict->incRef();
   67|  3.27k|  return this;
   68|  3.27k|}
_ZN6Object10initStreamEP6Stream:
   70|   254k|Object *Object::initStream(Stream *streamA) {
   71|   254k|  initObj(objStream);
  ------------------
  |  |   77|   254k|#define initObj(t) type = t
  ------------------
   72|   254k|  stream = streamA;
   73|   254k|  return this;
   74|   254k|}
_ZN6Object4copyEPS_:
   76|   136M|Object *Object::copy(Object *obj) {
   77|   136M|  *obj = *this;
   78|   136M|  switch (type) {
   79|   499k|  case objString:
  ------------------
  |  Branch (79:3): [True: 499k, False: 136M]
  ------------------
   80|   499k|    obj->string = string->copy();
   81|   499k|    break;
   82|  4.38M|  case objName:
  ------------------
  |  Branch (82:3): [True: 4.38M, False: 132M]
  ------------------
   83|  4.38M|    obj->name = copyString(name);
   84|  4.38M|    break;
   85|   746k|  case objArray:
  ------------------
  |  Branch (85:3): [True: 746k, False: 135M]
  ------------------
   86|   746k|    array->incRef();
   87|   746k|    break;
   88|  1.57M|  case objDict:
  ------------------
  |  Branch (88:3): [True: 1.57M, False: 135M]
  ------------------
   89|  1.57M|    dict->incRef();
   90|  1.57M|    break;
   91|   783k|  case objStream:
  ------------------
  |  Branch (91:3): [True: 783k, False: 135M]
  ------------------
   92|   783k|    obj->stream = stream->copy();
   93|   783k|    break;
   94|  16.3M|  case objCmd:
  ------------------
  |  Branch (94:3): [True: 16.3M, False: 120M]
  ------------------
   95|  16.3M|    obj->cmd = copyString(cmd);
   96|  16.3M|    break;
   97|   112M|  default:
  ------------------
  |  Branch (97:3): [True: 112M, False: 24.3M]
  ------------------
   98|   112M|    break;
   99|   136M|  }
  100|       |#ifdef DEBUG_OBJECT_MEM
  101|       |#if MULTITHREADED
  102|       |  gAtomicIncrement(&numAlloc[type]);
  103|       |#else
  104|       |  ++numAlloc[type];
  105|       |#endif
  106|       |#endif
  107|   136M|  return obj;
  108|   136M|}
_ZN6Object5fetchEP4XRefPS_i:
  110|  3.69M|Object *Object::fetch(XRef *xref, Object *obj, int recursion) {
  111|  3.69M|  return (type == objRef && xref) ?
  ------------------
  |  Branch (111:11): [True: 1.13M, False: 2.56M]
  |  Branch (111:29): [True: 1.13M, False: 3]
  ------------------
  112|  2.56M|         xref->fetch(ref.num, ref.gen, obj, recursion) : copy(obj);
  113|  3.69M|}
_ZN6Object4freeEv:
  115|   313M|void Object::free() {
  116|   313M|  switch (type) {
  117|  1.33M|  case objString:
  ------------------
  |  Branch (117:3): [True: 1.33M, False: 311M]
  ------------------
  118|  1.33M|    delete string;
  119|  1.33M|    break;
  120|  9.58M|  case objName:
  ------------------
  |  Branch (120:3): [True: 9.58M, False: 303M]
  ------------------
  121|  9.58M|    gfree(name);
  122|  9.58M|    break;
  123|  1.29M|  case objArray:
  ------------------
  |  Branch (123:3): [True: 1.29M, False: 312M]
  ------------------
  124|  1.29M|    if (!array->decRef()) {
  ------------------
  |  Branch (124:9): [True: 544k, False: 746k]
  ------------------
  125|   544k|      delete array;
  126|   544k|    }
  127|  1.29M|    break;
  128|  2.01M|  case objDict:
  ------------------
  |  Branch (128:3): [True: 2.01M, False: 311M]
  ------------------
  129|  2.01M|    if (!dict->decRef()) {
  ------------------
  |  Branch (129:9): [True: 435k, False: 1.57M]
  ------------------
  130|   435k|      delete dict;
  131|   435k|    }
  132|  2.01M|    break;
  133|  1.03M|  case objStream:
  ------------------
  |  Branch (133:3): [True: 1.03M, False: 312M]
  ------------------
  134|  1.03M|    delete stream;
  135|  1.03M|    break;
  136|  41.3M|  case objCmd:
  ------------------
  |  Branch (136:3): [True: 41.3M, False: 271M]
  ------------------
  137|  41.3M|    gfree(cmd);
  138|  41.3M|    break;
  139|   256M|  default:
  ------------------
  |  Branch (139:3): [True: 256M, False: 56.6M]
  ------------------
  140|   256M|    break;
  141|   313M|  }
  142|       |#ifdef DEBUG_OBJECT_MEM
  143|       |#if MULTITHREADED
  144|       |  gAtomicDecrement(&numAlloc[type]);
  145|       |#else
  146|       |  --numAlloc[type];
  147|       |#endif
  148|       |#endif
  149|   313M|  type = objNone;
  150|   313M|}
_ZN6Object11getTypeNameEv:
  152|   157k|const char *Object::getTypeName() {
  153|   157k|  return objTypeNames[type];
  154|   157k|}

_ZN6ObjectC2Ev:
   85|   244M|    type(objNone) {}
_ZN6Object8initNullEv:
   99|  28.9M|    { initObj(objNull); return this; }
  ------------------
  |  |   77|  28.9M|#define initObj(t) type = t
  ------------------
_ZN6Object8isStreamEv:
  134|  24.0M|  GBool isStream() { return type == objStream; }
_ZN6Object9getStreamEv:
  158|   375k|  Stream *getStream() { return stream; }
_ZN6Object8initBoolEi:
   89|  68.5k|    { initObj(objBool); booln = boolnA; return this; }
  ------------------
  |  |   77|  68.5k|#define initObj(t) type = t
  ------------------
_ZN6Object7initIntEi:
   91|  7.39M|    { initObj(objInt); intg = intgA; return this; }
  ------------------
  |  |   77|  7.39M|#define initObj(t) type = t
  ------------------
_ZN6Object8initRealEd:
   93|   307k|    { initObj(objReal); real = realA; return this; }
  ------------------
  |  |   77|   307k|#define initObj(t) type = t
  ------------------
_ZN6Object10initStringEP7GString:
   95|   835k|    { initObj(objString); string = stringA; return this; }
  ------------------
  |  |   77|   835k|#define initObj(t) type = t
  ------------------
_ZN6Object8initNameEPKc:
   97|  5.19M|    { initObj(objName); name = copyString(nameA); return this; }
  ------------------
  |  |   77|  5.19M|#define initObj(t) type = t
  ------------------
_ZN6Object7initRefEii:
  105|   432k|    { initObj(objRef); ref.num = numA; ref.gen = genA; return this; }
  ------------------
  |  |   77|   432k|#define initObj(t) type = t
  ------------------
_ZN6Object7initCmdEPc:
  107|  25.0M|    { initObj(objCmd); cmd = copyString(cmdA); return this; }
  ------------------
  |  |   77|  25.0M|#define initObj(t) type = t
  ------------------
_ZN6Object9initErrorEv:
  109|  2.12M|    { initObj(objError); return this; }
  ------------------
  |  |   77|  2.12M|#define initObj(t) type = t
  ------------------
_ZN6Object7initEOFEv:
  111|   104M|    { initObj(objEOF); return this; }
  ------------------
  |  |   77|   104M|#define initObj(t) type = t
  ------------------
_ZN6Object6isBoolEv:
  125|  8.37k|  GBool isBool() { return type == objBool; }
_ZN6Object5isIntEv:
  126|   184M|  GBool isInt() { return type == objInt; }
_ZN6Object5isNumEv:
  128|   342k|  GBool isNum() { return type == objInt || type == objReal; }
  ------------------
  |  Branch (128:26): [True: 112k, False: 230k]
  |  Branch (128:44): [True: 37.4k, False: 192k]
  ------------------
_ZN6Object8isStringEv:
  129|   123M|  GBool isString() { return type == objString; }
_ZN6Object6isNameEv:
  130|  14.1M|  GBool isName() { return type == objName; }
_ZN6Object6isNullEv:
  131|   502k|  GBool isNull() { return type == objNull; }
_ZN6Object7isArrayEv:
  132|  3.23M|  GBool isArray() { return type == objArray; }
_ZN6Object6isDictEv:
  133|  1.51M|  GBool isDict() { return type == objDict; }
_ZN6Object5isRefEv:
  135|  8.60M|  GBool isRef() { return type == objRef; }
_ZN6Object7isErrorEv:
  137|  1.63M|  GBool isError() { return type == objError; }
_ZN6Object5isEOFEv:
  138|  35.3M|  GBool isEOF() { return type == objEOF; }
_ZN6Object6isNoneEv:
  139|  2.24G|  GBool isNone() { return type == objNone; }
_ZN6Object6isNameEPKc:
  143|   392k|    { return type == objName && !strcmp(name, nameA); }
  ------------------
  |  Branch (143:14): [True: 321k, False: 71.1k]
  |  Branch (143:33): [True: 196k, False: 124k]
  ------------------
_ZN6Object5isCmdEPKc:
  147|   192M|    { return type == objCmd && !strcmp(cmd, cmdA); }
  ------------------
  |  Branch (147:14): [True: 54.9M, False: 137M]
  |  Branch (147:32): [True: 2.12M, False: 52.8M]
  ------------------
_ZN6Object7getBoolEv:
  150|    892|  GBool getBool() { return booln; }
_ZN6Object6getIntEv:
  151|  3.92M|  int getInt() { return intg; }
_ZN6Object6getNumEv:
  153|   150k|  double getNum() { return type == objInt ? (double)intg : real; }
  ------------------
  |  Branch (153:28): [True: 112k, False: 37.4k]
  ------------------
_ZN6Object9getStringEv:
  154|  40.5k|  GString *getString() { return string; }
_ZN6Object7getNameEv:
  155|  1.67M|  char *getName() { return name; }
_ZN6Object8getArrayEv:
  156|    277|  Array *getArray() { return array; }
_ZN6Object7getDictEv:
  157|   955k|  Dict *getDict() { return dict; }
_ZN6Object6getRefEv:
  159|  94.2k|  Ref getRef() { return ref; }
_ZN6Object9getRefNumEv:
  160|  1.54M|  int getRefNum() { return ref.num; }
_ZN6Object9getRefGenEv:
  161|   968k|  int getRefGen() { return ref.gen; }
_ZN6Object14arrayGetLengthEv:
  233|  8.17M|  { return array->getLength(); }
_ZN6Object8arrayAddEPS_:
  236|  18.2M|  { array->add(elem); }
_ZN6Object8arrayGetEiPS_i:
  239|   292k|  { return array->get(i, obj, recursion); }
_ZN6Object10arrayGetNFEiPS_:
  242|  7.60M|  { return array->getNF(i, obj); }
_ZN6Object7dictAddEPcPS_:
  254|  1.59M|  { dict->add(key, val); }
_ZN6Object10dictLookupEPKcPS_i:
  263|   626k|  { return dict->lookup(key, obj, recursion); }
_ZN6Object12dictLookupNFEPKcPS_:
  266|  30.7k|  { return dict->lookupNF(key, obj); }
_ZN6Object11streamResetEv:
  290|   213k|  { stream->reset(); }
_ZN6Object11streamCloseEv:
  293|   210k|  { stream->close(); }
_ZN6Object13streamGetCharEv:
  296|  1.88G|  { return stream->getChar(); }
_ZN6Object14streamLookCharEv:
  299|   206M|  { return stream->lookChar(); }
_ZN6Object12streamGetPosEv:
  308|  47.4M|  { return stream->getPos(); }
_ZN6Object12streamSetPosEli:
  311|  40.2k|  { stream->setPos(pos, dir); }
_ZN6Object13streamGetDictEv:
  314|   481k|  { return stream->getDict(); }

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

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

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

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

_ZN6PDFDoc4isOkEv:
   58|  8.00k|  GBool isOk() { return ok; }
_ZN6PDFDoc7getXRefEv:
   70|   946k|  XRef *getXRef() { return xref; }
_ZN6PDFDoc11getFileNameEv:
   64|  1.63k|  GString *getFileName() { return fileName; }
_ZN6PDFDoc10getCatalogEv:
   73|  1.63k|  Catalog *getCatalog() { return catalog; }
_ZN6PDFDoc11getNumPagesEv:
   94|   435k|  int getNumPages() { return catalog->getNumPages(); }
_ZN6PDFDoc7getCoreEv:
  186|     76|  PDFCore *getCore() { return core; }

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

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

_ZN6ParserC2EP4XRefP5Lexeri:
   22|   205k|Parser::Parser(XRef *xrefA, Lexer *lexerA, GBool allowStreamsA) {
   23|   205k|  xref = xrefA;
   24|   205k|  lexer = lexerA;
   25|   205k|  inlineImg = 0;
   26|   205k|  allowStreams = allowStreamsA;
   27|   205k|  lexer->getObj(&buf1);
   28|   205k|  lexer->getObj(&buf2);
   29|   205k|}
_ZN6ParserD2Ev:
   31|   205k|Parser::~Parser() {
   32|   205k|  buf1.free();
   33|   205k|  buf2.free();
   34|   205k|  delete lexer;
   35|   205k|}
_ZN6Parser6getObjEP6ObjectiPh14CryptAlgorithmiiii:
   40|   127M|		       int objNum, int objGen, int recursion) {
   41|   127M|  char *key;
   42|   127M|  Stream *str;
   43|   127M|  Object obj2;
   44|   127M|  int num;
   45|   127M|  DecryptStream *decrypt;
   46|   127M|  GString *s, *s2;
   47|   127M|  int c;
   48|       |
   49|       |  // refill buffer after inline image data
   50|   127M|  if (inlineImg == 2) {
  ------------------
  |  Branch (50:7): [True: 55.5k, False: 127M]
  ------------------
   51|  55.5k|    buf1.free();
   52|  55.5k|    buf2.free();
   53|  55.5k|    lexer->getObj(&buf1);
   54|  55.5k|    lexer->getObj(&buf2);
   55|  55.5k|    inlineImg = 0;
   56|  55.5k|  }
   57|       |
   58|       |  // array
   59|   127M|  if (!simpleOnly && recursion < objectRecursionLimit && buf1.isCmd("[")) {
  ------------------
  |  |   20|   147M|#define objectRecursionLimit 500
  ------------------
  |  Branch (59:7): [True: 19.9M, False: 107M]
  |  Branch (59:22): [True: 7.73M, False: 12.2M]
  |  Branch (59:58): [True: 544k, False: 7.19M]
  ------------------
   60|   544k|    shift();
   61|   544k|    obj->initArray(xref);
   62|  18.8M|    while (!buf1.isCmd("]") && !buf1.isEOF())
  ------------------
  |  Branch (62:12): [True: 18.6M, False: 186k]
  |  Branch (62:32): [True: 18.2M, False: 358k]
  ------------------
   63|  18.2M|      obj->arrayAdd(getObj(&obj2, gFalse, fileKey, encAlgorithm, keyLength,
  ------------------
  |  |   18|  18.2M|#define gFalse 0
  ------------------
   64|  18.2M|			   objNum, objGen, recursion + 1));
   65|   544k|    if (buf1.isEOF())
  ------------------
  |  Branch (65:9): [True: 358k, False: 186k]
  ------------------
   66|   358k|      error(errSyntaxError, getPos(), "End of file inside array");
   67|   544k|    shift();
   68|       |
   69|       |  // dictionary or stream
   70|   127M|  } else if (!simpleOnly && recursion < objectRecursionLimit &&
  ------------------
  |  |   20|   146M|#define objectRecursionLimit 500
  ------------------
  |  Branch (70:14): [True: 19.4M, False: 107M]
  |  Branch (70:29): [True: 7.19M, False: 12.2M]
  ------------------
   71|  7.19M|	     buf1.isCmd("<<")) {
  ------------------
  |  Branch (71:7): [True: 415k, False: 6.78M]
  ------------------
   72|   415k|    shift();
   73|   415k|    obj->initDict(xref);
   74|  14.5M|    while (!buf1.isCmd(">>") && !buf1.isEOF()) {
  ------------------
  |  Branch (74:12): [True: 14.1M, False: 345k]
  |  Branch (74:33): [True: 14.1M, False: 34.0k]
  ------------------
   75|  14.1M|      if (!buf1.isName()) {
  ------------------
  |  Branch (75:11): [True: 12.4M, False: 1.63M]
  ------------------
   76|  12.4M|	error(errSyntaxError, getPos(),
   77|  12.4M|	      "Dictionary key must be a name object");
   78|  12.4M|	shift();
   79|  12.4M|      } else {
   80|  1.63M|	key = copyString(buf1.getName());
   81|  1.63M|	shift();
   82|  1.63M|	if (buf1.isEOF() || buf1.isError()) {
  ------------------
  |  Branch (82:6): [True: 2.08k, False: 1.63M]
  |  Branch (82:22): [True: 33.9k, False: 1.59M]
  ------------------
   83|  36.0k|	  gfree(key);
   84|  36.0k|	  break;
   85|  36.0k|	}
   86|  1.59M|	obj->dictAdd(key, getObj(&obj2, gFalse,
  ------------------
  |  |   18|  1.59M|#define gFalse 0
  ------------------
   87|  1.59M|				 fileKey, encAlgorithm, keyLength,
   88|  1.59M|				 objNum, objGen, recursion + 1));
   89|  1.59M|      }
   90|  14.1M|    }
   91|   415k|    if (buf1.isEOF())
  ------------------
  |  Branch (91:9): [True: 36.1k, False: 379k]
  ------------------
   92|  36.1k|      error(errSyntaxError, getPos(), "End of file inside dictionary");
   93|       |    // stream objects are not allowed inside content streams or
   94|       |    // object streams
   95|   415k|    if (allowStreams && buf2.isCmd("stream")) {
  ------------------
  |  Branch (95:9): [True: 149k, False: 265k]
  |  Branch (95:25): [True: 52.0k, False: 97.8k]
  ------------------
   96|  52.0k|      if ((str = makeStream(obj, fileKey, encAlgorithm, keyLength,
  ------------------
  |  Branch (96:11): [True: 48.1k, False: 3.96k]
  ------------------
   97|  52.0k|			    objNum, objGen, recursion + 1))) {
   98|  48.1k|	obj->initStream(str);
   99|  48.1k|      } else {
  100|  3.96k|	obj->free();
  101|  3.96k|	obj->initError();
  102|  3.96k|      }
  103|   363k|    } else {
  104|   363k|      shift();
  105|   363k|    }
  106|       |
  107|       |  // indirect reference or integer
  108|   126M|  } else if (buf1.isInt()) {
  ------------------
  |  Branch (108:14): [True: 3.06M, False: 123M]
  ------------------
  109|  3.06M|    num = buf1.getInt();
  110|  3.06M|    shift();
  111|  3.06M|    if (buf1.isInt() && buf2.isCmd("R")) {
  ------------------
  |  Branch (111:9): [True: 1.07M, False: 1.98M]
  |  Branch (111:25): [True: 242k, False: 836k]
  ------------------
  112|   242k|      int gen = buf1.getInt();
  113|   242k|      if (num >= 0 && gen >= 0) {
  ------------------
  |  Branch (113:11): [True: 241k, False: 1.32k]
  |  Branch (113:23): [True: 240k, False: 430]
  ------------------
  114|   240k|	obj->initRef(num, gen);
  115|   240k|      } else {
  116|  1.75k|	error(errSyntaxError, getPos(),
  117|  1.75k|	      "Negative number or generation in indirect reference");
  118|  1.75k|	obj->initError();
  119|  1.75k|      }
  120|   242k|      shift();
  121|   242k|      shift();
  122|  2.82M|    } else {
  123|  2.82M|      obj->initInt(num);
  124|  2.82M|    }
  125|       |
  126|       |  // string
  127|   123M|  } else if (buf1.isString() && fileKey) {
  ------------------
  |  Branch (127:14): [True: 401k, False: 123M]
  |  Branch (127:33): [True: 11.6k, False: 390k]
  ------------------
  128|  11.6k|    s = buf1.getString();
  129|  11.6k|    s2 = new GString();
  130|  11.6k|    obj2.initNull();
  131|  11.6k|    decrypt = new DecryptStream(new MemStream(s->getCString(), 0,
  132|  11.6k|					      s->getLength(), &obj2),
  133|  11.6k|				fileKey, encAlgorithm, keyLength,
  134|  11.6k|				objNum, objGen);
  135|  11.6k|    decrypt->reset();
  136|   391k|    while ((c = decrypt->getChar()) != EOF) {
  ------------------
  |  Branch (136:12): [True: 379k, False: 11.6k]
  ------------------
  137|   379k|      s2->append((char)c);
  138|   379k|    }
  139|  11.6k|    delete decrypt;
  140|  11.6k|    obj->initString(s2);
  141|  11.6k|    shift();
  142|       |
  143|       |  // simple object
  144|   123M|  } else {
  145|   123M|    buf1.copy(obj);
  146|   123M|    shift();
  147|   123M|  }
  148|       |
  149|   127M|  return obj;
  150|   127M|}
_ZN6Parser10makeStreamEP6ObjectPh14CryptAlgorithmiiii:
  154|  52.0k|			   int objNum, int objGen, int recursion) {
  155|       |  // get stream start position
  156|  52.0k|  lexer->skipToNextLine();
  157|  52.0k|  Stream *curStr = lexer->getStream();
  158|  52.0k|  if (!curStr) {
  ------------------
  |  Branch (158:7): [True: 1.58k, False: 50.5k]
  ------------------
  159|  1.58k|    return NULL;
  160|  1.58k|  }
  161|  50.5k|  GFileOffset pos = curStr->getPos();
  162|       |
  163|  50.5k|  GBool haveLength = gFalse;
  ------------------
  |  |   18|  50.5k|#define gFalse 0
  ------------------
  164|  50.5k|  GFileOffset length = 0;
  165|  50.5k|  GFileOffset endPos;
  166|       |
  167|       |  // check for length in damaged file
  168|  50.5k|  if (xref && xref->getStreamEnd(pos, &endPos)) {
  ------------------
  |  Branch (168:7): [True: 49.7k, False: 720]
  |  Branch (168:15): [True: 18.1k, False: 31.6k]
  ------------------
  169|  18.1k|    length = endPos - pos;
  170|  18.1k|    haveLength = gTrue;
  ------------------
  |  |   17|  18.1k|#define gTrue 1
  ------------------
  171|       |
  172|       |  // get length from the stream object
  173|  32.3k|  } else {
  174|  32.3k|    Object obj;
  175|  32.3k|    dict->dictLookup("Length", &obj, recursion);
  176|  32.3k|    if (obj.isInt()) {
  ------------------
  |  Branch (176:9): [True: 22.1k, False: 10.2k]
  ------------------
  177|  22.1k|      length = (GFileOffset)(Guint)obj.getInt();
  178|  22.1k|      haveLength = gTrue;
  ------------------
  |  |   17|  22.1k|#define gTrue 1
  ------------------
  179|  22.1k|    } else {
  180|  10.2k|      error(errSyntaxError, getPos(),
  181|  10.2k|	    "Missing or invalid 'Length' attribute in stream");
  182|  10.2k|    }
  183|  32.3k|    obj.free();
  184|  32.3k|  }
  185|       |
  186|       |  // in badly damaged PDF files, we can run off the end of the input
  187|       |  // stream immediately after the "stream" token
  188|  50.5k|  if (!lexer->getStream()) {
  ------------------
  |  Branch (188:7): [True: 0, False: 50.5k]
  ------------------
  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|  50.5k|  BaseStream *baseStr =
  195|  50.5k|      (BaseStream *)lexer->getStream()->getBaseStream()->copy();
  196|       |
  197|       |  // 'Length' attribute is missing -- search for 'endstream'
  198|  50.5k|  if (!haveLength) {
  ------------------
  |  Branch (198:7): [True: 10.2k, False: 40.2k]
  ------------------
  199|  10.2k|    GBool foundEndstream = gFalse;
  ------------------
  |  |   18|  10.2k|#define gFalse 0
  ------------------
  200|  10.2k|    char endstreamBuf[8];
  201|  10.2k|    if ((curStr = lexer->getStream())) {
  ------------------
  |  Branch (201:9): [True: 10.2k, False: 0]
  ------------------
  202|  10.2k|      int c;
  203|  2.85M|      while ((c = curStr->getChar()) != EOF) {
  ------------------
  |  Branch (203:14): [True: 2.85M, False: 2.38k]
  ------------------
  204|  2.85M|	if (c == 'e' &&
  ------------------
  |  Branch (204:6): [True: 114k, False: 2.73M]
  ------------------
  205|   114k|	    curStr->getBlock(endstreamBuf, 8) == 8 &&
  ------------------
  |  Branch (205:6): [True: 114k, False: 328]
  ------------------
  206|   114k|	    !memcmp(endstreamBuf, "ndstream", 8)) {
  ------------------
  |  Branch (206:6): [True: 7.88k, False: 106k]
  ------------------
  207|  7.88k|	  length = curStr->getPos() - 9 - pos;
  208|  7.88k|	  foundEndstream = gTrue;
  ------------------
  |  |   17|  7.88k|#define gTrue 1
  ------------------
  209|  7.88k|	  break;
  210|  7.88k|	}
  211|  2.85M|      }
  212|  10.2k|    }
  213|  10.2k|    if (!foundEndstream) {
  ------------------
  |  Branch (213:9): [True: 2.38k, False: 7.88k]
  ------------------
  214|  2.38k|      error(errSyntaxError, getPos(), "Couldn't find 'endstream' for stream");
  215|  2.38k|      delete baseStr;
  216|  2.38k|      return NULL;
  217|  2.38k|    }
  218|  10.2k|  }
  219|       |
  220|       |  // make new base stream
  221|  48.1k|  Stream *str = baseStr->makeSubStream(pos, gTrue, length, dict);
  ------------------
  |  |   17|  48.1k|#define gTrue 1
  ------------------
  222|       |
  223|       |  // look for the 'endstream' marker
  224|  48.1k|  if (haveLength) {
  ------------------
  |  Branch (224:7): [True: 40.2k, False: 7.88k]
  ------------------
  225|       |    // skip over stream data
  226|  40.2k|    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|  40.2k|    GBool foundEndstream = gFalse;
  ------------------
  |  |   18|  40.2k|#define gFalse 0
  ------------------
  235|  40.2k|    char endstreamBuf[8];
  236|  40.2k|    if ((curStr = lexer->getStream())) {
  ------------------
  |  Branch (236:9): [True: 40.2k, False: 0]
  ------------------
  237|       |      // skip up to 100 whitespace chars
  238|  40.2k|      int c;
  239|   149k|      for (int i = 0; i < 100; ++i) {
  ------------------
  |  Branch (239:23): [True: 148k, False: 1.00k]
  ------------------
  240|   148k|	c = curStr->getChar();
  241|   148k|	if (!Lexer::isSpace(c)) {
  ------------------
  |  Branch (241:6): [True: 39.2k, False: 108k]
  ------------------
  242|  39.2k|	  break;
  243|  39.2k|	}
  244|   148k|      }
  245|  40.2k|      if (c == 'e') {
  ------------------
  |  Branch (245:11): [True: 19.1k, False: 21.1k]
  ------------------
  246|  19.1k|	if (curStr->getBlock(endstreamBuf, 8) == 8 &&
  ------------------
  |  Branch (246:6): [True: 18.9k, False: 223]
  ------------------
  247|  18.9k|	    !memcmp(endstreamBuf, "ndstream", 8)) {
  ------------------
  |  Branch (247:6): [True: 18.2k, False: 702]
  ------------------
  248|  18.2k|	  foundEndstream = gTrue;
  ------------------
  |  |   17|  18.2k|#define gTrue 1
  ------------------
  249|  18.2k|	}
  250|  19.1k|      }
  251|  40.2k|    }
  252|  40.2k|    if (!foundEndstream) {
  ------------------
  |  Branch (252:9): [True: 22.0k, False: 18.2k]
  ------------------
  253|  22.0k|      error(errSyntaxError, getPos(), "Missing 'endstream'");
  254|       |      // kludge for broken PDF files: just add 5k to the length, and
  255|       |      // hope it's enough
  256|       |      // (dict is now owned by str, so we need to copy it before deleting str)
  257|  22.0k|      Object obj;
  258|  22.0k|      dict->copy(&obj);
  259|  22.0k|      delete str;
  260|  22.0k|      length += 5000;
  261|  22.0k|      str = baseStr->makeSubStream(pos, gTrue, length, &obj);
  ------------------
  |  |   17|  22.0k|#define gTrue 1
  ------------------
  262|  22.0k|    }
  263|  40.2k|  }
  264|       |
  265|       |  // free the copied base stream
  266|  48.1k|  delete baseStr;
  267|       |
  268|       |  // handle decryption
  269|  48.1k|  if (fileKey) {
  ------------------
  |  Branch (269:7): [True: 2.34k, False: 45.7k]
  ------------------
  270|       |    // the 'Crypt' filter is used to mark unencrypted metadata streams
  271|       |    //~ this should also check for an empty DecodeParams entry
  272|  2.34k|    GBool encrypted = gTrue;
  ------------------
  |  |   17|  2.34k|#define gTrue 1
  ------------------
  273|  2.34k|    Object obj;
  274|  2.34k|    dict->dictLookup("Filter", &obj, recursion);
  275|  2.34k|    if (obj.isName("Crypt")) {
  ------------------
  |  Branch (275:9): [True: 17, False: 2.32k]
  ------------------
  276|     17|      encrypted = gFalse;
  ------------------
  |  |   18|     17|#define gFalse 0
  ------------------
  277|  2.32k|    } else if (obj.isArray() && obj.arrayGetLength() >= 1) {
  ------------------
  |  Branch (277:16): [True: 1.05k, False: 1.27k]
  |  Branch (277:33): [True: 840, False: 215]
  ------------------
  278|    840|      Object obj2;
  279|    840|      if (obj.arrayGet(0, &obj2)->isName("Crypt")) {
  ------------------
  |  Branch (279:11): [True: 0, False: 840]
  ------------------
  280|      0|	encrypted = gFalse;
  ------------------
  |  |   18|      0|#define gFalse 0
  ------------------
  281|      0|      }
  282|    840|      obj2.free();
  283|    840|    }
  284|  2.34k|    obj.free();
  285|  2.34k|    if (encrypted) {
  ------------------
  |  Branch (285:9): [True: 2.32k, False: 17]
  ------------------
  286|  2.32k|      str = new DecryptStream(str, fileKey, encAlgorithm, keyLength,
  287|  2.32k|			      objNum, objGen);
  288|  2.32k|    }
  289|  2.34k|  }
  290|       |
  291|       |  // get filters
  292|  48.1k|  str = str->addFilters(dict, recursion);
  293|       |
  294|  48.1k|  return str;
  295|  50.5k|}
_ZN6Parser5shiftEv:
  297|   143M|void Parser::shift() {
  298|   143M|  if (inlineImg > 0) {
  ------------------
  |  Branch (298:7): [True: 521k, False: 142M]
  ------------------
  299|   521k|    if (inlineImg < 2) {
  ------------------
  |  Branch (299:9): [True: 288k, False: 233k]
  ------------------
  300|   288k|      ++inlineImg;
  301|   288k|    } else {
  302|       |      // in a damaged content stream, if 'ID' shows up in the middle
  303|       |      // of a dictionary, we need to reset
  304|   233k|      inlineImg = 0;
  305|   233k|    }
  306|   142M|  } else if (buf2.isCmd("ID")) {
  ------------------
  |  Branch (306:14): [True: 288k, False: 142M]
  ------------------
  307|   288k|    lexer->skipChar();		// skip char after 'ID' command
  308|   288k|    inlineImg = 1;
  309|   288k|  }
  310|   143M|  buf1.free();
  311|   143M|  buf1 = buf2;
  312|   143M|  if (inlineImg > 0)		// don't buffer inline image data
  ------------------
  |  Branch (312:7): [True: 577k, False: 142M]
  ------------------
  313|   577k|    buf2.initNull();
  314|   142M|  else
  315|   142M|    lexer->getObj(&buf2);
  316|   143M|}

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

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

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

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

_ZN10BaseStream13getBaseStreamEv:
  178|  50.5k|  virtual BaseStream *getBaseStream() { return this; }
_ZN10BaseStream7getDictEv:
  180|   481k|  virtual Dict *getDict() { return dict.getDict(); }
_ZN10BaseStream11getFileNameEv:
  181|  8.14k|  virtual GString *getFileName() { return NULL; }
_ZN12FilterStream6getPosEv:
  206|  16.6M|  virtual GFileOffset getPos() { return str->getPos(); }
_ZN12FilterStream7getDictEv:
  210|   261k|  virtual Dict *getDict() { return str->getDict(); }
_ZN15StreamPredictor4isOkEv:
  277|  6.29k|  GBool isOk() { return ok; }
_ZN15StreamPredictor12getPredictorEv:
  285|  3.76k|  int getPredictor() { return predictor; }
_ZN15StreamPredictor8getWidthEv:
  286|  3.76k|  int getWidth() { return width; }
_ZN15StreamPredictor9getNCompsEv:
  287|  3.76k|  int getNComps() { return nComps; }
_ZN15StreamPredictor8getNBitsEv:
  288|  3.76k|  int getNBits() { return nBits; }
_ZN9MemStream7getCharEv:
  366|   495M|    { return (bufPtr < bufEnd) ? (*bufPtr++ & 0xff) : EOF; }
  ------------------
  |  Branch (366:14): [True: 461M, False: 33.7M]
  ------------------
_ZN9MemStream8lookCharEv:
  368|   126M|    { return (bufPtr < bufEnd) ? (*bufPtr & 0xff) : EOF; }
  ------------------
  |  Branch (368:14): [True: 126M, False: 6.86k]
  ------------------
_ZN9MemStream6getPosEv:
  370|  81.1M|  virtual GFileOffset getPos() { return (GFileOffset)(bufPtr - buf); }
_ZN9MemStream8getStartEv:
  372|  16.2k|  virtual GFileOffset getStart() { return start; }
_ZN11EmbedStream5resetEv:
  405|  22.5k|  virtual void reset() {}
_ZN11EmbedStream6getPosEv:
  409|  20.3k|  virtual GFileOffset getPos() { return str->getPos(); }
_ZN14ASCIIHexStream7getCharEv:
  434|  51.0k|    { int c = lookChar(); buf = EOF; return c; }
_ZN13ASCII85Stream7getCharEv:
  459|  2.40M|    { int ch = lookChar(); ++index; return ch; }
_ZN15RunLengthStream7getCharEv:
  538|  3.58M|    { return (bufPtr >= bufEnd && !fillBuf()) ? EOF : (*bufPtr++ & 0xff); }
  ------------------
  |  Branch (538:15): [True: 484k, False: 3.10M]
  |  Branch (538:35): [True: 373k, False: 110k]
  ------------------
_ZN15RunLengthStream8lookCharEv:
  540|   146k|    { return (bufPtr >= bufEnd && !fillBuf()) ? EOF : (*bufPtr & 0xff); }
  ------------------
  |  Branch (540:15): [True: 2.35k, False: 144k]
  |  Branch (540:35): [True: 221, False: 2.13k]
  ------------------
_ZN14CCITTFaxStream7eatBitsEi:
  609|  32.4M|  void eatBits(int n) { if ((inputBits -= n) < 0) inputBits = 0; }
  ------------------
  |  Branch (609:29): [True: 2.31k, False: 32.4M]
  ------------------
_ZN9EOFStream5resetEv:
  873|    821|  virtual void reset() {}
_ZN9EOFStream7getCharEv:
  874|    405|  virtual int getChar() { return EOF; }
_ZN9EOFStream8getBlockEPci:
  876|    100|  virtual int getBlock(char *blk, int size) { return 0; }

_ZN10TextStringC2Ev:
   21|  81.1k|TextString::TextString() {
   22|       |  u = NULL;
   23|  81.1k|  len = size = 0;
   24|  81.1k|}
_ZN10TextStringC2EP7GString:
   26|  10.8k|TextString::TextString(GString *s) {
   27|       |  u = NULL;
   28|  10.8k|  len = size = 0;
   29|  10.8k|  append(s);
   30|  10.8k|}
_ZN10TextStringC2EPS_:
   32|    506|TextString::TextString(TextString *s) {
   33|    506|  len = size = s->len;
   34|    506|  if (len) {
  ------------------
  |  Branch (34:7): [True: 486, False: 20]
  ------------------
   35|    486|    u = (Unicode *)gmallocn(size, sizeof(Unicode));
   36|    486|    memcpy(u, s->u, len * sizeof(Unicode));
   37|    486|  } else {
   38|       |    u = NULL;
   39|     20|  }
   40|    506|}
_ZN10TextStringD2Ev:
   42|  92.4k|TextString::~TextString() {
   43|  92.4k|  gfree(u);
   44|  92.4k|}
_ZN10TextString6appendEP7GString:
   53|  10.8k|TextString *TextString::append(GString *s) {
   54|  10.8k|  return insert(len, s);
   55|  10.8k|}
_ZN10TextString6insertEij:
   57|  16.4k|TextString *TextString::insert(int idx, Unicode c) {
   58|  16.4k|  if (idx >= 0 && idx <= len) {
  ------------------
  |  Branch (58:7): [True: 16.4k, False: 0]
  |  Branch (58:19): [True: 16.4k, False: 0]
  ------------------
   59|  16.4k|    expand(1);
   60|  16.4k|    if (idx < len) {
  ------------------
  |  Branch (60:9): [True: 16.4k, False: 0]
  ------------------
   61|  16.4k|      memmove(u + idx + 1, u + idx, (len - idx) * sizeof(Unicode));
   62|  16.4k|    }
   63|  16.4k|    u[idx] = c;
   64|  16.4k|    ++len;
   65|  16.4k|  }
   66|  16.4k|  return this;
   67|  16.4k|}
_ZN10TextString6insertEiPji:
   69|   263k|TextString *TextString::insert(int idx, Unicode *u2, int n) {
   70|   263k|  if (idx >= 0 && idx <= len) {
  ------------------
  |  Branch (70:7): [True: 263k, False: 0]
  |  Branch (70:19): [True: 263k, False: 0]
  ------------------
   71|   263k|    expand(n);
   72|   263k|    if (idx < len) {
  ------------------
  |  Branch (72:9): [True: 52.6k, False: 211k]
  ------------------
   73|  52.6k|      memmove(u + idx + n, u + idx, (len - idx) * sizeof(Unicode));
   74|  52.6k|    }
   75|   263k|    memcpy(u + idx, u2, n * sizeof(Unicode));
   76|   263k|    len += n;
   77|   263k|  }
   78|   263k|  return this;
   79|   263k|}
_ZN10TextString6insertEiP7GString:
   81|  27.6k|TextString *TextString::insert(int idx, GString *s) {
   82|  27.6k|  Unicode uBuf[100];
   83|  27.6k|  int n, i;
   84|       |
   85|  27.6k|  if (idx >= 0 && idx <= len) {
  ------------------
  |  Branch (85:7): [True: 27.6k, False: 0]
  |  Branch (85:19): [True: 27.6k, False: 0]
  ------------------
   86|       |    // look for a UTF-16BE BOM
   87|  27.6k|    if ((s->getChar(0) & 0xff) == 0xfe &&
  ------------------
  |  Branch (87:9): [True: 8.80k, False: 18.8k]
  ------------------
   88|  8.80k|	(s->getChar(1) & 0xff) == 0xff) {
  ------------------
  |  Branch (88:2): [True: 8.31k, False: 492]
  ------------------
   89|  8.31k|      i = 2;
   90|  8.31k|      n = 0;
   91|  18.6M|      while (getUTF16BE(s, &i, uBuf + n)) {
  ------------------
  |  Branch (91:14): [True: 18.5M, False: 8.31k]
  ------------------
   92|  18.5M|	++n;
   93|  18.5M|	if (n == sizeof(uBuf) / sizeof(Unicode)) {
  ------------------
  |  Branch (93:6): [True: 184k, False: 18.4M]
  ------------------
   94|   184k|	  insert(idx, uBuf, n);
   95|   184k|	  idx += n;
   96|   184k|	  n = 0;
   97|   184k|	}
   98|  18.5M|      }
   99|  8.31k|      if (n > 0) {
  ------------------
  |  Branch (99:11): [True: 7.89k, False: 417]
  ------------------
  100|  7.89k|	insert(idx, uBuf, n);
  101|  7.89k|      }
  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|  19.3k|    } else if ((s->getChar(0) & 0xff) == 0xff &&
  ------------------
  |  Branch (106:16): [True: 6.38k, False: 12.9k]
  ------------------
  107|  6.38k|	       (s->getChar(1) & 0xff) == 0xfe) {
  ------------------
  |  Branch (107:9): [True: 6.14k, False: 242]
  ------------------
  108|  6.14k|      i = 2;
  109|  6.14k|      n = 0;
  110|  4.73M|      while (getUTF16LE(s, &i, uBuf + n)) {
  ------------------
  |  Branch (110:14): [True: 4.73M, False: 6.14k]
  ------------------
  111|  4.73M|	++n;
  112|  4.73M|	if (n == sizeof(uBuf) / sizeof(Unicode)) {
  ------------------
  |  Branch (112:6): [True: 44.8k, False: 4.68M]
  ------------------
  113|  44.8k|	  insert(idx, uBuf, n);
  114|  44.8k|	  idx += n;
  115|  44.8k|	  n = 0;
  116|  44.8k|	}
  117|  4.73M|      }
  118|  6.14k|      if (n > 0) {
  ------------------
  |  Branch (118:11): [True: 4.14k, False: 2.00k]
  ------------------
  119|  4.14k|	insert(idx, uBuf, n);
  120|  4.14k|      }
  121|       |
  122|       |    // look for a UTF-8 BOM
  123|  13.1k|    } else if ((s->getChar(0) & 0xff) == 0xef &&
  ------------------
  |  Branch (123:16): [True: 1.19k, False: 12.0k]
  ------------------
  124|  1.19k|	       (s->getChar(1) & 0xff) == 0xbb &&
  ------------------
  |  Branch (124:9): [True: 994, False: 197]
  ------------------
  125|    994|	       (s->getChar(2) & 0xff) == 0xbf) {
  ------------------
  |  Branch (125:9): [True: 764, False: 230]
  ------------------
  126|    764|      i = 3;
  127|    764|      n = 0;
  128|  2.25M|      while (getUTF8(s, &i, uBuf + n)) {
  ------------------
  |  Branch (128:14): [True: 2.25M, False: 764]
  ------------------
  129|  2.25M|	++n;
  130|  2.25M|	if (n == sizeof(uBuf) / sizeof(Unicode)) {
  ------------------
  |  Branch (130:6): [True: 22.1k, False: 2.23M]
  ------------------
  131|  22.1k|	  insert(idx, uBuf, n);
  132|  22.1k|	  idx += n;
  133|  22.1k|	  n = 0;
  134|  22.1k|	}
  135|  2.25M|      }
  136|    764|      if (n > 0) {
  ------------------
  |  Branch (136:11): [True: 656, False: 108]
  ------------------
  137|    656|	insert(idx, uBuf, n);
  138|    656|      }
  139|       |
  140|       |    // otherwise, use PDFDocEncoding
  141|  12.4k|    } else {
  142|  12.4k|      n = s->getLength();
  143|  12.4k|      expand(n);
  144|  12.4k|      if (idx < len) {
  ------------------
  |  Branch (144:11): [True: 8.81k, False: 3.61k]
  ------------------
  145|  8.81k|	memmove(u + idx + n, u + idx, (len - idx) * sizeof(Unicode));
  146|  8.81k|      }
  147|  24.1M|      for (i = 0; i < n; ++i) {
  ------------------
  |  Branch (147:19): [True: 24.1M, False: 12.4k]
  ------------------
  148|  24.1M|	u[idx + i] = pdfDocEncoding[s->getChar(i) & 0xff];
  149|  24.1M|      }
  150|  12.4k|      len += n;
  151|  12.4k|    }
  152|  27.6k|  }
  153|  27.6k|  return this;
  154|  27.6k|}
_ZN10TextString6expandEi:
  156|   292k|void TextString::expand(int delta) {
  157|   292k|  int newLen;
  158|       |
  159|   292k|  newLen = len + delta;
  160|   292k|  if (delta > INT_MAX - len) {
  ------------------
  |  Branch (160:7): [True: 0, False: 292k]
  ------------------
  161|       |    // trigger an out-of-memory error
  162|      0|    size = -1;
  163|   292k|  } else if (newLen <= size) {
  ------------------
  |  Branch (163:14): [True: 272k, False: 20.1k]
  ------------------
  164|   272k|    return;
  165|   272k|  } else if (size > 0 && size <= INT_MAX / 2 && size*2 >= newLen) {
  ------------------
  |  Branch (165:14): [True: 11.1k, False: 8.97k]
  |  Branch (165:26): [True: 11.1k, False: 0]
  |  Branch (165:49): [True: 10.8k, False: 311]
  ------------------
  166|  10.8k|    size *= 2;
  167|  10.8k|  } else {
  168|  9.28k|    size = newLen;
  169|  9.28k|  }
  170|  20.1k|  u = (Unicode *)greallocn(u, size, sizeof(Unicode));
  171|  20.1k|}
_ZN10TextString6toUTF8Ev:
  201|     55|GString *TextString::toUTF8() {
  202|     55|  GString *s = new GString();
  203|  17.7k|  for (int i = 0; i < len; ++i) {
  ------------------
  |  Branch (203:19): [True: 17.7k, False: 55]
  ------------------
  204|  17.7k|    char buf[8];
  205|  17.7k|    int n = mapUTF8(u[i], buf, sizeof(buf));
  206|  17.7k|    s->append(buf, n);
  207|  17.7k|  }
  208|     55|  return s;
  209|     55|}

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

_Z7mapUTF8jPci:
   12|  17.7k|int mapUTF8(Unicode u, char *buf, int bufSize) {
   13|  17.7k|  if        (u <= 0x0000007f) {
  ------------------
  |  Branch (13:14): [True: 17.0k, False: 737]
  ------------------
   14|  17.0k|    if (bufSize < 1) {
  ------------------
  |  Branch (14:9): [True: 0, False: 17.0k]
  ------------------
   15|      0|      return 0;
   16|      0|    }
   17|  17.0k|    buf[0] = (char)u;
   18|  17.0k|    return 1;
   19|  17.0k|  } else if (u <= 0x000007ff) {
  ------------------
  |  Branch (19:14): [True: 275, False: 462]
  ------------------
   20|    275|    if (bufSize < 2) {
  ------------------
  |  Branch (20:9): [True: 0, False: 275]
  ------------------
   21|      0|      return 0;
   22|      0|    }
   23|    275|    buf[0] = (char)(0xc0 + (u >> 6));
   24|    275|    buf[1] = (char)(0x80 + (u & 0x3f));
   25|    275|    return 2;
   26|    462|  } else if (u <= 0x0000ffff) {
  ------------------
  |  Branch (26:14): [True: 429, False: 33]
  ------------------
   27|    429|    if (bufSize < 3) {
  ------------------
  |  Branch (27:9): [True: 0, False: 429]
  ------------------
   28|      0|      return 0;
   29|      0|    }
   30|    429|    buf[0] = (char)(0xe0 + (u >> 12));
   31|    429|    buf[1] = (char)(0x80 + ((u >> 6) & 0x3f));
   32|    429|    buf[2] = (char)(0x80 + (u & 0x3f));
   33|    429|    return 3;
   34|    429|  } else if (u <= 0x0010ffff) {
  ------------------
  |  Branch (34:14): [True: 0, False: 33]
  ------------------
   35|      0|    if (bufSize < 4) {
  ------------------
  |  Branch (35:9): [True: 0, False: 0]
  ------------------
   36|      0|      return 0;
   37|      0|    }
   38|      0|    buf[0] = (char)(0xf0 + (u >> 18));
   39|      0|    buf[1] = (char)(0x80 + ((u >> 12) & 0x3f));
   40|      0|    buf[2] = (char)(0x80 + ((u >> 6) & 0x3f));
   41|      0|    buf[3] = (char)(0x80 + (u & 0x3f));
   42|      0|    return 4;
   43|     33|  } else {
   44|     33|    return 0;
   45|     33|  }
   46|  17.7k|}
_Z7getUTF8P7GStringPiPj:
   61|  2.25M|GBool getUTF8(GString *s, int *i, Unicode *u) {
   62|  2.25M|  Guchar c0, c1, c2, c3, c4, c5;
   63|       |
   64|  2.25M|  if (*i >= s->getLength()) {
  ------------------
  |  Branch (64:7): [True: 764, False: 2.25M]
  ------------------
   65|    764|    return gFalse;
  ------------------
  |  |   18|    764|#define gFalse 0
  ------------------
   66|    764|  }
   67|  2.25M|  c0 = (Guchar)s->getChar((*i)++);
   68|  2.25M|  if (c0 < 0x80) {
  ------------------
  |  Branch (68:7): [True: 1.83M, False: 415k]
  ------------------
   69|  1.83M|    *u = (Unicode)c0;
   70|  1.83M|  } else if (c0 < 0xe0) {
  ------------------
  |  Branch (70:14): [True: 265k, False: 150k]
  ------------------
   71|   265k|    if (*i < s->getLength() &&
  ------------------
  |  Branch (71:9): [True: 265k, False: 374]
  ------------------
   72|   265k|	((c1 = (Guchar)s->getChar(*i)) & 0xc0) == 0x80) {
  ------------------
  |  Branch (72:2): [True: 96.7k, False: 168k]
  ------------------
   73|  96.7k|      *i += 1;
   74|  96.7k|      *u = (Unicode)(((c0 & 0x1f) << 6) |
   75|  96.7k|		     (c1 & 0x3f));
   76|   168k|    } else {
   77|   168k|      *u =  (Unicode)c0;
   78|   168k|    }
   79|   265k|  } else if (c0 < 0xf0) {
  ------------------
  |  Branch (79:14): [True: 50.6k, False: 99.4k]
  ------------------
   80|  50.6k|    if (*i < s->getLength() - 1 &&
  ------------------
  |  Branch (80:9): [True: 50.3k, False: 275]
  ------------------
   81|  50.3k|	((c1 = (Guchar)s->getChar(*i)) & 0xc0) == 0x80 &&
  ------------------
  |  Branch (81:2): [True: 7.38k, False: 42.9k]
  ------------------
   82|  7.38k|	((c2 = (Guchar)s->getChar(*i + 1)) & 0xc0) == 0x80) {
  ------------------
  |  Branch (82:2): [True: 1.63k, False: 5.75k]
  ------------------
   83|  1.63k|      *i += 2;
   84|  1.63k|      *u = (Unicode)(((c0 & 0x0f) << 12) |
   85|  1.63k|		     ((c1 & 0x3f) << 6) |
   86|  1.63k|		     (c2 & 0x3f));
   87|  48.9k|    } else {
   88|  48.9k|      *u = (Unicode)c0;
   89|  48.9k|    }
   90|  99.4k|  } else if (c0 < 0xf8) {
  ------------------
  |  Branch (90:14): [True: 11.7k, False: 87.7k]
  ------------------
   91|  11.7k|    if (*i < s->getLength() - 2 &&
  ------------------
  |  Branch (91:9): [True: 11.6k, False: 16]
  ------------------
   92|  11.6k|	((c1 = (Guchar)s->getChar(*i)) & 0xc0) == 0x80 &&
  ------------------
  |  Branch (92:2): [True: 4.10k, False: 7.58k]
  ------------------
   93|  4.10k|	((c2 = (Guchar)s->getChar(*i + 1)) & 0xc0) == 0x80 &&
  ------------------
  |  Branch (93:2): [True: 1.69k, False: 2.40k]
  ------------------
   94|  1.69k|	((c3 = (Guchar)s->getChar(*i + 2)) & 0xc0) == 0x80) {
  ------------------
  |  Branch (94:2): [True: 1.05k, False: 646]
  ------------------
   95|  1.05k|      *i += 3;
   96|  1.05k|      *u = (Unicode)(((c0 & 0x07) << 18) |
   97|  1.05k|		     ((c1 & 0x3f) << 12) |
   98|  1.05k|		     ((c2 & 0x3f) << 6) |
   99|  1.05k|		     (c3 & 0x3f));
  100|  10.6k|    } else {
  101|  10.6k|      *u = (Unicode)c0;
  102|  10.6k|    }
  103|  87.7k|  } else if (c0 < 0xfc) {
  ------------------
  |  Branch (103:14): [True: 3.74k, False: 84.0k]
  ------------------
  104|  3.74k|    if (*i < s->getLength() - 3 &&
  ------------------
  |  Branch (104:9): [True: 3.48k, False: 251]
  ------------------
  105|  3.48k|	((c1 = (Guchar)s->getChar(*i)) & 0xc0) == 0x80 &&
  ------------------
  |  Branch (105:2): [True: 1.29k, False: 2.19k]
  ------------------
  106|  1.29k|	((c2 = (Guchar)s->getChar(*i + 1)) & 0xc0) == 0x80 &&
  ------------------
  |  Branch (106:2): [True: 1.15k, False: 141]
  ------------------
  107|  1.15k|	((c3 = (Guchar)s->getChar(*i + 2)) & 0xc0) == 0x80 &&
  ------------------
  |  Branch (107:2): [True: 846, False: 308]
  ------------------
  108|    846|	((c4 = (Guchar)s->getChar(*i + 3)) & 0xc0) == 0x80) {
  ------------------
  |  Branch (108:2): [True: 428, False: 418]
  ------------------
  109|    428|      *i += 4;
  110|    428|      *u = (Unicode)(((c0 & 0x03) << 24) |
  111|    428|		     ((c1 & 0x3f) << 18) |
  112|    428|		     ((c2 & 0x3f) << 12) |
  113|    428|		     ((c3 & 0x3f) << 6) |
  114|    428|		     (c4 & 0x3f));
  115|  3.31k|    } else {
  116|  3.31k|      *u = (Unicode)c0;
  117|  3.31k|    }
  118|  84.0k|  } else if (c0 < 0xfe) {
  ------------------
  |  Branch (118:14): [True: 12.2k, False: 71.7k]
  ------------------
  119|  12.2k|    if (*i < s->getLength() - 4 &&
  ------------------
  |  Branch (119:9): [True: 11.8k, False: 401]
  ------------------
  120|  11.8k|	((c1 = (Guchar)s->getChar(*i)) & 0xc0) == 0x80 &&
  ------------------
  |  Branch (120:2): [True: 743, False: 11.1k]
  ------------------
  121|    743|	((c2 = (Guchar)s->getChar(*i + 1)) & 0xc0) == 0x80 &&
  ------------------
  |  Branch (121:2): [True: 485, False: 258]
  ------------------
  122|    485|	((c3 = (Guchar)s->getChar(*i + 2)) & 0xc0) == 0x80 &&
  ------------------
  |  Branch (122:2): [True: 426, False: 59]
  ------------------
  123|    426|	((c4 = (Guchar)s->getChar(*i + 3)) & 0xc0) == 0x80 &&
  ------------------
  |  Branch (123:2): [True: 256, False: 170]
  ------------------
  124|    256|	((c5 = (Guchar)s->getChar(*i + 4)) & 0xc0) == 0x80) {
  ------------------
  |  Branch (124:2): [True: 71, False: 185]
  ------------------
  125|     71|      *i += 5;
  126|     71|      *u = (Unicode)(((c0 & 0x01) << 30) |
  127|     71|		     ((c1 & 0x3f) << 24) |
  128|     71|		     ((c2 & 0x3f) << 18) |
  129|     71|		     ((c3 & 0x3f) << 12) |
  130|     71|		     ((c4 & 0x3f) << 6) |
  131|     71|		     (c5 & 0x3f));
  132|  12.1k|    } else {
  133|  12.1k|      *u = (Unicode)c0;
  134|  12.1k|    }
  135|  71.7k|  } else {
  136|  71.7k|    *u = (Unicode)c0;
  137|  71.7k|  }
  138|  2.25M|  return gTrue;
  ------------------
  |  |   17|  2.25M|#define gTrue 1
  ------------------
  139|  2.25M|}
_Z10getUTF16BEP7GStringPiPj:
  141|  18.6M|GBool getUTF16BE(GString *s, int *i, Unicode *u) {
  142|  18.6M|  int w0, w1;
  143|       |
  144|  18.6M|  if (*i >= s->getLength() - 1) {
  ------------------
  |  Branch (144:7): [True: 8.31k, False: 18.5M]
  ------------------
  145|  8.31k|    return gFalse;
  ------------------
  |  |   18|  8.31k|#define gFalse 0
  ------------------
  146|  8.31k|  }
  147|  18.5M|  w0 = ((s->getChar(*i) & 0xff) << 8) | (s->getChar(*i + 1) & 0xff);
  148|  18.5M|  *i += 2;
  149|  18.5M|  if (w0 < 0xd800 || w0 >= 0xe000) {
  ------------------
  |  Branch (149:7): [True: 18.4M, False: 109k]
  |  Branch (149:22): [True: 78.7k, False: 30.2k]
  ------------------
  150|  18.5M|    *u = (Unicode)w0;
  151|  18.5M|  } else {
  152|  30.2k|    if (*i < s->getLength() - 1) {
  ------------------
  |  Branch (152:9): [True: 29.9k, False: 361]
  ------------------
  153|  29.9k|      w1 = ((s->getChar(*i) & 0xff) << 8) | (s->getChar(*i + 1) & 0xff);
  154|  29.9k|      *i += 2;
  155|  29.9k|      *u = 0x10000 + ((w0 - 0xd800) << 10) + (w1 - 0xdc00);
  156|  29.9k|    } else {
  157|    361|      *u = (Unicode)w0;
  158|    361|    }
  159|  30.2k|  }
  160|  18.5M|  return gTrue;
  ------------------
  |  |   17|  18.5M|#define gTrue 1
  ------------------
  161|  18.6M|}
_Z10getUTF16LEP7GStringPiPj:
  163|  4.73M|GBool getUTF16LE(GString *s, int *i, Unicode *u) {
  164|  4.73M|  int w0, w1;
  165|       |
  166|  4.73M|  if (*i >= s->getLength() - 1) {
  ------------------
  |  Branch (166:7): [True: 6.14k, False: 4.73M]
  ------------------
  167|  6.14k|    return gFalse;
  ------------------
  |  |   18|  6.14k|#define gFalse 0
  ------------------
  168|  6.14k|  }
  169|  4.73M|  w0 = (s->getChar(*i) & 0xff) | ((s->getChar(*i + 1) & 0xff) << 8);
  170|  4.73M|  *i += 2;
  171|  4.73M|  if (w0 < 0xd800 || w0 >= 0xe000) {
  ------------------
  |  Branch (171:7): [True: 4.58M, False: 149k]
  |  Branch (171:22): [True: 118k, False: 30.3k]
  ------------------
  172|  4.70M|    *u = (Unicode)w0;
  173|  4.70M|  } else {
  174|  30.3k|    if (*i < s->getLength() - 1) {
  ------------------
  |  Branch (174:9): [True: 28.6k, False: 1.70k]
  ------------------
  175|  28.6k|      w1 = (s->getChar(*i) & 0xff) | ((s->getChar(*i + 1) & 0xff) << 8);
  176|  28.6k|      *i += 2;
  177|  28.6k|      *u = 0x10000 + ((w0 - 0xd800) << 10) + (w1 - 0xdc00);
  178|  28.6k|    } else {
  179|  1.70k|      *u = (Unicode)w0;
  180|  1.70k|    }
  181|  30.3k|  }
  182|  4.73M|  return gTrue;
  ------------------
  |  |   17|  4.73M|#define gTrue 1
  ------------------
  183|  4.73M|}

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

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

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

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

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

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

_ZN6ZxNodeC2Ev:
   64|  1.65M|ZxNode::ZxNode() {
   65|  1.65M|  next = NULL;
   66|  1.65M|  parent = NULL;
   67|       |  firstChild = lastChild = NULL;
   68|  1.65M|}
_ZN6ZxNodeD2Ev:
   70|  1.65M|ZxNode::~ZxNode() {
   71|  1.65M|  ZxNode *child;
   72|       |
   73|  3.31M|  while (firstChild) {
  ------------------
  |  Branch (73:10): [True: 1.65M, False: 1.65M]
  ------------------
   74|  1.65M|    child = firstChild;
   75|  1.65M|    firstChild = firstChild->next;
   76|  1.65M|    delete child;
   77|  1.65M|  }
   78|  1.65M|}
_ZN6ZxNode21findFirstChildElementEPKc:
  143|   231k|ZxElement *ZxNode::findFirstChildElement(const char *type) {
  144|   231k|  ZxNode *child;
  145|       |
  146|   779k|  for (child = firstChild; child; child = child->next) {
  ------------------
  |  Branch (146:28): [True: 554k, False: 225k]
  ------------------
  147|   554k|    if (child->isElement(type)) {
  ------------------
  |  Branch (147:9): [True: 6.18k, False: 548k]
  ------------------
  148|  6.18k|      return (ZxElement *)child;
  149|  6.18k|    }
  150|   554k|  }
  151|   225k|  return NULL;
  152|   231k|}
_ZN6ZxNode8addChildEPS_:
  186|  1.65M|void ZxNode::addChild(ZxNode *child) {
  187|  1.65M|  if (lastChild) {
  ------------------
  |  Branch (187:7): [True: 1.39M, False: 264k]
  ------------------
  188|  1.39M|    lastChild->next = child;
  189|  1.39M|    lastChild = child;
  190|  1.39M|  } else {
  191|   264k|    firstChild = lastChild = child;
  192|   264k|  }
  193|  1.65M|  child->parent = this;
  194|       |  child->next = NULL;
  195|  1.65M|}
_ZN5ZxDocC2Ev:
  199|    626|ZxDoc::ZxDoc() {
  200|    626|  xmlDecl = NULL;
  201|    626|  docTypeDecl = NULL;
  202|       |  root = NULL;
  203|    626|}
_ZN5ZxDoc7loadMemEPKcj:
  205|    626|ZxDoc *ZxDoc::loadMem(const char *data, Guint dataLen) {
  206|    626|  ZxDoc *doc;
  207|       |
  208|    626|  doc = new ZxDoc();
  209|    626|  if (!doc->parse(data, dataLen)) {
  ------------------
  |  Branch (209:7): [True: 214, False: 412]
  ------------------
  210|    214|    delete doc;
  211|    214|    return NULL;
  212|    214|  }
  213|    412|  return doc;
  214|    626|}
_ZN5ZxDoc8addChildEP6ZxNode:
  262|  1.08k|void ZxDoc::addChild(ZxNode *node) {
  263|  1.08k|  if (node->isXMLDecl() && !xmlDecl) {
  ------------------
  |  Branch (263:7): [True: 251, False: 829]
  |  Branch (263:28): [True: 251, False: 0]
  ------------------
  264|    251|    xmlDecl = (ZxXMLDecl *)node;
  265|    829|  } else if (node->isDocTypeDecl() && !docTypeDecl) {
  ------------------
  |  Branch (265:14): [True: 35, False: 794]
  |  Branch (265:39): [True: 35, False: 0]
  ------------------
  266|     35|    docTypeDecl = (ZxDocTypeDecl *)node;
  267|    794|  } else if (node->isElement() && !root) {
  ------------------
  |  Branch (267:14): [True: 412, False: 382]
  |  Branch (267:35): [True: 412, False: 0]
  ------------------
  268|    412|    root = (ZxElement *)node;
  269|    412|  }
  270|  1.08k|  ZxNode::addChild(node);
  271|  1.08k|}
_ZN5ZxDoc5parseEPKcj:
  273|    626|bool ZxDoc::parse(const char *data, Guint dataLen) {
  274|    626|  parsePtr = data;
  275|    626|  parseEnd = data + dataLen;
  276|       |  
  277|    626|  parseSpace();
  278|    626|  parseBOM();
  279|    626|  parseSpace();
  280|    626|  parseXMLDecl(this);
  281|    626|  parseMisc(this);
  282|    626|  parseDocTypeDecl(this);
  283|    626|  parseMisc(this);
  284|    626|  if (match("<")) {
  ------------------
  |  Branch (284:7): [True: 412, False: 214]
  ------------------
  285|    412|    parseElement(this);
  286|    412|  }
  287|    626|  parseMisc(this);
  288|       |  return root != NULL;
  289|    626|}
_ZN5ZxDoc12parseXMLDeclEP6ZxNode:
  291|    626|void ZxDoc::parseXMLDecl(ZxNode *par) {
  292|    626|  GString *version, *encoding, *s;
  293|    626|  bool standalone;
  294|       |
  295|    626|  if (!match("<?xml")) {
  ------------------
  |  Branch (295:7): [True: 375, False: 251]
  ------------------
  296|    375|    return;
  297|    375|  }
  298|    251|  parsePtr += 5;
  299|    251|  parseSpace();
  300|       |
  301|       |  // version
  302|    251|  version = NULL;
  303|    251|  if (match("version")) {
  ------------------
  |  Branch (303:7): [True: 240, False: 11]
  ------------------
  304|    240|    parsePtr += 7;
  305|    240|    parseSpace();
  306|    240|    if (match("=")) {
  ------------------
  |  Branch (306:9): [True: 225, False: 15]
  ------------------
  307|    225|      ++parsePtr;
  308|    225|      parseSpace();
  309|    225|      version = parseQuotedString();
  310|    225|    }
  311|    240|  }
  312|    251|  if (!version) {
  ------------------
  |  Branch (312:7): [True: 26, False: 225]
  ------------------
  313|     26|    version = new GString("1.0");
  314|     26|  }
  315|    251|  parseSpace();
  316|       |	
  317|       |  // encoding
  318|    251|  encoding = NULL;
  319|    251|  if (match("encoding")) {
  ------------------
  |  Branch (319:7): [True: 162, False: 89]
  ------------------
  320|    162|    parsePtr += 8;
  321|    162|    parseSpace();
  322|    162|    if (match("=")) {
  ------------------
  |  Branch (322:9): [True: 150, False: 12]
  ------------------
  323|    150|      ++parsePtr;
  324|    150|      parseSpace();
  325|    150|      encoding = parseQuotedString();
  326|    150|    }
  327|    162|  }
  328|    251|  parseSpace();
  329|       |
  330|       |  // standalone
  331|    251|  standalone = false;
  332|    251|  if (match("standalone")) {
  ------------------
  |  Branch (332:7): [True: 35, False: 216]
  ------------------
  333|     35|    parsePtr += 10;
  334|     35|    parseSpace();
  335|     35|    if (match("=")) {
  ------------------
  |  Branch (335:9): [True: 25, False: 10]
  ------------------
  336|     25|      ++parsePtr;
  337|     25|      parseSpace();
  338|     25|      s = parseQuotedString();
  339|     25|      standalone = !s->cmp("yes");
  340|     25|      delete s;
  341|     25|    }
  342|     35|  }
  343|    251|  parseSpace();
  344|       |
  345|    251|  if (match("?>")) {
  ------------------
  |  Branch (345:7): [True: 123, False: 128]
  ------------------
  346|    123|    parsePtr += 2;
  347|    123|  }
  348|       |
  349|    251|  par->addChild(new ZxXMLDecl(version, encoding, standalone));
  350|    251|}
_ZN5ZxDoc16parseDocTypeDeclEP6ZxNode:
  353|    626|void ZxDoc::parseDocTypeDecl(ZxNode *par) {
  354|    626|  GString *name;
  355|    626|  int state;
  356|    626|  char c, quote;
  357|       |
  358|    626|  if (!match("<!DOCTYPE")) {
  ------------------
  |  Branch (358:7): [True: 591, False: 35]
  ------------------
  359|    591|    return;
  360|    591|  }
  361|     35|  parsePtr += 9;
  362|     35|  parseSpace();
  363|       |
  364|     35|  name = parseName();
  365|     35|  parseSpace();
  366|       |
  367|     35|  state = 0;
  368|     35|  quote = '\0';
  369|   157k|  while (parsePtr < parseEnd && state < 4) {
  ------------------
  |  Branch (369:10): [True: 157k, False: 14]
  |  Branch (369:33): [True: 157k, False: 21]
  ------------------
  370|   157k|    c = *parsePtr++;
  371|   157k|    switch (state) {
  ------------------
  |  Branch (371:13): [True: 157k, False: 0]
  ------------------
  372|  3.23k|    case 0: // not in square brackets; not in quotes
  ------------------
  |  Branch (372:5): [True: 3.23k, False: 154k]
  ------------------
  373|  3.23k|      if (c == '>') {
  ------------------
  |  Branch (373:11): [True: 21, False: 3.21k]
  ------------------
  374|     21|	state = 4;
  375|  3.21k|      } else if (c == '"' || c == '\'') {
  ------------------
  |  Branch (375:18): [True: 14, False: 3.20k]
  |  Branch (375:30): [True: 24, False: 3.18k]
  ------------------
  376|     38|	state = 1;
  377|  3.18k|      } else if (c == '[') {
  ------------------
  |  Branch (377:18): [True: 225, False: 2.95k]
  ------------------
  378|    225|	state = 2;
  379|    225|      }
  380|  3.23k|      break;
  381|  2.23k|    case 1: // not in square brackets; in quotes
  ------------------
  |  Branch (381:5): [True: 2.23k, False: 155k]
  ------------------
  382|  2.23k|      if (c == quote) {
  ------------------
  |  Branch (382:11): [True: 36, False: 2.19k]
  ------------------
  383|     36|	state = 0;
  384|     36|      }
  385|  2.23k|      break;
  386|   130k|    case 2: // in square brackets; not in quotes
  ------------------
  |  Branch (386:5): [True: 130k, False: 27.5k]
  ------------------
  387|   130k|      if (c == ']') {
  ------------------
  |  Branch (387:11): [True: 214, False: 129k]
  ------------------
  388|    214|	state = 0;
  389|   129k|      } else if (c == '"' || c == '\'') {
  ------------------
  |  Branch (389:18): [True: 260, False: 129k]
  |  Branch (389:30): [True: 256, False: 129k]
  ------------------
  390|    516|	state = 3;
  391|    516|      }
  392|   130k|      break;
  393|  22.1k|    case 3: // in square brackets; in quotes
  ------------------
  |  Branch (393:5): [True: 22.1k, False: 135k]
  ------------------
  394|  22.1k|      if (c == quote) {
  ------------------
  |  Branch (394:11): [True: 513, False: 21.6k]
  ------------------
  395|    513|	state = 2;
  396|    513|      }
  397|  22.1k|      break;
  398|   157k|    }
  399|   157k|  }
  400|       |
  401|     35|  par->addChild(new ZxDocTypeDecl(name));
  402|     35|}
_ZN5ZxDoc12parseElementEP6ZxNode:
  405|   967k|void ZxDoc::parseElement(ZxNode *par) {
  406|   967k|  GString *type;
  407|   967k|  ZxElement *elem;
  408|   967k|  ZxAttr *attr;
  409|       |
  410|   967k|  ++parsePtr;
  411|   967k|  type = parseName();
  412|   967k|  elem = new ZxElement(type);
  413|   967k|  parseSpace();
  414|  1.04M|  while ((attr = parseAttr())) {
  ------------------
  |  Branch (414:10): [True: 74.1k, False: 967k]
  ------------------
  415|  74.1k|    elem->addAttr(attr);
  416|  74.1k|    parseSpace();
  417|  74.1k|  }
  418|   967k|  if (match("/>")) {
  ------------------
  |  Branch (418:7): [True: 13.9k, False: 953k]
  ------------------
  419|  13.9k|    parsePtr += 2;
  420|   953k|  } else if (match(">")) {
  ------------------
  |  Branch (420:14): [True: 263k, False: 689k]
  ------------------
  421|   263k|    ++parsePtr;
  422|   263k|    parseContent(elem);
  423|   263k|  }
  424|   967k|  par->addChild(elem);
  425|   967k|}
_ZN5ZxDoc9parseAttrEv:
  427|  1.04M|ZxAttr *ZxDoc::parseAttr() {
  428|  1.04M|  GString *name, *value;
  429|  1.04M|  const char *start;
  430|  1.04M|  char quote, c;
  431|  1.04M|  unsigned int x;
  432|  1.04M|  int n;
  433|       |
  434|  1.04M|  name = parseName();
  435|  1.04M|  parseSpace();
  436|  1.04M|  if (!match("=")) {
  ------------------
  |  Branch (436:7): [True: 955k, False: 85.6k]
  ------------------
  437|   955k|    delete name;
  438|   955k|    return NULL;
  439|   955k|  }
  440|  85.6k|  ++parsePtr;
  441|  85.6k|  parseSpace();
  442|  85.6k|  if (!(parsePtr < parseEnd && (*parsePtr == '"' || *parsePtr == '\''))) {
  ------------------
  |  Branch (442:9): [True: 85.6k, False: 2]
  |  Branch (442:33): [True: 73.9k, False: 11.7k]
  |  Branch (442:53): [True: 200, False: 11.5k]
  ------------------
  443|  11.5k|    delete name;
  444|  11.5k|    return NULL;
  445|  11.5k|  }
  446|  74.1k|  quote = *parsePtr++;
  447|  74.1k|  value = new GString();
  448|   307k|  while (parsePtr < parseEnd && *parsePtr != quote) {
  ------------------
  |  Branch (448:10): [True: 307k, False: 59]
  |  Branch (448:33): [True: 233k, False: 74.0k]
  ------------------
  449|   233k|    if (*parsePtr == '&') {
  ------------------
  |  Branch (449:9): [True: 147k, False: 85.6k]
  ------------------
  450|   147k|      ++parsePtr;
  451|   147k|      if (parsePtr < parseEnd && *parsePtr == '#') {
  ------------------
  |  Branch (451:11): [True: 147k, False: 2]
  |  Branch (451:34): [True: 11.7k, False: 135k]
  ------------------
  452|  11.7k|	++parsePtr;
  453|  11.7k|	if (parsePtr < parseEnd && *parsePtr == 'x') {
  ------------------
  |  Branch (453:6): [True: 11.7k, False: 0]
  |  Branch (453:29): [True: 5.23k, False: 6.52k]
  ------------------
  454|  5.23k|	  ++parsePtr;
  455|  5.23k|	  x = 0;
  456|  12.5k|	  while (parsePtr < parseEnd) {
  ------------------
  |  Branch (456:11): [True: 12.5k, False: 1]
  ------------------
  457|  12.5k|	    c = *parsePtr;
  458|  12.5k|	    if (c >= '0' && c <= '9') {
  ------------------
  |  Branch (458:10): [True: 10.9k, False: 1.56k]
  |  Branch (458:22): [True: 1.01k, False: 9.96k]
  ------------------
  459|  1.01k|	      x = (x << 4) + (c - '0');
  460|  11.5k|	    } else if (c >= 'a' && c <= 'f') {
  ------------------
  |  Branch (460:17): [True: 3.92k, False: 7.59k]
  |  Branch (460:29): [True: 1.87k, False: 2.05k]
  ------------------
  461|  1.87k|	      x = (x << 4) + (10 + c - 'a');
  462|  9.65k|	    } else if (c >= 'A' && c <= 'F') {
  ------------------
  |  Branch (462:17): [True: 6.86k, False: 2.79k]
  |  Branch (462:29): [True: 4.41k, False: 2.44k]
  ------------------
  463|  4.41k|	      x = (x << 4) + (10 + c - 'A');
  464|  5.23k|	    } else {
  465|  5.23k|	      break;
  466|  5.23k|	    }
  467|  7.29k|	    ++parsePtr;
  468|  7.29k|	  }
  469|  5.23k|	  if (parsePtr < parseEnd && *parsePtr == ';') {
  ------------------
  |  Branch (469:8): [True: 5.23k, False: 1]
  |  Branch (469:31): [True: 249, False: 4.98k]
  ------------------
  470|    249|	    ++parsePtr;
  471|    249|	  }
  472|  5.23k|	  appendUTF8(value, x);
  473|  6.52k|	} else {
  474|  6.52k|	  x = 0;
  475|  7.20k|	  while (parsePtr < parseEnd) {
  ------------------
  |  Branch (475:11): [True: 7.20k, False: 1]
  ------------------
  476|  7.20k|	    c = *parsePtr;
  477|  7.20k|	    if (c >= '0' && c <= '9') {
  ------------------
  |  Branch (477:10): [True: 4.26k, False: 2.93k]
  |  Branch (477:22): [True: 675, False: 3.59k]
  ------------------
  478|    675|	      x = x * 10 + (c - '0');
  479|  6.52k|	    } else {
  480|  6.52k|	      break;
  481|  6.52k|	    }
  482|    675|	    ++parsePtr;
  483|    675|	  }
  484|  6.52k|	  if (parsePtr < parseEnd && *parsePtr == ';') {
  ------------------
  |  Branch (484:8): [True: 6.52k, False: 1]
  |  Branch (484:31): [True: 295, False: 6.23k]
  ------------------
  485|    295|	    ++parsePtr;
  486|    295|	  }
  487|  6.52k|	  appendUTF8(value, x);
  488|  6.52k|	}
  489|   135k|      } else {
  490|   135k|	start = parsePtr;
  491|   135k|	for (++parsePtr;
  492|  5.29M|	     parsePtr < parseEnd && *parsePtr != ';' &&
  ------------------
  |  Branch (492:7): [True: 5.29M, False: 12]
  |  Branch (492:30): [True: 5.29M, False: 66]
  ------------------
  493|  5.29M|	       *parsePtr != quote && *parsePtr != '&';
  ------------------
  |  Branch (493:9): [True: 5.28M, False: 6.04k]
  |  Branch (493:31): [True: 5.15M, False: 129k]
  ------------------
  494|  5.15M|	     ++parsePtr) ;
  495|   135k|	n = (int)(parsePtr - start);
  496|   135k|	if (parsePtr < parseEnd && *parsePtr == ';') {
  ------------------
  |  Branch (496:6): [True: 135k, False: 12]
  |  Branch (496:29): [True: 66, False: 135k]
  ------------------
  497|     66|	  ++parsePtr;
  498|     66|	}
  499|   135k|	if (n == 2 && !strncmp(start, "lt", 2)) {
  ------------------
  |  Branch (499:6): [True: 2.16k, False: 133k]
  |  Branch (499:16): [True: 219, False: 1.94k]
  ------------------
  500|    219|	  value->append('<');
  501|   135k|	} else if (n == 2 && !strncmp(start, "gt", 2)) {
  ------------------
  |  Branch (501:13): [True: 1.94k, False: 133k]
  |  Branch (501:23): [True: 270, False: 1.67k]
  ------------------
  502|    270|	  value->append('>');
  503|   135k|	} else if (n == 3 && !strncmp(start, "amp", 3)) {
  ------------------
  |  Branch (503:13): [True: 1.41k, False: 133k]
  |  Branch (503:23): [True: 172, False: 1.24k]
  ------------------
  504|    172|	  value->append('&');
  505|   134k|	} else if (n == 4 && !strncmp(start, "apos", 4)) {
  ------------------
  |  Branch (505:13): [True: 3.05k, False: 131k]
  |  Branch (505:23): [True: 0, False: 3.05k]
  ------------------
  506|      0|	  value->append('\'');
  507|   134k|	} else if (n == 4 && !strncmp(start, "quot", 4)) {
  ------------------
  |  Branch (507:13): [True: 3.05k, False: 131k]
  |  Branch (507:23): [True: 0, False: 3.05k]
  ------------------
  508|      0|	  value->append('"');
  509|   134k|	} else {
  510|   134k|	  value->append(start - 1, (int)(parsePtr - start) + 1);
  511|   134k|	}
  512|   135k|      }
  513|   147k|    } else {
  514|  85.6k|      start = parsePtr;
  515|  85.6k|      for (++parsePtr;
  516|  6.35M|	   parsePtr < parseEnd && *parsePtr != quote && *parsePtr != '&';
  ------------------
  |  Branch (516:5): [True: 6.35M, False: 44]
  |  Branch (516:28): [True: 6.29M, False: 67.7k]
  |  Branch (516:50): [True: 6.27M, False: 17.8k]
  ------------------
  517|  6.27M|	   ++parsePtr) ;
  518|  85.6k|      value->append(start, (int)(parsePtr - start));
  519|  85.6k|    }
  520|   233k|  }
  521|  74.1k|  if (parsePtr < parseEnd && *parsePtr == quote) {
  ------------------
  |  Branch (521:7): [True: 74.0k, False: 59]
  |  Branch (521:30): [True: 74.0k, False: 0]
  ------------------
  522|  74.0k|    ++parsePtr;
  523|  74.0k|  }
  524|  74.1k|  return new ZxAttr(name, value);
  525|  85.6k|}
_ZN5ZxDoc12parseContentEP9ZxElement:
  528|   263k|void ZxDoc::parseContent(ZxElement *par) {
  529|   263k|  GString *endType;
  530|       |
  531|   263k|  endType = (new GString("</"))->append(par->getType());
  532|       |
  533|  1.92M|  while (parsePtr < parseEnd) {
  ------------------
  |  Branch (533:10): [True: 1.68M, False: 237k]
  ------------------
  534|  1.68M|    if (match(endType->getCString())) {
  ------------------
  |  Branch (534:9): [True: 26.2k, False: 1.65M]
  ------------------
  535|  26.2k|      parsePtr += endType->getLength();
  536|  26.2k|      parseSpace();
  537|  26.2k|      if (match(">")) {
  ------------------
  |  Branch (537:11): [True: 17.3k, False: 8.89k]
  ------------------
  538|  17.3k|	++parsePtr;
  539|  17.3k|      }
  540|  26.2k|      break;
  541|  1.65M|    } else if (match("<?")) {
  ------------------
  |  Branch (541:16): [True: 6.06k, False: 1.65M]
  ------------------
  542|  6.06k|      parsePI(par);
  543|  1.65M|    } else if (match("<![CDATA[")) {
  ------------------
  |  Branch (543:16): [True: 20, False: 1.65M]
  ------------------
  544|     20|      parseCDSect(par);
  545|  1.65M|    } else if (match("<!--")) {
  ------------------
  |  Branch (545:16): [True: 293, False: 1.65M]
  ------------------
  546|    293|      parseComment(par);
  547|  1.65M|    } else if (match("<")) {
  ------------------
  |  Branch (547:16): [True: 966k, False: 683k]
  ------------------
  548|   966k|      parseElement(par);
  549|   966k|    } else {
  550|   683k|      parseCharData(par);
  551|   683k|    }
  552|  1.68M|  }
  553|       |
  554|   263k|  delete endType;
  555|   263k|}
_ZN5ZxDoc13parseCharDataEP9ZxElement:
  557|   683k|void ZxDoc::parseCharData(ZxElement *par) {
  558|   683k|  GString *data;
  559|   683k|  const char *start;
  560|   683k|  char c;
  561|   683k|  unsigned int x;
  562|   683k|  int n;
  563|       |
  564|   683k|  data = new GString();
  565|  1.92M|  while (parsePtr < parseEnd && *parsePtr != '<') {
  ------------------
  |  Branch (565:10): [True: 1.92M, False: 267]
  |  Branch (565:33): [True: 1.24M, False: 683k]
  ------------------
  566|  1.24M|    if (*parsePtr == '&') {
  ------------------
  |  Branch (566:9): [True: 557k, False: 687k]
  ------------------
  567|   557k|      ++parsePtr;
  568|   557k|      if (parsePtr < parseEnd && *parsePtr == '#') {
  ------------------
  |  Branch (568:11): [True: 557k, False: 1]
  |  Branch (568:34): [True: 15.2k, False: 542k]
  ------------------
  569|  15.2k|	++parsePtr;
  570|  15.2k|	if (parsePtr < parseEnd && *parsePtr == 'x') {
  ------------------
  |  Branch (570:6): [True: 15.1k, False: 6]
  |  Branch (570:29): [True: 7.77k, False: 7.41k]
  ------------------
  571|  7.77k|	  ++parsePtr;
  572|  7.77k|	  x = 0;
  573|  19.5k|	  while (parsePtr < parseEnd) {
  ------------------
  |  Branch (573:11): [True: 19.5k, False: 2]
  ------------------
  574|  19.5k|	    c = *parsePtr;
  575|  19.5k|	    if (c >= '0' && c <= '9') {
  ------------------
  |  Branch (575:10): [True: 15.9k, False: 3.65k]
  |  Branch (575:22): [True: 1.07k, False: 14.8k]
  ------------------
  576|  1.07k|	      x = (x << 4) + (c - '0');
  577|  18.5k|	    } else if (c >= 'a' && c <= 'f') {
  ------------------
  |  Branch (577:17): [True: 4.65k, False: 13.8k]
  |  Branch (577:29): [True: 2.48k, False: 2.17k]
  ------------------
  578|  2.48k|	      x = (x << 4) + (10 + c - 'a');
  579|  16.0k|	    } else if (c >= 'A' && c <= 'F') {
  ------------------
  |  Branch (579:17): [True: 10.9k, False: 5.05k]
  |  Branch (579:29): [True: 8.25k, False: 2.72k]
  ------------------
  580|  8.25k|	      x = (x << 4) + (10 + c - 'A');
  581|  8.25k|	    } else {
  582|  7.77k|	      break;
  583|  7.77k|	    }
  584|  11.8k|	    ++parsePtr;
  585|  11.8k|	  }
  586|  7.77k|	  if (parsePtr < parseEnd && *parsePtr == ';') {
  ------------------
  |  Branch (586:8): [True: 7.77k, False: 2]
  |  Branch (586:31): [True: 174, False: 7.60k]
  ------------------
  587|    174|	    ++parsePtr;
  588|    174|	  }
  589|  7.77k|	  appendUTF8(data, x);
  590|  7.77k|	} else {
  591|  7.42k|	  x = 0;
  592|  9.42k|	  while (parsePtr < parseEnd) {
  ------------------
  |  Branch (592:11): [True: 9.41k, False: 7]
  ------------------
  593|  9.41k|	    c = *parsePtr;
  594|  9.41k|	    if (c >= '0' && c <= '9') {
  ------------------
  |  Branch (594:10): [True: 5.92k, False: 3.49k]
  |  Branch (594:22): [True: 2.00k, False: 3.92k]
  ------------------
  595|  2.00k|	      x = x * 10 + (c - '0');
  596|  7.41k|	    } else {
  597|  7.41k|	      break;
  598|  7.41k|	    }
  599|  2.00k|	    ++parsePtr;
  600|  2.00k|	  }
  601|  7.42k|	  if (parsePtr < parseEnd && *parsePtr == ';') {
  ------------------
  |  Branch (601:8): [True: 7.41k, False: 7]
  |  Branch (601:31): [True: 332, False: 7.08k]
  ------------------
  602|    332|	    ++parsePtr;
  603|    332|	  }
  604|  7.42k|	  appendUTF8(data, x);
  605|  7.42k|	}
  606|   542k|      } else {
  607|   542k|	start = parsePtr;
  608|   542k|	for (++parsePtr;
  609|  14.9M|	     parsePtr < parseEnd && *parsePtr != ';' &&
  ------------------
  |  Branch (609:7): [True: 14.9M, False: 31]
  |  Branch (609:30): [True: 14.9M, False: 240]
  ------------------
  610|  14.9M|	       *parsePtr != '<' && *parsePtr != '&';
  ------------------
  |  Branch (610:9): [True: 14.8M, False: 102k]
  |  Branch (610:29): [True: 14.3M, False: 440k]
  ------------------
  611|  14.3M|	     ++parsePtr) ;
  612|   542k|	n = (int)(parsePtr - start);
  613|   542k|	if (parsePtr < parseEnd && *parsePtr == ';') {
  ------------------
  |  Branch (613:6): [True: 542k, False: 31]
  |  Branch (613:29): [True: 240, False: 542k]
  ------------------
  614|    240|	  ++parsePtr;
  615|    240|	}
  616|   542k|	if (n == 2 && !strncmp(start, "lt", 2)) {
  ------------------
  |  Branch (616:6): [True: 24.7k, False: 518k]
  |  Branch (616:16): [True: 206, False: 24.5k]
  ------------------
  617|    206|	  data->append('<');
  618|   542k|	} else if (n == 2 && !strncmp(start, "gt", 2)) {
  ------------------
  |  Branch (618:13): [True: 24.5k, False: 518k]
  |  Branch (618:23): [True: 288, False: 24.2k]
  ------------------
  619|    288|	  data->append('>');
  620|   542k|	} else if (n == 3 && !strncmp(start, "amp", 3)) {
  ------------------
  |  Branch (620:13): [True: 24.0k, False: 518k]
  |  Branch (620:23): [True: 155, False: 23.8k]
  ------------------
  621|    155|	  data->append('&');
  622|   542k|	} else if (n == 4 && !strncmp(start, "apos", 4)) {
  ------------------
  |  Branch (622:13): [True: 14.4k, False: 527k]
  |  Branch (622:23): [True: 0, False: 14.4k]
  ------------------
  623|      0|	  data->append('\'');
  624|   542k|	} else if (n == 4 && !strncmp(start, "quot", 4)) {
  ------------------
  |  Branch (624:13): [True: 14.4k, False: 527k]
  |  Branch (624:23): [True: 0, False: 14.4k]
  ------------------
  625|      0|	  data->append('"');
  626|   542k|	} else {
  627|   542k|	  data->append(start - 1, (int)(parsePtr - start) + 1);
  628|   542k|	}
  629|   542k|      }
  630|   687k|    } else {
  631|   687k|      start = parsePtr;
  632|   687k|      for (++parsePtr;
  633|  19.7M|	   parsePtr < parseEnd && *parsePtr != '<' && *parsePtr != '&';
  ------------------
  |  Branch (633:5): [True: 19.7M, False: 226]
  |  Branch (633:28): [True: 19.1M, False: 580k]
  |  Branch (633:48): [True: 19.0M, False: 106k]
  ------------------
  634|  19.0M|	   ++parsePtr) ;
  635|   687k|      data->append(start, (int)(parsePtr - start));
  636|   687k|    }
  637|  1.24M|  }
  638|   683k|  par->addChild(new ZxCharData(data, true));
  639|   683k|}
_ZN5ZxDoc10appendUTF8EP7GStringj:
  641|  26.9k|void ZxDoc::appendUTF8(GString *s, unsigned int c) {
  642|  26.9k|  if (c <= 0x7f) {
  ------------------
  |  Branch (642:7): [True: 22.9k, False: 4.00k]
  ------------------
  643|  22.9k|    s->append((char)c);
  644|  22.9k|  } else if (c <= 0x7ff) {
  ------------------
  |  Branch (644:14): [True: 1.05k, False: 2.94k]
  ------------------
  645|  1.05k|    s->append((char)(0xc0 + (c >> 6)));
  646|  1.05k|    s->append((char)(0x80 + (c & 0x3f)));
  647|  2.94k|  } else if (c <= 0xffff) {
  ------------------
  |  Branch (647:14): [True: 903, False: 2.04k]
  ------------------
  648|    903|    s->append((char)(0xe0 + (c >> 12)));
  649|    903|    s->append((char)(0x80 + ((c >> 6) & 0x3f)));
  650|    903|    s->append((char)(0x80 + (c & 0x3f)));
  651|  2.04k|  } else if (c <= 0x1fffff) {
  ------------------
  |  Branch (651:14): [True: 679, False: 1.36k]
  ------------------
  652|    679|    s->append((char)(0xf0 + (c >> 18)));
  653|    679|    s->append((char)(0x80 + ((c >> 12) & 0x3f)));
  654|    679|    s->append((char)(0x80 + ((c >> 6) & 0x3f)));
  655|    679|    s->append((char)(0x80 + (c & 0x3f)));
  656|  1.36k|  } else if (c <= 0x3ffffff) {
  ------------------
  |  Branch (656:14): [True: 918, False: 447]
  ------------------
  657|    918|    s->append((char)(0xf8 + (c >> 24)));
  658|    918|    s->append((char)(0x80 + ((c >> 18) & 0x3f)));
  659|    918|    s->append((char)(0x80 + ((c >> 12) & 0x3f)));
  660|    918|    s->append((char)(0x80 + ((c >> 6) & 0x3f)));
  661|    918|    s->append((char)(0x80 + (c & 0x3f)));
  662|    918|  } else if (c <= 0x7fffffff) {
  ------------------
  |  Branch (662:14): [True: 63, False: 384]
  ------------------
  663|     63|    s->append((char)(0xfc + (c >> 30)));
  664|     63|    s->append((char)(0x80 + ((c >> 24) & 0x3f)));
  665|     63|    s->append((char)(0x80 + ((c >> 18) & 0x3f)));
  666|     63|    s->append((char)(0x80 + ((c >> 12) & 0x3f)));
  667|     63|    s->append((char)(0x80 + ((c >> 6) & 0x3f)));
  668|     63|    s->append((char)(0x80 + (c & 0x3f)));
  669|     63|  }
  670|  26.9k|}
_ZN5ZxDoc11parseCDSectEP6ZxNode:
  673|     20|void ZxDoc::parseCDSect(ZxNode *par) {
  674|     20|  const char *start;
  675|       |
  676|     20|  parsePtr += 9;
  677|     20|  start = parsePtr;
  678|  40.6k|  while (parsePtr < parseEnd - 3) {
  ------------------
  |  Branch (678:10): [True: 40.6k, False: 3]
  ------------------
  679|  40.6k|    if (!strncmp(parsePtr, "]]>", 3)) {
  ------------------
  |  Branch (679:9): [True: 17, False: 40.5k]
  ------------------
  680|     17|      par->addChild(new ZxCharData(new GString(start, (int)(parsePtr - start)),
  681|     17|				   false));
  682|     17|      parsePtr += 3;
  683|     17|      return;
  684|     17|    }
  685|  40.5k|    ++parsePtr;
  686|  40.5k|  }
  687|      3|  parsePtr = parseEnd;
  688|      3|  par->addChild(new ZxCharData(new GString(start, (int)(parsePtr - start)),
  689|      3|			       false));
  690|      3|}
_ZN5ZxDoc9parseMiscEP6ZxNode:
  692|  1.87k|void ZxDoc::parseMisc(ZxNode *par) {
  693|  4.95k|  while (1) {
  ------------------
  |  Branch (693:10): [True: 4.95k, Folded]
  ------------------
  694|  4.95k|    if (match("<!--")) {
  ------------------
  |  Branch (694:9): [True: 78, False: 4.87k]
  ------------------
  695|     78|      parseComment(par);
  696|  4.87k|    } else if (match("<?")) {
  ------------------
  |  Branch (696:16): [True: 310, False: 4.56k]
  ------------------
  697|    310|      parsePI(par);
  698|  4.56k|    } else if (parsePtr < parseEnd && (*parsePtr == '\x20' ||
  ------------------
  |  Branch (698:16): [True: 4.06k, False: 496]
  |  Branch (698:40): [True: 1.06k, False: 3.00k]
  ------------------
  699|  3.00k|				       *parsePtr == '\x09' ||
  ------------------
  |  Branch (699:12): [True: 855, False: 2.15k]
  ------------------
  700|  2.15k|				       *parsePtr == '\x0d' ||
  ------------------
  |  Branch (700:12): [True: 126, False: 2.02k]
  ------------------
  701|  2.68k|				       *parsePtr == '\x0a')) {
  ------------------
  |  Branch (701:12): [True: 644, False: 1.38k]
  ------------------
  702|  2.68k|      ++parsePtr;
  703|  2.68k|    } else {
  704|  1.87k|      break;
  705|  1.87k|    }
  706|  4.95k|  }
  707|  1.87k|}
_ZN5ZxDoc12parseCommentEP6ZxNode:
  710|    371|void ZxDoc::parseComment(ZxNode *par) {
  711|    371|  const char *start;
  712|       |
  713|    371|  parsePtr += 4;
  714|    371|  start = parsePtr;
  715|   128k|  while (parsePtr <= parseEnd - 3) {
  ------------------
  |  Branch (715:10): [True: 128k, False: 9]
  ------------------
  716|   128k|    if (!strncmp(parsePtr, "-->", 3)) {
  ------------------
  |  Branch (716:9): [True: 362, False: 127k]
  ------------------
  717|    362|      par->addChild(new ZxComment(new GString(start, (int)(parsePtr - start))));
  718|    362|      parsePtr += 3;
  719|    362|      return;
  720|    362|    }
  721|   127k|    ++parsePtr;
  722|   127k|  }
  723|      9|  parsePtr = parseEnd;
  724|      9|}
_ZN5ZxDoc7parsePIEP6ZxNode:
  727|  6.37k|void ZxDoc::parsePI(ZxNode *par) {
  728|  6.37k|  GString *target;
  729|  6.37k|  const char *start;
  730|       |
  731|  6.37k|  parsePtr += 2;
  732|  6.37k|  target = parseName();
  733|  6.37k|  parseSpace();
  734|  6.37k|  start = parsePtr;
  735|   602k|  while (parsePtr <= parseEnd - 2) {
  ------------------
  |  Branch (735:10): [True: 602k, False: 33]
  ------------------
  736|   602k|    if (!strncmp(parsePtr, "?>", 2)) {
  ------------------
  |  Branch (736:9): [True: 6.34k, False: 595k]
  ------------------
  737|  6.34k|      par->addChild(new ZxPI(target, new GString(start,
  738|  6.34k|						 (int)(parsePtr - start))));
  739|  6.34k|      parsePtr += 2;
  740|  6.34k|      return;
  741|  6.34k|    }
  742|   595k|    ++parsePtr;
  743|   595k|  }
  744|     33|  parsePtr = parseEnd;
  745|     33|  par->addChild(new ZxPI(target, new GString(start, (int)(parsePtr - start))));
  746|     33|}
_ZN5ZxDoc9parseNameEv:
  750|  2.01M|GString *ZxDoc::parseName() {
  751|  2.01M|  GString *name;
  752|       |
  753|  2.01M|  name = new GString();
  754|  2.01M|  if (parsePtr < parseEnd && nameStartChar[*parsePtr & 0xff]) {
  ------------------
  |  Branch (754:7): [True: 2.01M, False: 70]
  |  Branch (754:30): [True: 955k, False: 1.05M]
  ------------------
  755|   955k|    name->append(*parsePtr++);
  756|  3.36M|    while (parsePtr < parseEnd && nameChar[*parsePtr & 0xff]) {
  ------------------
  |  Branch (756:12): [True: 3.36M, False: 11]
  |  Branch (756:35): [True: 2.41M, False: 955k]
  ------------------
  757|  2.41M|      name->append(*parsePtr++);
  758|  2.41M|    }
  759|   955k|  }
  760|  2.01M|  return name;
  761|  2.01M|}
_ZN5ZxDoc17parseQuotedStringEv:
  763|    400|GString *ZxDoc::parseQuotedString() {
  764|    400|  GString *s;
  765|    400|  const char *start;
  766|    400|  char quote;
  767|       |
  768|    400|  if (parsePtr < parseEnd && (*parsePtr == '"' || *parsePtr == '\'')) {
  ------------------
  |  Branch (768:7): [True: 398, False: 2]
  |  Branch (768:31): [True: 329, False: 69]
  |  Branch (768:51): [True: 31, False: 38]
  ------------------
  769|    360|    quote = *parsePtr++;
  770|    360|    start = parsePtr;
  771|  18.4k|    while (parsePtr < parseEnd && *parsePtr != quote) {
  ------------------
  |  Branch (771:12): [True: 18.4k, False: 1]
  |  Branch (771:35): [True: 18.0k, False: 359]
  ------------------
  772|  18.0k|      ++parsePtr;
  773|  18.0k|    }
  774|    360|    s = new GString(start, (int)(parsePtr - start));
  775|    360|    if (parsePtr < parseEnd && *parsePtr == quote) {
  ------------------
  |  Branch (775:9): [True: 359, False: 1]
  |  Branch (775:32): [True: 359, False: 0]
  ------------------
  776|    359|      ++parsePtr;
  777|    359|    }
  778|    360|  } else {
  779|     40|    s = new GString();
  780|     40|  }
  781|    400|  return s;
  782|    400|}
_ZN5ZxDoc8parseBOMEv:
  784|    626|void ZxDoc::parseBOM() {
  785|    626|  if (match("\xef\xbb\xbf")) {
  ------------------
  |  Branch (785:7): [True: 16, False: 610]
  ------------------
  786|     16|    parsePtr += 3;
  787|     16|  }
  788|    626|}
_ZN5ZxDoc10parseSpaceEv:
  790|  2.20M|void ZxDoc::parseSpace() {
  791|  3.12M|  while (parsePtr < parseEnd && (*parsePtr == '\x20' ||
  ------------------
  |  Branch (791:10): [True: 3.12M, False: 198]
  |  Branch (791:34): [True: 786k, False: 2.33M]
  ------------------
  792|  2.33M|				 *parsePtr == '\x09' ||
  ------------------
  |  Branch (792:6): [True: 15.5k, False: 2.32M]
  ------------------
  793|  2.32M|				 *parsePtr == '\x0d' ||
  ------------------
  |  Branch (793:6): [True: 34.0k, False: 2.29M]
  ------------------
  794|  2.29M|				 *parsePtr == '\x0a')) {
  ------------------
  |  Branch (794:6): [True: 86.5k, False: 2.20M]
  ------------------
  795|   922k|    ++parsePtr;
  796|   922k|  }
  797|  2.20M|}
_ZN5ZxDoc5matchEPKc:
  799|  11.2M|bool ZxDoc::match(const char *s) {
  800|  11.2M|  int n;
  801|       |
  802|  11.2M|  n = (int)strlen(s);
  803|  11.2M|  return parseEnd - parsePtr >= n && !strncmp(parsePtr, s, n);
  ------------------
  |  Branch (803:10): [True: 11.2M, False: 1.75k]
  |  Branch (803:38): [True: 1.38M, False: 9.90M]
  ------------------
  804|  11.2M|}
_ZN9ZxXMLDeclC2EP7GStringS1_b:
  822|    251|ZxXMLDecl::ZxXMLDecl(GString *versionA, GString *encodingA, bool standaloneA) {
  823|    251|  version = versionA;
  824|    251|  encoding = encodingA;
  825|    251|  standalone = standaloneA;
  826|    251|}
_ZN9ZxXMLDeclD2Ev:
  828|    251|ZxXMLDecl::~ZxXMLDecl() {
  829|    251|  delete version;
  830|    251|  if (encoding) {
  ------------------
  |  Branch (830:7): [True: 150, False: 101]
  ------------------
  831|    150|    delete encoding;
  832|    150|  }
  833|    251|}
_ZN13ZxDocTypeDeclC2EP7GString:
  858|     35|ZxDocTypeDecl::ZxDocTypeDecl(GString *nameA) {
  859|     35|  name = nameA;
  860|     35|}
_ZN13ZxDocTypeDeclD2Ev:
  862|     35|ZxDocTypeDecl::~ZxDocTypeDecl() {
  863|     35|  delete name;
  864|     35|}
_ZN9ZxCommentC2EP7GString:
  880|    362|ZxComment::ZxComment(GString *textA) {
  881|    362|  text = textA;
  882|    362|}
_ZN9ZxCommentD2Ev:
  884|    362|ZxComment::~ZxComment() {
  885|    362|  delete text;
  886|    362|}
_ZN4ZxPIC2EP7GStringS1_:
  902|  6.37k|ZxPI::ZxPI(GString *targetA, GString *textA) {
  903|  6.37k|  target = targetA;
  904|  6.37k|  text = textA;
  905|  6.37k|}
_ZN4ZxPID2Ev:
  907|  6.37k|ZxPI::~ZxPI() {
  908|  6.37k|  delete target;
  909|  6.37k|  delete text;
  910|  6.37k|}
_ZN9ZxElementC2EP7GString:
  928|   967k|ZxElement::ZxElement(GString *typeA) {
  929|   967k|  type = typeA;
  930|   967k|  attrs = new GHash();
  931|       |  firstAttr = lastAttr = NULL;
  932|   967k|}
_ZN9ZxElementD2Ev:
  934|   967k|ZxElement::~ZxElement() {
  935|   967k|  delete type;
  936|   967k|  deleteGHash(attrs, ZxAttr);
  ------------------
  |  |   60|   967k|  do {                                             \
  |  |   61|   967k|    GHash *_hash = (hash);                         \
  |  |   62|   967k|    {                                              \
  |  |   63|   967k|      GHashIter *_iter;                            \
  |  |   64|   967k|      GString *_key;                               \
  |  |   65|   967k|      void *_p;                                    \
  |  |   66|   967k|      _hash->startIter(&_iter);                    \
  |  |   67|  1.04M|      while (_hash->getNext(&_iter, &_key, &_p)) { \
  |  |  ------------------
  |  |  |  Branch (67:14): [True: 74.1k, False: 967k]
  |  |  ------------------
  |  |   68|  74.1k|        delete (T*)_p;                             \
  |  |   69|  74.1k|      }                                            \
  |  |   70|   967k|      delete _hash;                                \
  |  |   71|   967k|    }                                              \
  |  |   72|   967k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (72:11): [Folded, False: 967k]
  |  |  ------------------
  ------------------
  937|   967k|}
_ZN9ZxElement9isElementEPKc:
  939|  1.98M|bool ZxElement::isElement(const char *typeA) {
  940|  1.98M|  return !type->cmp(typeA);
  941|  1.98M|}
_ZN9ZxElement8findAttrEPKc:
  943|   426k|ZxAttr *ZxElement::findAttr(const char *attrName) {
  944|   426k|  return (ZxAttr *)attrs->lookup(attrName);
  945|   426k|}
_ZN9ZxElement7addAttrEP6ZxAttr:
  947|  74.1k|void ZxElement::addAttr(ZxAttr *attr) {
  948|  74.1k|  attrs->add(attr->getName(), attr);
  949|  74.1k|  if (lastAttr) {
  ------------------
  |  Branch (949:7): [True: 21.5k, False: 52.5k]
  ------------------
  950|  21.5k|    lastAttr->next = attr;
  951|  21.5k|    lastAttr= attr;
  952|  52.5k|  } else {
  953|  52.5k|    firstAttr = lastAttr = attr;
  954|  52.5k|  }
  955|  74.1k|  attr->parent = this;
  956|       |  attr->next = NULL;
  957|  74.1k|}
_ZN6ZxAttrC2EP7GStringS1_:
 1025|  74.1k|ZxAttr::ZxAttr(GString *nameA, GString *valueA) {
 1026|  74.1k|  name = nameA;
 1027|  74.1k|  value = valueA;
 1028|  74.1k|  parent = NULL;
 1029|       |  next = NULL;
 1030|  74.1k|}
_ZN6ZxAttrD2Ev:
 1032|  74.1k|ZxAttr::~ZxAttr() {
 1033|  74.1k|  delete name;
 1034|  74.1k|  delete value;
 1035|  74.1k|}
_ZN10ZxCharDataC2EP7GStringb:
 1039|   683k|ZxCharData::ZxCharData(GString *dataA, bool parsedA) {
 1040|   683k|  data = dataA;
 1041|   683k|  parsed = parsedA;
 1042|   683k|}
_ZN10ZxCharDataD2Ev:
 1044|   683k|ZxCharData::~ZxCharData() {
 1045|   683k|  delete data;
 1046|   683k|}

_ZN5ZxDoc7getRootEv:
   88|  1.64k|  ZxElement *getRoot() { return root; }
_ZN10ZxCharData7getDataEv:
  257|    577|  GString *getData() { return data; }
_ZN6ZxAttr8getValueEv:
  234|  26.2k|  GString *getValue() { return value; }
_ZN9ZxElement7getTypeEv:
  209|   268k|  GString *getType() { return type; }
_ZN6ZxNode9isXMLDeclEv:
   36|    829|  virtual bool isXMLDecl()  { return false; }
_ZN6ZxNode13isDocTypeDeclEv:
   37|    794|  virtual bool isDocTypeDecl() { return false; }
_ZN6ZxNode9isElementEv:
   40|   190k|  virtual bool isElement() { return false; }
_ZN6ZxNode9isElementEPKc:
   41|   258k|  virtual bool isElement(const char *type) { return false; }
_ZN6ZxNode10isCharDataEv:
   42|    571|  virtual bool isCharData() { return false; }
_ZN6ZxNode13getFirstChildEv:
   43|   211k|  virtual ZxNode *getFirstChild() { return firstChild; }
_ZN6ZxNode12getNextChildEv:
   44|   414k|  virtual ZxNode *getNextChild() { return next; }
_ZN9ZxXMLDecl9isXMLDeclEv:
  129|    251|  virtual bool isXMLDecl() { return true; }
_ZN13ZxDocTypeDecl13isDocTypeDeclEv:
  151|     35|  virtual bool isDocTypeDecl() { return true; }
_ZN9ZxElement9isElementEv:
  207|   225k|  virtual bool isElement() { return true; }
_ZN6ZxAttr7getNameEv:
  233|  74.1k|  GString *getName() { return name; }
_ZN10ZxCharData10isCharDataEv:
  256|    577|  virtual bool isCharData() { return true; }

