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

_ZN5GHashC2Ei:
   34|  1.36M|GHash::GHash(GBool deleteKeysA) {
   35|  1.36M|  int h;
   36|       |
   37|  1.36M|  deleteKeys = deleteKeysA;
   38|  1.36M|  size = 7;
   39|  1.36M|  tab = (GHashBucket **)gmallocn(size, sizeof(GHashBucket *));
   40|  10.8M|  for (h = 0; h < size; ++h) {
  ------------------
  |  Branch (40:15): [True: 9.53M, False: 1.36M]
  ------------------
   41|       |    tab[h] = NULL;
   42|  9.53M|  }
   43|  1.36M|  len = 0;
   44|  1.36M|}
_ZN5GHashD2Ev:
   46|  1.36M|GHash::~GHash() {
   47|  1.36M|  GHashBucket *p;
   48|  1.36M|  int h;
   49|       |
   50|  10.9M|  for (h = 0; h < size; ++h) {
  ------------------
  |  Branch (50:15): [True: 9.55M, False: 1.36M]
  ------------------
   51|  9.74M|    while (tab[h]) {
  ------------------
  |  Branch (51:12): [True: 198k, False: 9.55M]
  ------------------
   52|   198k|      p = tab[h];
   53|   198k|      tab[h] = p->next;
   54|   198k|      if (deleteKeys) {
  ------------------
  |  Branch (54:11): [True: 3.12k, False: 195k]
  ------------------
   55|  3.12k|	delete p->key;
   56|  3.12k|      }
   57|   198k|      delete p;
   58|   198k|    }
   59|  9.55M|  }
   60|  1.36M|  gfree(tab);
   61|  1.36M|}
_ZN5GHash3addEP7GStringPv:
   63|   170k|void GHash::add(GString *key, void *val) {
   64|   170k|  GHashBucket *p;
   65|   170k|  int h;
   66|       |
   67|       |  // expand the table if necessary
   68|   170k|  if (len >= size) {
  ------------------
  |  Branch (68:7): [True: 623, False: 169k]
  ------------------
   69|    623|    expand();
   70|    623|  }
   71|       |
   72|       |  // add the new symbol
   73|   170k|  p = new GHashBucket;
   74|   170k|  p->key = key;
   75|   170k|  p->val.p = val;
   76|   170k|  h = hash(key);
   77|   170k|  p->next = tab[h];
   78|   170k|  tab[h] = p;
   79|   170k|  ++len;
   80|   170k|}
_ZN5GHash3addEP7GStringi:
   82|  28.3k|void GHash::add(GString *key, int val) {
   83|  28.3k|  GHashBucket *p;
   84|  28.3k|  int h;
   85|       |
   86|       |  // expand the table if necessary
   87|  28.3k|  if (len >= size) {
  ------------------
  |  Branch (87:7): [True: 226, False: 28.1k]
  ------------------
   88|    226|    expand();
   89|    226|  }
   90|       |
   91|       |  // add the new symbol
   92|  28.3k|  p = new GHashBucket;
   93|  28.3k|  p->key = key;
   94|  28.3k|  p->val.i = val;
   95|  28.3k|  h = hash(key);
   96|  28.3k|  p->next = tab[h];
   97|  28.3k|  tab[h] = p;
   98|  28.3k|  ++len;
   99|  28.3k|}
_ZN5GHash7replaceEP7GStringi:
  115|  37.2k|void GHash::replace(GString *key, int val) {
  116|  37.2k|  GHashBucket *p;
  117|  37.2k|  int h;
  118|       |
  119|  37.2k|  if ((p = find(key, &h))) {
  ------------------
  |  Branch (119:7): [True: 8.85k, False: 28.3k]
  ------------------
  120|  8.85k|    p->val.i = val;
  121|  8.85k|    if (deleteKeys) {
  ------------------
  |  Branch (121:9): [True: 0, False: 8.85k]
  ------------------
  122|      0|      delete key;
  123|      0|    }
  124|  28.3k|  } else {
  125|  28.3k|    add(key, val);
  126|  28.3k|  }
  127|  37.2k|}
_ZN5GHash6lookupEP7GString:
  129|  7.17k|void *GHash::lookup(GString *key) {
  130|  7.17k|  GHashBucket *p;
  131|  7.17k|  int h;
  132|       |
  133|  7.17k|  if (!(p = find(key, &h))) {
  ------------------
  |  Branch (133:7): [True: 7.16k, False: 11]
  ------------------
  134|  7.16k|    return NULL;
  135|  7.16k|  }
  136|     11|  return p->val.p;
  137|  7.17k|}
_ZN5GHash9lookupIntEP7GString:
  139|  37.2k|int GHash::lookupInt(GString *key) {
  140|  37.2k|  GHashBucket *p;
  141|  37.2k|  int h;
  142|       |
  143|  37.2k|  if (!(p = find(key, &h))) {
  ------------------
  |  Branch (143:7): [True: 28.3k, False: 8.85k]
  ------------------
  144|  28.3k|    return 0;
  145|  28.3k|  }
  146|  8.85k|  return p->val.i;
  147|  37.2k|}
_ZN5GHash6lookupEPKc:
  149|   460k|void *GHash::lookup(const char *key) {
  150|   460k|  GHashBucket *p;
  151|   460k|  int h;
  152|       |
  153|   460k|  if (!(p = find(key, &h))) {
  ------------------
  |  Branch (153:7): [True: 421k, False: 39.4k]
  ------------------
  154|   421k|    return NULL;
  155|   421k|  }
  156|  39.4k|  return p->val.p;
  157|   460k|}
_ZN5GHash9startIterEPP9GHashIter:
  261|  1.32M|void GHash::startIter(GHashIter **iter) {
  262|  1.32M|  *iter = new GHashIter;
  263|  1.32M|  (*iter)->h = -1;
  264|       |  (*iter)->p = NULL;
  265|  1.32M|}
_ZN5GHash7getNextEPP9GHashIterPP7GStringPPv:
  267|  1.49M|GBool GHash::getNext(GHashIter **iter, GString **key, void **val) {
  268|  1.49M|  if (!*iter) {
  ------------------
  |  Branch (268:7): [True: 0, False: 1.49M]
  ------------------
  269|      0|    return gFalse;
  ------------------
  |  |   18|      0|#define gFalse 0
  ------------------
  270|      0|  }
  271|  1.49M|  if ((*iter)->p) {
  ------------------
  |  Branch (271:7): [True: 170k, False: 1.32M]
  ------------------
  272|   170k|    (*iter)->p = (*iter)->p->next;
  273|   170k|  }
  274|  10.7M|  while (!(*iter)->p) {
  ------------------
  |  Branch (274:10): [True: 10.5M, False: 170k]
  ------------------
  275|  10.5M|    if (++(*iter)->h == size) {
  ------------------
  |  Branch (275:9): [True: 1.32M, False: 9.26M]
  ------------------
  276|  1.32M|      delete *iter;
  277|  1.32M|      *iter = NULL;
  278|  1.32M|      return gFalse;
  ------------------
  |  |   18|  1.32M|#define gFalse 0
  ------------------
  279|  1.32M|    }
  280|  9.26M|    (*iter)->p = tab[(*iter)->h];
  281|  9.26M|  }
  282|   170k|  *key = (*iter)->p->key;
  283|   170k|  *val = (*iter)->p->val.p;
  284|   170k|  return gTrue;
  ------------------
  |  |   17|   170k|#define gTrue 1
  ------------------
  285|  1.49M|}
_ZN5GHash6expandEv:
  312|    849|void GHash::expand() {
  313|    849|  GHashBucket **oldTab;
  314|    849|  GHashBucket *p;
  315|    849|  int oldSize, h, i;
  316|       |
  317|    849|  oldSize = size;
  318|    849|  oldTab = tab;
  319|    849|  size = 2*size + 1;
  320|    849|  tab = (GHashBucket **)gmallocn(size, sizeof(GHashBucket *));
  321|  33.4k|  for (h = 0; h < size; ++h) {
  ------------------
  |  Branch (321:15): [True: 32.5k, False: 849]
  ------------------
  322|  32.5k|    tab[h] = NULL;
  323|  32.5k|  }
  324|  16.7k|  for (i = 0; i < oldSize; ++i) {
  ------------------
  |  Branch (324:15): [True: 15.8k, False: 849]
  ------------------
  325|  31.7k|    while (oldTab[i]) {
  ------------------
  |  Branch (325:12): [True: 15.8k, False: 15.8k]
  ------------------
  326|  15.8k|      p = oldTab[i];
  327|  15.8k|      oldTab[i] = oldTab[i]->next;
  328|  15.8k|      h = hash(p->key);
  329|  15.8k|      p->next = tab[h];
  330|  15.8k|      tab[h] = p;
  331|  15.8k|    }
  332|  15.8k|  }
  333|    849|  gfree(oldTab);
  334|    849|}
_ZN5GHash4findEP7GStringPi:
  336|  81.6k|GHashBucket *GHash::find(GString *key, int *h) {
  337|  81.6k|  GHashBucket *p;
  338|       |
  339|  81.6k|  *h = hash(key);
  340|  93.3k|  for (p = tab[*h]; p; p = p->next) {
  ------------------
  |  Branch (340:21): [True: 29.3k, False: 63.9k]
  ------------------
  341|  29.3k|    if (!p->key->cmp(key)) {
  ------------------
  |  Branch (341:9): [True: 17.7k, False: 11.6k]
  ------------------
  342|  17.7k|      return p;
  343|  17.7k|    }
  344|  29.3k|  }
  345|  63.9k|  return NULL;
  346|  81.6k|}
_ZN5GHash4findEPKcPi:
  348|   460k|GHashBucket *GHash::find(const char *key, int *h) {
  349|   460k|  GHashBucket *p;
  350|       |
  351|   460k|  *h = hash(key);
  352|   474k|  for (p = tab[*h]; p; p = p->next) {
  ------------------
  |  Branch (352:21): [True: 52.9k, False: 421k]
  ------------------
  353|  52.9k|    if (!p->key->cmp(key)) {
  ------------------
  |  Branch (353:9): [True: 39.4k, False: 13.4k]
  ------------------
  354|  39.4k|      return p;
  355|  39.4k|    }
  356|  52.9k|  }
  357|   421k|  return NULL;
  358|   460k|}
_ZN5GHash4hashEP7GString:
  360|   295k|int GHash::hash(GString *key) {
  361|   295k|  const char *p;
  362|   295k|  unsigned int h;
  363|   295k|  int i;
  364|       |
  365|   295k|  h = 0;
  366|   100M|  for (p = key->getCString(), i = 0; i < key->getLength(); ++p, ++i) {
  ------------------
  |  Branch (366:38): [True: 100M, False: 295k]
  ------------------
  367|   100M|    h = 17 * h + (int)(*p & 0xff);
  368|   100M|  }
  369|   295k|  return (int)(h % size);
  370|   295k|}
_ZN5GHash4hashEPKc:
  372|   460k|int GHash::hash(const char *key) {
  373|   460k|  const char *p;
  374|   460k|  unsigned int h;
  375|       |
  376|   460k|  h = 0;
  377|  3.31M|  for (p = key; *p; ++p) {
  ------------------
  |  Branch (377:17): [True: 2.85M, False: 460k]
  ------------------
  378|  2.85M|    h = 17 * h + (int)(*p & 0xff);
  379|  2.85M|  }
  380|   460k|  return (int)(h % size);
  381|   460k|}

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

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

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

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

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

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

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

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

_ZN8AcroForm4loadEP6PDFDocP7CatalogP6Object:
  337|  1.30k|AcroForm *AcroForm::load(PDFDoc *docA, Catalog *catalog, Object *acroFormObjA) {
  338|  1.30k|  Object acroFormObj2;
  339|  1.30k|  AcroForm *acroForm;
  340|  1.30k|  AcroFormField *field;
  341|  1.30k|  Object xfaObj, fieldsObj, annotsObj, annotRef, annotObj, obj1, obj2;
  342|  1.30k|  char *touchedObjs;
  343|  1.30k|  int pageNum, i, j;
  344|       |
  345|  1.30k|  touchedObjs = (char *)gmalloc(docA->getXRef()->getNumObjects());
  346|  1.30k|  memset(touchedObjs, 0, docA->getXRef()->getNumObjects());
  347|       |
  348|       |  // this is the normal case: acroFormObj is a dictionary, as expected
  349|  1.30k|  if (acroFormObjA->isDict()) {
  ------------------
  |  Branch (349:7): [True: 840, False: 462]
  ------------------
  350|    840|    acroForm = new AcroForm(docA, acroFormObjA);
  351|       |
  352|    840|    if (globalParams->getEnableXFA()) {
  ------------------
  |  Branch (352:9): [True: 840, False: 0]
  ------------------
  353|    840|      if (!acroFormObjA->dictLookup("XFA", &xfaObj)->isNull()) {
  ------------------
  |  Branch (353:11): [True: 699, False: 141]
  ------------------
  354|    699|	acroForm->xfaScanner = XFAScanner::load(&xfaObj);
  355|    699|	if (!catalog->getNeedsRendering()) {
  ------------------
  |  Branch (355:6): [True: 690, False: 9]
  ------------------
  356|    690|	  acroForm->isStaticXFA = gTrue;
  ------------------
  |  |   17|    690|#define gTrue 1
  ------------------
  357|    690|	}
  358|    699|      }
  359|    840|      xfaObj.free();
  360|    840|    }
  361|       |
  362|    840|    if (acroFormObjA->dictLookup("NeedAppearances", &obj1)->isBool()) {
  ------------------
  |  Branch (362:9): [True: 8, False: 832]
  ------------------
  363|      8|      acroForm->needAppearances = obj1.getBool();
  364|      8|    }
  365|    840|    obj1.free();
  366|       |
  367|    840|    acroForm->buildAnnotPageList(catalog);
  368|       |
  369|    840|    if (!acroFormObjA->dictLookup("Fields", &obj1)->isArray()) {
  ------------------
  |  Branch (369:9): [True: 7, False: 833]
  ------------------
  370|      7|      if (!obj1.isNull()) {
  ------------------
  |  Branch (370:11): [True: 0, False: 7]
  ------------------
  371|      0|	error(errSyntaxError, -1, "AcroForm Fields entry is wrong type");
  372|      0|      }
  373|      7|      obj1.free();
  374|      7|      delete acroForm;
  375|      7|      gfree(touchedObjs);
  376|      7|      return NULL;
  377|      7|    }
  378|  30.0k|    for (i = 0; i < obj1.arrayGetLength(); ++i) {
  ------------------
  |  Branch (378:17): [True: 29.2k, False: 833]
  ------------------
  379|  29.2k|      obj1.arrayGetNF(i, &obj2);
  380|  29.2k|      acroForm->scanField(&obj2, touchedObjs);
  381|  29.2k|      obj2.free();
  382|  29.2k|    }
  383|    833|    obj1.free();
  384|       |
  385|       |    // scan the annotations, looking for Widget-type annots that are
  386|       |    // not attached to the AcroForm object
  387|  14.5k|    for (pageNum = 1; pageNum <= catalog->getNumPages(); ++pageNum) {
  ------------------
  |  Branch (387:23): [True: 13.7k, False: 833]
  ------------------
  388|  13.7k|      if (catalog->getPage(pageNum)->getAnnots(&annotsObj)->isArray()) {
  ------------------
  |  Branch (388:11): [True: 147, False: 13.6k]
  ------------------
  389|  10.6k|	for (i = 0; i < annotsObj.arrayGetLength(); ++i) {
  ------------------
  |  Branch (389:14): [True: 10.4k, False: 147]
  ------------------
  390|  10.4k|	  if (annotsObj.arrayGetNF(i, &annotRef)->isRef()) {
  ------------------
  |  Branch (390:8): [True: 6.09k, False: 4.38k]
  ------------------
  391|  89.1k|	    for (j = 0; j < acroForm->fields->getLength(); ++j) {
  ------------------
  |  Branch (391:18): [True: 83.0k, False: 6.05k]
  ------------------
  392|  83.0k|	      field = (AcroFormField *)acroForm->fields->get(j);
  393|  83.0k|	      if (field->fieldRef.isRef()) {
  ------------------
  |  Branch (393:12): [True: 33.9k, False: 49.1k]
  ------------------
  394|  33.9k|		if (field->fieldRef.getRefNum() == annotRef.getRefNum() &&
  ------------------
  |  Branch (394:7): [True: 43, False: 33.9k]
  ------------------
  395|     43|		    field->fieldRef.getRefGen() == annotRef.getRefGen()) {
  ------------------
  |  Branch (395:7): [True: 40, False: 3]
  ------------------
  396|     40|		  break;
  397|     40|		}
  398|  33.9k|	      }
  399|  83.0k|	    }
  400|  6.09k|	    if (j == acroForm->fields->getLength()) {
  ------------------
  |  Branch (400:10): [True: 6.05k, False: 40]
  ------------------
  401|  6.05k|	      annotRef.fetch(acroForm->doc->getXRef(), &annotObj);
  402|  6.05k|	      if (annotObj.isDict()) {
  ------------------
  |  Branch (402:12): [True: 745, False: 5.31k]
  ------------------
  403|    745|		if (annotObj.dictLookup("Subtype", &obj1)->isName("Widget")) {
  ------------------
  |  Branch (403:7): [True: 581, False: 164]
  ------------------
  404|    581|		  acroForm->scanField(&annotRef, touchedObjs);
  405|    581|		}
  406|    745|		obj1.free();
  407|    745|	      }
  408|  6.05k|	      annotObj.free();
  409|  6.05k|	    }
  410|  6.09k|	  }
  411|  10.4k|	  annotRef.free();
  412|  10.4k|	}
  413|    147|      }
  414|  13.7k|      annotsObj.free();
  415|  13.7k|    }
  416|       |
  417|       |  // if acroFormObjA is a null object, but there are Widget-type
  418|       |  // annots, we still create an AcroForm
  419|    833|  } else {
  420|       |    // create an empty dict for acroFormObj
  421|    462|    acroFormObj2.initDict(docA->getXRef());
  422|    462|    acroForm = new AcroForm(docA, &acroFormObj2);
  423|    462|    acroFormObj2.free();
  424|       |
  425|    462|    acroForm->buildAnnotPageList(catalog);
  426|       |
  427|       |    // scan the annotations, looking for any Widget-type annots
  428|  7.93k|    for (pageNum = 1; pageNum <= catalog->getNumPages(); ++pageNum) {
  ------------------
  |  Branch (428:23): [True: 7.47k, False: 462]
  ------------------
  429|  7.47k|      if (catalog->getPage(pageNum)->getAnnots(&annotsObj)->isArray()) {
  ------------------
  |  Branch (429:11): [True: 134, False: 7.34k]
  ------------------
  430|  48.9k|	for (i = 0; i < annotsObj.arrayGetLength(); ++i) {
  ------------------
  |  Branch (430:14): [True: 48.8k, False: 134]
  ------------------
  431|  48.8k|	  if (annotsObj.arrayGetNF(i, &annotRef)->isRef()) {
  ------------------
  |  Branch (431:8): [True: 5.10k, False: 43.7k]
  ------------------
  432|  5.10k|	    annotRef.fetch(acroForm->doc->getXRef(), &annotObj);
  433|  5.10k|	    if (annotObj.isDict()) {
  ------------------
  |  Branch (433:10): [True: 1.53k, False: 3.56k]
  ------------------
  434|  1.53k|	      if (annotObj.dictLookup("Subtype", &obj1)->isName("Widget")) {
  ------------------
  |  Branch (434:12): [True: 80, False: 1.45k]
  ------------------
  435|     80|		acroForm->scanField(&annotRef, touchedObjs);
  436|     80|	      }
  437|  1.53k|	      obj1.free();
  438|  1.53k|	    }
  439|  5.10k|	    annotObj.free();
  440|  5.10k|	  }
  441|  48.8k|	  annotRef.free();
  442|  48.8k|	}
  443|    134|      }
  444|  7.47k|      annotsObj.free();
  445|  7.47k|    }
  446|       |
  447|    462|    if (acroForm->fields->getLength() == 0) {
  ------------------
  |  Branch (447:9): [True: 443, False: 19]
  ------------------
  448|    443|      delete acroForm;
  449|    443|      acroForm = NULL;
  450|    443|    }
  451|    462|  }
  452|       |
  453|  1.29k|  gfree(touchedObjs);
  454|       |
  455|  1.29k|  return acroForm;
  456|  1.30k|}
_ZN8AcroFormC2EP6PDFDocP6Object:
  458|  1.30k|AcroForm::AcroForm(PDFDoc *docA, Object *acroFormObjA) {
  459|  1.30k|  doc = docA;
  460|  1.30k|  acroFormObjA->copy(&acroFormObj);
  461|  1.30k|  needAppearances = gFalse;
  ------------------
  |  |   18|  1.30k|#define gFalse 0
  ------------------
  462|  1.30k|  annotPages = new GList();
  463|  1.30k|  fields = new GList();
  464|  1.30k|  xfaScanner = NULL;
  465|  1.30k|  isStaticXFA = gFalse;
  ------------------
  |  |   18|  1.30k|#define gFalse 0
  ------------------
  466|  1.30k|}
_ZN8AcroFormD2Ev:
  468|  1.30k|AcroForm::~AcroForm() {
  469|  1.30k|  acroFormObj.free();
  470|  1.30k|  deleteGList(annotPages, AcroFormAnnotPage);
  ------------------
  |  |   94|  1.30k|  do {                                              \
  |  |   95|  1.30k|    GList *_list = (list);                          \
  |  |   96|  1.30k|    {                                               \
  |  |   97|  1.30k|      int _i;                                       \
  |  |   98|  12.8k|      for (_i = 0; _i < _list->getLength(); ++_i) { \
  |  |  ------------------
  |  |  |  Branch (98:20): [True: 11.5k, False: 1.30k]
  |  |  ------------------
  |  |   99|  11.5k|        delete (T*)_list->get(_i);                  \
  |  |  100|  11.5k|      }                                             \
  |  |  101|  1.30k|      delete _list;                                 \
  |  |  102|  1.30k|    }                                               \
  |  |  103|  1.30k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (103:12): [Folded, False: 1.30k]
  |  |  ------------------
  ------------------
  471|  1.30k|  deleteGList(fields, AcroFormField);
  ------------------
  |  |   94|  1.30k|  do {                                              \
  |  |   95|  1.30k|    GList *_list = (list);                          \
  |  |   96|  1.30k|    {                                               \
  |  |   97|  1.30k|      int _i;                                       \
  |  |   98|  3.84k|      for (_i = 0; _i < _list->getLength(); ++_i) { \
  |  |  ------------------
  |  |  |  Branch (98:20): [True: 2.54k, False: 1.30k]
  |  |  ------------------
  |  |   99|  2.54k|        delete (T*)_list->get(_i);                  \
  |  |  100|  2.54k|      }                                             \
  |  |  101|  1.30k|      delete _list;                                 \
  |  |  102|  1.30k|    }                                               \
  |  |  103|  1.30k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (103:12): [Folded, False: 1.30k]
  |  |  ------------------
  ------------------
  472|  1.30k|  delete xfaScanner;
  473|  1.30k|}
_ZN8AcroForm18buildAnnotPageListEP7Catalog:
  479|  1.30k|void AcroForm::buildAnnotPageList(Catalog *catalog) {
  480|  1.30k|  Object annotsObj, annotObj;
  481|  1.30k|  int pageNum, i;
  482|       |
  483|  22.5k|  for (pageNum = 1; pageNum <= catalog->getNumPages(); ++pageNum) {
  ------------------
  |  Branch (483:21): [True: 21.2k, False: 1.30k]
  ------------------
  484|  21.2k|    if (catalog->getPage(pageNum)->getAnnots(&annotsObj)->isArray()) {
  ------------------
  |  Branch (484:9): [True: 283, False: 20.9k]
  ------------------
  485|  60.0k|      for (i = 0; i < annotsObj.arrayGetLength(); ++i) {
  ------------------
  |  Branch (485:19): [True: 59.7k, False: 283]
  ------------------
  486|  59.7k|	if (annotsObj.arrayGetNF(i, &annotObj)->isRef()) {
  ------------------
  |  Branch (486:6): [True: 11.5k, False: 48.2k]
  ------------------
  487|  11.5k|	  annotPages->append(new AcroFormAnnotPage(annotObj.getRefNum(),
  488|  11.5k|						   annotObj.getRefGen(),
  489|  11.5k|						   pageNum));
  490|  11.5k|	}
  491|  59.7k|	annotObj.free();
  492|  59.7k|      }
  493|    283|    }
  494|  21.2k|    annotsObj.free();
  495|  21.2k|  }
  496|       |  //~ sort the list
  497|  1.30k|}
_ZN8AcroForm9scanFieldEP6ObjectPc:
  518|  32.7k|void AcroForm::scanField(Object *fieldRef, char *touchedObjs) {
  519|  32.7k|  AcroFormField *field;
  520|  32.7k|  Object fieldObj, kidsRef, kidsObj, kidRef, kidObj, subtypeObj;
  521|  32.7k|  GBool isTerminal;
  522|  32.7k|  int i;
  523|       |
  524|       |  // check for an object loop
  525|  32.7k|  if (fieldRef->isRef()) {
  ------------------
  |  Branch (525:7): [True: 5.34k, False: 27.4k]
  ------------------
  526|  5.34k|    if (fieldRef->getRefNum() < 0 ||
  ------------------
  |  Branch (526:9): [True: 0, False: 5.34k]
  ------------------
  527|  5.34k|	fieldRef->getRefNum() >= doc->getXRef()->getNumObjects() ||
  ------------------
  |  Branch (527:2): [True: 369, False: 4.97k]
  ------------------
  528|  4.97k|	touchedObjs[fieldRef->getRefNum()]) {
  ------------------
  |  Branch (528:2): [True: 694, False: 4.27k]
  ------------------
  529|  1.06k|      return;
  530|  1.06k|    }
  531|  4.27k|    touchedObjs[fieldRef->getRefNum()] = 1;
  532|  4.27k|  }
  533|       |
  534|  31.7k|  fieldRef->fetch(doc->getXRef(), &fieldObj);
  535|  31.7k|  if (!fieldObj.isDict()) {
  ------------------
  |  Branch (535:7): [True: 27.3k, False: 4.36k]
  ------------------
  536|  27.3k|    error(errSyntaxError, -1, "AcroForm field object is wrong type");
  537|  27.3k|    fieldObj.free();
  538|  27.3k|    return;
  539|  27.3k|  }
  540|       |
  541|       |  // look for a Kids entry, and check for an object loop there
  542|  4.36k|  if (fieldObj.dictLookupNF("Kids", &kidsRef)->isRef()) {
  ------------------
  |  Branch (542:7): [True: 139, False: 4.22k]
  ------------------
  543|    139|    if (kidsRef.getRefNum() < 0 ||
  ------------------
  |  Branch (543:9): [True: 0, False: 139]
  ------------------
  544|    139|	kidsRef.getRefNum() >= doc->getXRef()->getNumObjects() ||
  ------------------
  |  Branch (544:2): [True: 64, False: 75]
  ------------------
  545|    129|	touchedObjs[kidsRef.getRefNum()]) {
  ------------------
  |  Branch (545:2): [True: 65, False: 10]
  ------------------
  546|    129|      kidsRef.free();
  547|    129|      fieldObj.free();
  548|    129|      return;
  549|    129|    }
  550|     10|    touchedObjs[kidsRef.getRefNum()] = 1;
  551|     10|    kidsRef.fetch(doc->getXRef(), &kidsObj);
  552|  4.22k|  } else {
  553|  4.22k|    kidsRef.copy(&kidsObj);
  554|  4.22k|  }
  555|  4.23k|  kidsRef.free();
  556|       |
  557|       |  // if this field has a Kids array, and all of the kids have a Parent
  558|       |  // reference (i.e., they're all form fields, not widget
  559|       |  // annotations), then this is a non-terminal field, and we need to
  560|       |  // scan the kids
  561|  4.23k|  isTerminal = gTrue;
  ------------------
  |  |   17|  4.23k|#define gTrue 1
  ------------------
  562|  4.23k|  if (kidsObj.isArray()) {
  ------------------
  |  Branch (562:7): [True: 265, False: 3.97k]
  ------------------
  563|    265|    isTerminal = gFalse;
  ------------------
  |  |   18|    265|#define gFalse 0
  ------------------
  564|  5.83k|    for (i = 0; !isTerminal && i < kidsObj.arrayGetLength(); ++i) {
  ------------------
  |  Branch (564:17): [True: 5.74k, False: 87]
  |  Branch (564:32): [True: 5.56k, False: 178]
  ------------------
  565|  5.56k|      kidsObj.arrayGet(i, &kidObj);
  566|  5.56k|      if (kidObj.isDict()) {
  ------------------
  |  Branch (566:11): [True: 723, False: 4.84k]
  ------------------
  567|    723|	if (kidObj.dictLookup("Parent", &subtypeObj)->isNull()) {
  ------------------
  |  Branch (567:6): [True: 87, False: 636]
  ------------------
  568|     87|	  isTerminal = gTrue;
  ------------------
  |  |   17|     87|#define gTrue 1
  ------------------
  569|     87|	}
  570|    723|	subtypeObj.free();
  571|    723|      }
  572|  5.56k|      kidObj.free();
  573|  5.56k|    }
  574|    265|    if (!isTerminal) {
  ------------------
  |  Branch (574:9): [True: 178, False: 87]
  ------------------
  575|  3.08k|      for (i = 0; !isTerminal && i < kidsObj.arrayGetLength(); ++i) {
  ------------------
  |  Branch (575:19): [True: 3.08k, False: 0]
  |  Branch (575:34): [True: 2.91k, False: 178]
  ------------------
  576|  2.91k|	kidsObj.arrayGetNF(i, &kidRef);
  577|  2.91k|	scanField(&kidRef, touchedObjs);
  578|  2.91k|	kidRef.free();
  579|  2.91k|      }
  580|    178|    }
  581|    265|  }
  582|  4.23k|  kidsObj.free();
  583|       |
  584|  4.23k|  if (isTerminal) {
  ------------------
  |  Branch (584:7): [True: 4.05k, False: 178]
  ------------------
  585|  4.05k|    if ((field = AcroFormField::load(this, fieldRef))) {
  ------------------
  |  Branch (585:9): [True: 2.54k, False: 1.51k]
  ------------------
  586|  2.54k|      fields->append(field);
  587|  2.54k|    }
  588|  4.05k|  }
  589|       |
  590|  4.23k|  fieldObj.free();
  591|  4.23k|}
_ZN13AcroFormField4loadEP8AcroFormP6Object:
  647|  4.05k|AcroFormField *AcroFormField::load(AcroForm *acroFormA, Object *fieldRefA) {
  648|  4.05k|  GString *typeStr;
  649|  4.05k|  TextString *nameA;
  650|  4.05k|  GString *xfaName;
  651|  4.05k|  Guint flagsA;
  652|  4.05k|  GBool haveFlags, typeFromParentA;
  653|  4.05k|  Object fieldObjA, parentObj, parentObj2, obj1, obj2;
  654|  4.05k|  AcroFormFieldType typeA;
  655|  4.05k|  XFAField *xfaFieldA;
  656|  4.05k|  AcroFormField *field;
  657|  4.05k|  int depth, i0, i1;
  658|       |
  659|  4.05k|  fieldRefA->fetch(acroFormA->doc->getXRef(), &fieldObjA);
  660|       |
  661|       |  //----- get field info
  662|       |
  663|  4.05k|  if (fieldObjA.dictLookup("T", &obj1)->isString()) {
  ------------------
  |  Branch (663:7): [True: 2.60k, False: 1.45k]
  ------------------
  664|  2.60k|    nameA = new TextString(obj1.getString());
  665|  2.60k|  } else {
  666|  1.45k|    nameA = new TextString();
  667|  1.45k|  }
  668|  4.05k|  obj1.free();
  669|       |
  670|  4.05k|  if (fieldObjA.dictLookup("FT", &obj1)->isName()) {
  ------------------
  |  Branch (670:7): [True: 2.38k, False: 1.67k]
  ------------------
  671|  2.38k|    typeStr = new GString(obj1.getName());
  672|  2.38k|    typeFromParentA = gFalse;
  ------------------
  |  |   18|  2.38k|#define gFalse 0
  ------------------
  673|  2.38k|  } else {
  674|  1.67k|    typeStr = NULL;
  675|  1.67k|    typeFromParentA = gTrue;
  ------------------
  |  |   17|  1.67k|#define gTrue 1
  ------------------
  676|  1.67k|  }
  677|  4.05k|  obj1.free();
  678|       |
  679|  4.05k|  if (fieldObjA.dictLookup("Ff", &obj1)->isInt()) {
  ------------------
  |  Branch (679:7): [True: 1.71k, False: 2.34k]
  ------------------
  680|  1.71k|    flagsA = (Guint)obj1.getInt();
  681|  1.71k|    haveFlags = gTrue;
  ------------------
  |  |   17|  1.71k|#define gTrue 1
  ------------------
  682|  2.34k|  } else {
  683|  2.34k|    flagsA = 0;
  684|  2.34k|    haveFlags = gFalse;
  ------------------
  |  |   18|  2.34k|#define gFalse 0
  ------------------
  685|  2.34k|  }
  686|  4.05k|  obj1.free();
  687|       |
  688|       |  //----- get info from parent non-terminal fields
  689|       |
  690|  4.05k|  fieldObjA.dictLookup("Parent", &parentObj);
  691|  4.05k|  depth = 0;
  692|  48.2k|  while (parentObj.isDict() && depth < maxFieldObjectDepth) {
  ------------------
  |  |   72|  45.0k|#define maxFieldObjectDepth 50
  ------------------
  |  Branch (692:10): [True: 45.0k, False: 3.21k]
  |  Branch (692:32): [True: 44.1k, False: 848]
  ------------------
  693|       |
  694|  44.1k|    if (parentObj.dictLookup("T", &obj1)->isString()) {
  ------------------
  |  Branch (694:9): [True: 43.4k, False: 717]
  ------------------
  695|  43.4k|      if (nameA->getLength()) {
  ------------------
  |  Branch (695:11): [True: 43.1k, False: 313]
  ------------------
  696|  43.1k|	nameA->insert(0, (Unicode)'.');
  697|  43.1k|      }
  698|  43.4k|      nameA->insert(0, obj1.getString());
  699|  43.4k|    }
  700|  44.1k|    obj1.free();
  701|       |
  702|  44.1k|    if (!typeStr) {
  ------------------
  |  Branch (702:9): [True: 4.11k, False: 40.0k]
  ------------------
  703|  4.11k|      if (parentObj.dictLookup("FT", &obj1)->isName()) {
  ------------------
  |  Branch (703:11): [True: 362, False: 3.75k]
  ------------------
  704|    362|	typeStr = new GString(obj1.getName());
  705|    362|      }
  706|  4.11k|      obj1.free();
  707|  4.11k|    }
  708|       |
  709|  44.1k|    if (!haveFlags) {
  ------------------
  |  Branch (709:9): [True: 7.15k, False: 37.0k]
  ------------------
  710|  7.15k|      if (parentObj.dictLookup("Ff", &obj1)->isInt()) {
  ------------------
  |  Branch (710:11): [True: 474, False: 6.68k]
  ------------------
  711|    474|	flagsA = (Guint)obj1.getInt();
  712|    474|	haveFlags = gTrue;
  ------------------
  |  |   17|    474|#define gTrue 1
  ------------------
  713|    474|      }
  714|  7.15k|      obj1.free();
  715|  7.15k|    }
  716|       |
  717|  44.1k|    parentObj.dictLookup("Parent", &parentObj2);
  718|  44.1k|    parentObj.free();
  719|  44.1k|    parentObj = parentObj2;
  720|       |
  721|  44.1k|    ++depth;
  722|  44.1k|  }
  723|  4.05k|  parentObj.free();
  724|       |
  725|  4.05k|  if (!typeStr) {
  ------------------
  |  Branch (725:7): [True: 1.31k, False: 2.74k]
  ------------------
  726|  1.31k|    error(errSyntaxError, -1, "Missing type in AcroForm field");
  727|  1.31k|    goto err1;
  728|  1.31k|  }
  729|       |
  730|       |  //----- get static XFA info
  731|       |
  732|  2.74k|  xfaFieldA = NULL;
  733|  2.74k|  if (acroFormA->xfaScanner) {
  ------------------
  |  Branch (733:7): [True: 146, False: 2.59k]
  ------------------
  734|       |    // convert field name to UTF-8, and remove segments that start
  735|       |    // with '#' -- to match the XFA field name
  736|    146|    xfaName = nameA->toUTF8();
  737|    146|    i0 = 0;
  738|  1.13k|    while (i0 < xfaName->getLength()) {
  ------------------
  |  Branch (738:12): [True: 992, False: 146]
  ------------------
  739|    992|      i1 = i0;
  740|  77.5k|      while (i1 < xfaName->getLength()) {
  ------------------
  |  Branch (740:14): [True: 77.4k, False: 106]
  ------------------
  741|  77.4k|	if (xfaName->getChar(i1) == '.') {
  ------------------
  |  Branch (741:6): [True: 886, False: 76.5k]
  ------------------
  742|    886|	  ++i1;
  743|    886|	  break;
  744|    886|	}
  745|  76.5k|	++i1;
  746|  76.5k|      }
  747|    992|      if (xfaName->getChar(i0) == '#') {
  ------------------
  |  Branch (747:11): [True: 354, False: 638]
  ------------------
  748|    354|	xfaName->del(i0, i1 - i0);
  749|    638|      } else {
  750|    638|	i0 = i1;
  751|    638|      }
  752|    992|    }
  753|    146|    xfaFieldA = acroFormA->xfaScanner->findField(xfaName);
  754|    146|    delete xfaName;
  755|    146|  }
  756|       |
  757|       |  //----- check for a radio button
  758|       |
  759|       |  // this is a kludge: if we see a Btn-type field with kids, and the
  760|       |  // Ff entry is missing, assume the kids are radio buttons
  761|  2.74k|  if (typeFromParentA && !typeStr->cmp("Btn") && !haveFlags) {
  ------------------
  |  Branch (761:7): [True: 362, False: 2.38k]
  |  Branch (761:26): [True: 73, False: 289]
  |  Branch (761:50): [True: 14, False: 59]
  ------------------
  762|     14|    flagsA = acroFormFlagRadio;
  ------------------
  |  |   40|     14|#define acroFormFlagRadio              (1 << 15)  // button
  ------------------
  763|     14|  }
  764|       |
  765|       |  //----- determine field type
  766|       |
  767|  2.74k|  if (!typeStr->cmp("Btn")) {
  ------------------
  |  Branch (767:7): [True: 601, False: 2.14k]
  ------------------
  768|    601|    if (flagsA & acroFormFlagPushbutton) {
  ------------------
  |  |   41|    601|#define acroFormFlagPushbutton         (1 << 16)  // button
  ------------------
  |  Branch (768:9): [True: 30, False: 571]
  ------------------
  769|     30|      typeA = acroFormFieldPushbutton;
  770|    571|    } else if (flagsA & acroFormFlagRadio) {
  ------------------
  |  |   40|    571|#define acroFormFlagRadio              (1 << 15)  // button
  ------------------
  |  Branch (770:16): [True: 110, False: 461]
  ------------------
  771|    110|      typeA = acroFormFieldRadioButton;
  772|    461|    } else {
  773|    461|      typeA = acroFormFieldCheckbox;
  774|    461|    }
  775|  2.14k|  } else if (!typeStr->cmp("Tx")) {
  ------------------
  |  Branch (775:14): [True: 1.94k, False: 198]
  ------------------
  776|  1.94k|    if (xfaFieldA && xfaFieldA->getBarcodeInfo()) {
  ------------------
  |  Branch (776:9): [True: 0, False: 1.94k]
  |  Branch (776:22): [True: 0, False: 0]
  ------------------
  777|      0|      typeA = acroFormFieldBarcode;
  778|  1.94k|    } else if (flagsA & acroFormFlagFileSelect) {
  ------------------
  |  |   45|  1.94k|#define acroFormFlagFileSelect         (1 << 20)  // text
  ------------------
  |  Branch (778:16): [True: 151, False: 1.79k]
  ------------------
  779|    151|      typeA = acroFormFieldFileSelect;
  780|  1.79k|    } else if (flagsA & acroFormFlagMultiline) {
  ------------------
  |  |   37|  1.79k|#define acroFormFlagMultiline          (1 << 12)  // text
  ------------------
  |  Branch (780:16): [True: 130, False: 1.66k]
  ------------------
  781|    130|      typeA = acroFormFieldMultilineText;
  782|  1.66k|    } else {
  783|  1.66k|      typeA = acroFormFieldText;
  784|  1.66k|    }
  785|  1.94k|  } else if (!typeStr->cmp("Ch")) {
  ------------------
  |  Branch (785:14): [True: 0, False: 198]
  ------------------
  786|      0|    if (flagsA & acroFormFlagCombo) {
  ------------------
  |  |   42|      0|#define acroFormFlagCombo              (1 << 17)  // choice
  ------------------
  |  Branch (786:9): [True: 0, False: 0]
  ------------------
  787|      0|      typeA = acroFormFieldComboBox;
  788|      0|    } else {
  789|      0|      typeA = acroFormFieldListBox;
  790|      0|    }
  791|    198|  } else if (!typeStr->cmp("Sig")) {
  ------------------
  |  Branch (791:14): [True: 0, False: 198]
  ------------------
  792|      0|    typeA = acroFormFieldSignature;
  793|    198|  } else {
  794|    198|    error(errSyntaxError, -1, "Invalid type in AcroForm field");
  795|    198|    goto err1;
  796|    198|  }
  797|  2.54k|  delete typeStr;
  798|       |
  799|  2.54k|  field = new AcroFormField(acroFormA, fieldRefA, &fieldObjA,
  800|  2.54k|			    typeA, nameA, flagsA, typeFromParentA, xfaFieldA);
  801|  2.54k|  fieldObjA.free();
  802|  2.54k|  return field;
  803|       |
  804|  1.51k| err1:
  805|  1.51k|  delete typeStr;
  806|  1.51k|  delete nameA;
  807|  1.51k|  fieldObjA.free();
  808|       |  return NULL;
  809|  2.74k|}
_ZN13AcroFormFieldC2EP8AcroFormP6ObjectS3_17AcroFormFieldTypeP10TextStringjiP8XFAField:
  815|  2.54k|			     XFAField *xfaFieldA) {
  816|  2.54k|  acroForm = acroFormA;
  817|  2.54k|  fieldRefA->copy(&fieldRef);
  818|  2.54k|  fieldObjA->copy(&fieldObj);
  819|  2.54k|  type = typeA;
  820|  2.54k|  name = nameA;
  821|  2.54k|  flags = flagsA;
  822|  2.54k|  typeFromParent = typeFromParentA;
  823|  2.54k|  xfaField = xfaFieldA;
  824|  2.54k|}
_ZN13AcroFormFieldD2Ev:
  826|  2.54k|AcroFormField::~AcroFormField() {
  827|  2.54k|  fieldRef.free();
  828|  2.54k|  fieldObj.free();
  829|  2.54k|  delete name;
  830|  2.54k|}
_ZN17AcroFormAnnotPageC2Eiii:
  327|  11.5k|    { annotNum = annotNumA; annotGen = annotGenA; pageNum = pageNumA; }

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

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

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

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

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

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

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

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

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

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

_ZN4DictC2EP4XRef:
   31|   478k|Dict::Dict(XRef *xrefA) {
   32|   478k|  xref = xrefA;
   33|   478k|  size = 8;
   34|   478k|  length = 0;
   35|   478k|  entries = (DictEntry *)gmallocn(size, sizeof(DictEntry));
   36|   478k|  hashTab = (DictEntry **)gmallocn(2 * size - 1, sizeof(DictEntry *));
   37|   478k|  memset(hashTab, 0, (2 * size - 1) * sizeof(DictEntry *));
   38|   478k|  ref = 1;
   39|   478k|}
_ZN4DictD2Ev:
   41|   478k|Dict::~Dict() {
   42|   478k|  int i;
   43|       |
   44|  1.96M|  for (i = 0; i < length; ++i) {
  ------------------
  |  Branch (44:15): [True: 1.48M, False: 478k]
  ------------------
   45|  1.48M|    gfree(entries[i].key);
   46|  1.48M|    entries[i].val.free();
   47|  1.48M|  }
   48|   478k|  gfree(entries);
   49|   478k|  gfree(hashTab);
   50|   478k|}
_ZN4Dict3addEPcP6Object:
   52|  1.91M|void Dict::add(char *key, Object *val) {
   53|  1.91M|  DictEntry *e;
   54|  1.91M|  int h;
   55|       |
   56|  1.91M|  if ((e = find(key))) {
  ------------------
  |  Branch (56:7): [True: 425k, False: 1.48M]
  ------------------
   57|   425k|    e->val.free();
   58|   425k|    e->val = *val;
   59|   425k|    gfree(key);
   60|  1.48M|  } else {
   61|  1.48M|    if (length == size) {
  ------------------
  |  Branch (61:9): [True: 39.8k, False: 1.44M]
  ------------------
   62|  39.8k|      expand();
   63|  39.8k|    }
   64|  1.48M|    h = hash(key);
   65|  1.48M|    entries[length].key = key;
   66|  1.48M|    entries[length].val = *val;
   67|  1.48M|    entries[length].next = hashTab[h];
   68|  1.48M|    hashTab[h] = &entries[length];
   69|  1.48M|    ++length;
   70|  1.48M|  }
   71|  1.91M|}
_ZN4Dict6expandEv:
   73|  39.8k|void Dict::expand() {
   74|  39.8k|  int h, i;
   75|       |
   76|  39.8k|  size *= 2;
   77|  39.8k|  entries = (DictEntry *)greallocn(entries, size, sizeof(DictEntry));
   78|  39.8k|  hashTab = (DictEntry **)greallocn(hashTab, 2 * size - 1,
   79|  39.8k|				    sizeof(DictEntry *));
   80|  39.8k|  memset(hashTab, 0, (2 * size - 1) * sizeof(DictEntry *));
   81|   370k|  for (i = 0; i < length; ++i) {
  ------------------
  |  Branch (81:15): [True: 331k, False: 39.8k]
  ------------------
   82|   331k|    h = hash(entries[i].key);
   83|   331k|    entries[i].next = hashTab[h];
   84|   331k|    hashTab[h] = &entries[i];
   85|   331k|  }
   86|  39.8k|}
_ZN4Dict4hashEPKc:
  101|  4.82M|int Dict::hash(const char *key) {
  102|  4.82M|  const char *p;
  103|  4.82M|  unsigned int h;
  104|       |
  105|  4.82M|  h = 0;
  106|  26.1M|  for (p = key; *p; ++p) {
  ------------------
  |  Branch (106:17): [True: 21.3M, False: 4.82M]
  ------------------
  107|  21.3M|    h = 17 * h + (int)(*p & 0xff);
  108|  21.3M|  }
  109|  4.82M|  return (int)(h % (2 * size - 1));
  110|  4.82M|}
_ZN4Dict6lookupEPKcP6Objecti:
  118|  1.00M|Object *Dict::lookup(const char *key, Object *obj, int recursion) {
  119|  1.00M|  DictEntry *e;
  120|       |
  121|  1.00M|  return (e = find(key)) ? e->val.fetch(xref, obj, recursion)
  ------------------
  |  Branch (121:10): [True: 582k, False: 424k]
  ------------------
  122|  1.00M|                         : obj->initNull();
  123|  1.00M|}
_ZN4Dict8lookupNFEPKcP6Object:
  125|  91.3k|Object *Dict::lookupNF(const char *key, Object *obj) {
  126|  91.3k|  DictEntry *e;
  127|       |
  128|  91.3k|  return (e = find(key)) ? e->val.copy(obj) : obj->initNull();
  ------------------
  |  Branch (128:10): [True: 15.5k, False: 75.7k]
  ------------------
  129|  91.3k|}
_ZN4Dict6getKeyEi:
  131|    116|char *Dict::getKey(int i) {
  132|    116|  return entries[i].key;
  133|    116|}
_ZN4Dict6getValEiP6Object:
  135|    116|Object *Dict::getVal(int i, Object *obj) {
  136|    116|  return entries[i].val.fetch(xref, obj);
  137|    116|}
_ZN4Dict4findEPKc:
   88|  3.01M|inline DictEntry *Dict::find(const char *key) {
   89|  3.01M|  DictEntry *e;
   90|  3.01M|  int h;
   91|       |
   92|  3.01M|  h = hash(key);
   93|  3.59M|  for (e = hashTab[h]; e; e = e->next) {
  ------------------
  |  Branch (93:24): [True: 1.61M, False: 1.98M]
  ------------------
   94|  1.61M|    if (!strcmp(key, e->key)) {
  ------------------
  |  Branch (94:9): [True: 1.02M, False: 587k]
  ------------------
   95|  1.02M|      return e;
   96|  1.02M|    }
   97|  1.61M|  }
   98|  1.98M|  return NULL;
   99|  3.01M|}

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

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

_ZN23JArithmeticDecoderStatsC2Ei:
   20|  1.75M|JArithmeticDecoderStats::JArithmeticDecoderStats(int contextSizeA) {
   21|  1.75M|  contextSize = contextSizeA;
   22|  1.75M|  cxTab = (Guchar *)gmallocn(contextSize, sizeof(Guchar));
   23|  1.75M|  reset();
   24|  1.75M|}
_ZN23JArithmeticDecoderStatsD2Ev:
   26|  1.75M|JArithmeticDecoderStats::~JArithmeticDecoderStats() {
   27|  1.75M|  gfree(cxTab);
   28|  1.75M|}
_ZN23JArithmeticDecoderStats4copyEv:
   30|  2.08k|JArithmeticDecoderStats *JArithmeticDecoderStats::copy() {
   31|  2.08k|  JArithmeticDecoderStats *stats;
   32|       |
   33|  2.08k|  stats = new JArithmeticDecoderStats(contextSize);
   34|  2.08k|  memcpy(stats->cxTab, cxTab, contextSize);
   35|  2.08k|  return stats;
   36|  2.08k|}
_ZN23JArithmeticDecoderStats5resetEv:
   38|  2.18M|void JArithmeticDecoderStats::reset() {
   39|  2.18M|  memset(cxTab, 0, contextSize);
   40|  2.18M|}
_ZN23JArithmeticDecoderStats8setEntryEjii:
   46|  1.68M|void JArithmeticDecoderStats::setEntry(Guint cx, int i, int mps) {
   47|  1.68M|  cxTab[cx] = (Guchar)((i << 1) + mps);
   48|  1.68M|}
_ZN18JArithmeticDecoderC2Ev:
   87|   275k|JArithmeticDecoder::JArithmeticDecoder() {
   88|   275k|  str = NULL;
   89|   275k|  dataLen = 0;
   90|   275k|  limitStream = gFalse;
  ------------------
  |  |   18|   275k|#define gFalse 0
  ------------------
   91|   275k|  nBytesRead = 0;
   92|   275k|  readBufNext = 0;
   93|   275k|  readBufLength = 0;
   94|   275k|}
_ZN18JArithmeticDecoderD2Ev:
  110|   275k|JArithmeticDecoder::~JArithmeticDecoder() {
  111|   275k|  cleanup();
  112|   275k|}
_ZN18JArithmeticDecoder5startEv:
  114|   482k|void JArithmeticDecoder::start() {
  115|   482k|  buf0 = readByte();
  116|   482k|  buf1 = readByte();
  117|       |
  118|       |  // INITDEC
  119|   482k|  c = (buf0 ^ 0xff) << 16;
  120|   482k|  byteIn();
  121|   482k|  c <<= 7;
  122|   482k|  ct -= 7;
  123|   482k|  a = 0x80000000;
  124|   482k|}
_ZN18JArithmeticDecoder7restartEi:
  126|  7.57k|void JArithmeticDecoder::restart(int dataLenA) {
  127|  7.57k|  Guint cAdd;
  128|  7.57k|  GBool prevFF;
  129|  7.57k|  int k, nBits;
  130|       |
  131|  7.57k|  if (dataLen >= 0) {
  ------------------
  |  Branch (131:7): [True: 4.17k, False: 3.39k]
  ------------------
  132|  4.17k|    dataLen = dataLenA;
  133|  4.17k|  } else if (dataLen == -1) {
  ------------------
  |  Branch (133:14): [True: 1.15k, False: 2.24k]
  ------------------
  134|  1.15k|    dataLen = dataLenA;
  135|  1.15k|    buf1 = readByte();
  136|  2.24k|  } else {
  137|  2.24k|    k = (-dataLen - 1) * 8 - ct;
  138|  2.24k|    dataLen = dataLenA;
  139|  2.24k|    cAdd = 0;
  140|  2.24k|    prevFF = gFalse;
  ------------------
  |  |   18|  2.24k|#define gFalse 0
  ------------------
  141|   175k|    while (k > 0) {
  ------------------
  |  Branch (141:12): [True: 173k, False: 2.24k]
  ------------------
  142|   173k|      buf0 = readByte();
  143|   173k|      if (prevFF) {
  ------------------
  |  Branch (143:11): [True: 167k, False: 5.54k]
  ------------------
  144|   167k|	cAdd += 0xfe00 - (buf0 << 9);
  145|   167k|	nBits = 7;
  146|   167k|      } else {
  147|  5.54k|	cAdd += 0xff00 - (buf0 << 8);
  148|  5.54k|	nBits = 8;
  149|  5.54k|      }
  150|   173k|      prevFF = buf0 == 0xff;
  151|   173k|      if (k > nBits) {
  ------------------
  |  Branch (151:11): [True: 170k, False: 2.24k]
  ------------------
  152|   170k|	cAdd <<= nBits;
  153|   170k|	k -= nBits;
  154|   170k|      } else {
  155|  2.24k|	cAdd <<= k;
  156|  2.24k|	ct = nBits - k;
  157|  2.24k|	k = 0;
  158|  2.24k|      }
  159|   173k|    }
  160|  2.24k|    c += cAdd;
  161|  2.24k|    buf1 = readByte();
  162|  2.24k|  }
  163|  7.57k|}
_ZN18JArithmeticDecoder7cleanupEv:
  165|   871k|void JArithmeticDecoder::cleanup() {
  166|   871k|  if (limitStream) {
  ------------------
  |  Branch (166:7): [True: 773k, False: 98.0k]
  ------------------
  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|   773k|    readBufLength = 0;
  175|  1.06G|    while (dataLen > 0) {
  ------------------
  |  Branch (175:12): [True: 1.06G, False: 773k]
  ------------------
  176|  1.06G|      if (readBufLength < (int)sizeof(readBuf)) {
  ------------------
  |  Branch (176:11): [True: 4.87M, False: 1.06G]
  ------------------
  177|  4.87M|	readBuf[readBufLength++] = (Guchar)str->getChar();
  178|  4.87M|	++nBytesRead;
  179|  4.87M|      }
  180|  1.06G|      --dataLen;
  181|  1.06G|    }
  182|   773k|    readBufNext = 0;
  183|   773k|  }
  184|   871k|}
_ZN18JArithmeticDecoder9decodeBitEjP23JArithmeticDecoderStats:
  187|  42.0M|				  JArithmeticDecoderStats *stats) {
  188|  42.0M|  int bit;
  189|  42.0M|  Guint qe;
  190|  42.0M|  int iCX, mpsCX;
  191|       |
  192|  42.0M|  iCX = stats->cxTab[context] >> 1;
  193|  42.0M|  mpsCX = stats->cxTab[context] & 1;
  194|  42.0M|  qe = qeTab[iCX];
  195|  42.0M|  a -= qe;
  196|  42.0M|  if (c < a) {
  ------------------
  |  Branch (196:7): [True: 33.1M, False: 8.92M]
  ------------------
  197|  33.1M|    if (a & 0x80000000) {
  ------------------
  |  Branch (197:9): [True: 24.9M, False: 8.20M]
  ------------------
  198|  24.9M|      bit = mpsCX;
  199|  24.9M|    } else {
  200|       |      // MPS_EXCHANGE
  201|  8.20M|      if (a < qe) {
  ------------------
  |  Branch (201:11): [True: 1.26M, False: 6.94M]
  ------------------
  202|  1.26M|	bit = 1 - mpsCX;
  203|  1.26M|	if (switchTab[iCX]) {
  ------------------
  |  Branch (203:6): [True: 775k, False: 485k]
  ------------------
  204|   775k|	  stats->cxTab[context] = (Guchar)((nlpsTab[iCX] << 1) | (1 - mpsCX));
  205|   775k|	} else {
  206|   485k|	  stats->cxTab[context] = (Guchar)((nlpsTab[iCX] << 1) | mpsCX);
  207|   485k|	}
  208|  6.94M|      } else {
  209|  6.94M|	bit = mpsCX;
  210|  6.94M|	stats->cxTab[context] = (Guchar)((nmpsTab[iCX] << 1) | mpsCX);
  211|  6.94M|      }
  212|       |      // RENORMD
  213|  8.69M|      do {
  214|  8.69M|	if (ct == 0) {
  ------------------
  |  Branch (214:6): [True: 1.12M, False: 7.57M]
  ------------------
  215|  1.12M|	  byteIn();
  216|  1.12M|	}
  217|  8.69M|	a <<= 1;
  218|  8.69M|	c <<= 1;
  219|  8.69M|	--ct;
  220|  8.69M|      } while (!(a & 0x80000000));
  ------------------
  |  Branch (220:16): [True: 495k, False: 8.20M]
  ------------------
  221|  8.20M|    }
  222|  33.1M|  } else {
  223|  8.92M|    c -= a;
  224|       |    // LPS_EXCHANGE
  225|  8.92M|    if (a < qe) {
  ------------------
  |  Branch (225:9): [True: 1.61M, False: 7.30M]
  ------------------
  226|  1.61M|      bit = mpsCX;
  227|  1.61M|      stats->cxTab[context] = (Guchar)((nmpsTab[iCX] << 1) | mpsCX);
  228|  7.30M|    } else {
  229|  7.30M|      bit = 1 - mpsCX;
  230|  7.30M|      if (switchTab[iCX]) {
  ------------------
  |  Branch (230:11): [True: 2.23M, False: 5.07M]
  ------------------
  231|  2.23M|	stats->cxTab[context] = (Guchar)((nlpsTab[iCX] << 1) | (1 - mpsCX));
  232|  5.07M|      } else {
  233|  5.07M|	stats->cxTab[context] = (Guchar)((nlpsTab[iCX] << 1) | mpsCX);
  234|  5.07M|      }
  235|  7.30M|    }
  236|  8.92M|    a = qe;
  237|       |    // RENORMD
  238|  13.5M|    do {
  239|  13.5M|      if (ct == 0) {
  ------------------
  |  Branch (239:11): [True: 1.72M, False: 11.7M]
  ------------------
  240|  1.72M|	byteIn();
  241|  1.72M|      }
  242|  13.5M|      a <<= 1;
  243|  13.5M|      c <<= 1;
  244|  13.5M|      --ct;
  245|  13.5M|    } while (!(a & 0x80000000));
  ------------------
  |  Branch (245:14): [True: 4.58M, False: 8.92M]
  ------------------
  246|  8.92M|  }
  247|  42.0M|  return bit;
  248|  42.0M|}
_ZN18JArithmeticDecoder9decodeIntEPiP23JArithmeticDecoderStats:
  262|  50.5k|GBool JArithmeticDecoder::decodeInt(int *x, JArithmeticDecoderStats *stats) {
  263|  50.5k|  int s;
  264|  50.5k|  Guint v;
  265|  50.5k|  int i;
  266|       |
  267|  50.5k|  prev = 1;
  268|  50.5k|  s = decodeIntBit(stats);
  269|  50.5k|  if (decodeIntBit(stats)) {
  ------------------
  |  Branch (269:7): [True: 25.7k, False: 24.7k]
  ------------------
  270|  25.7k|    if (decodeIntBit(stats)) {
  ------------------
  |  Branch (270:9): [True: 11.7k, False: 13.9k]
  ------------------
  271|  11.7k|      if (decodeIntBit(stats)) {
  ------------------
  |  Branch (271:11): [True: 7.61k, False: 4.18k]
  ------------------
  272|  7.61k|	if (decodeIntBit(stats)) {
  ------------------
  |  Branch (272:6): [True: 2.96k, False: 4.64k]
  ------------------
  273|  2.96k|	  if (decodeIntBit(stats)) {
  ------------------
  |  Branch (273:8): [True: 2.25k, False: 716]
  ------------------
  274|  2.25k|	    v = 0;
  275|  74.2k|	    for (i = 0; i < 32; ++i) {
  ------------------
  |  Branch (275:18): [True: 72.0k, False: 2.25k]
  ------------------
  276|  72.0k|	      v = (v << 1) | decodeIntBit(stats);
  277|  72.0k|	    }
  278|  2.25k|	    v += 4436;
  279|  2.25k|	  } else {
  280|    716|	    v = 0;
  281|  9.30k|	    for (i = 0; i < 12; ++i) {
  ------------------
  |  Branch (281:18): [True: 8.59k, False: 716]
  ------------------
  282|  8.59k|	      v = (v << 1) | decodeIntBit(stats);
  283|  8.59k|	    }
  284|    716|	    v += 340;
  285|    716|	  }
  286|  4.64k|	} else {
  287|  4.64k|	  v = 0;
  288|  41.8k|	  for (i = 0; i < 8; ++i) {
  ------------------
  |  Branch (288:16): [True: 37.1k, False: 4.64k]
  ------------------
  289|  37.1k|	    v = (v << 1) | decodeIntBit(stats);
  290|  37.1k|	  }
  291|  4.64k|	  v += 84;
  292|  4.64k|	}
  293|  7.61k|      } else {
  294|  4.18k|	v = 0;
  295|  29.3k|	for (i = 0; i < 6; ++i) {
  ------------------
  |  Branch (295:14): [True: 25.1k, False: 4.18k]
  ------------------
  296|  25.1k|	  v = (v << 1) | decodeIntBit(stats);
  297|  25.1k|	}
  298|  4.18k|	v += 20;
  299|  4.18k|      }
  300|  13.9k|    } else {
  301|  13.9k|      v = decodeIntBit(stats);
  302|  13.9k|      v = (v << 1) | decodeIntBit(stats);
  303|  13.9k|      v = (v << 1) | decodeIntBit(stats);
  304|  13.9k|      v = (v << 1) | decodeIntBit(stats);
  305|  13.9k|      v += 4;
  306|  13.9k|    }
  307|  25.7k|  } else {
  308|  24.7k|    v = decodeIntBit(stats);
  309|  24.7k|    v = (v << 1) | decodeIntBit(stats);
  310|  24.7k|  }
  311|       |
  312|  50.5k|  if (s) {
  ------------------
  |  Branch (312:7): [True: 14.8k, False: 35.6k]
  ------------------
  313|  14.8k|    if (v == 0) {
  ------------------
  |  Branch (313:9): [True: 2.23k, False: 12.6k]
  ------------------
  314|  2.23k|      return gFalse;
  ------------------
  |  |   18|  2.23k|#define gFalse 0
  ------------------
  315|  2.23k|    }
  316|  12.6k|    *x = -(int)v;
  317|  35.6k|  } else {
  318|  35.6k|    *x = (int)v;
  319|  35.6k|  }
  320|  48.3k|  return gTrue;
  ------------------
  |  |   17|  48.3k|#define gTrue 1
  ------------------
  321|  50.5k|}
_ZN18JArithmeticDecoder12decodeIntBitEP23JArithmeticDecoderStats:
  323|   397k|int JArithmeticDecoder::decodeIntBit(JArithmeticDecoderStats *stats) {
  324|   397k|  int bit;
  325|       |
  326|   397k|  bit = decodeBit(prev, stats);
  327|   397k|  if (prev < 0x100) {
  ------------------
  |  Branch (327:7): [True: 291k, False: 106k]
  ------------------
  328|   291k|    prev = (prev << 1) | bit;
  329|   291k|  } else {
  330|   106k|    prev = (((prev << 1) | bit) & 0x1ff) | 0x100;
  331|   106k|  }
  332|   397k|  return bit;
  333|   397k|}
_ZN18JArithmeticDecoder10decodeIAIDEjP23JArithmeticDecoderStats:
  336|  32.4k|				     JArithmeticDecoderStats *stats) {
  337|  32.4k|  Guint i;
  338|  32.4k|  int bit;
  339|       |
  340|  32.4k|  prev = 1;
  341|   129k|  for (i = 0; i < codeLen; ++i) {
  ------------------
  |  Branch (341:15): [True: 97.3k, False: 32.4k]
  ------------------
  342|  97.3k|    bit = decodeBit(prev, stats);
  343|  97.3k|    prev = (prev << 1) | bit;
  344|  97.3k|  }
  345|  32.4k|  return prev - (1 << codeLen);
  346|  32.4k|}
_ZN18JArithmeticDecoder6byteInEv:
  348|  3.33M|void JArithmeticDecoder::byteIn() {
  349|  3.33M|  if (buf0 == 0xff) {
  ------------------
  |  Branch (349:7): [True: 2.18M, False: 1.14M]
  ------------------
  350|  2.18M|    if (buf1 > 0x8f) {
  ------------------
  |  Branch (350:9): [True: 2.17M, False: 7.28k]
  ------------------
  351|  2.17M|      if (limitStream) {
  ------------------
  |  Branch (351:11): [True: 365k, False: 1.80M]
  ------------------
  352|   365k|	buf0 = buf1;
  353|   365k|	buf1 = readByte();
  354|   365k|	c = c + 0xff00 - (buf0 << 8);
  355|   365k|      }
  356|  2.17M|      ct = 8;
  357|  2.17M|    } else {
  358|  7.28k|      buf0 = buf1;
  359|  7.28k|      buf1 = readByte();
  360|  7.28k|      c = c + 0xfe00 - (buf0 << 9);
  361|  7.28k|      ct = 7;
  362|  7.28k|    }
  363|  2.18M|  } else {
  364|  1.14M|    buf0 = buf1;
  365|  1.14M|    buf1 = readByte();
  366|  1.14M|    c = c + 0xff00 - (buf0 << 8);
  367|  1.14M|    ct = 8;
  368|  1.14M|  }
  369|  3.33M|}
_ZN18JArithmeticDecoder8readByteEv:
   96|  2.66M|inline Guint JArithmeticDecoder::readByte() {
   97|  2.66M|  if (limitStream) {
  ------------------
  |  Branch (97:7): [True: 2.34M, False: 323k]
  ------------------
   98|  2.34M|    if (readBufNext < readBufLength) {
  ------------------
  |  Branch (98:9): [True: 748k, False: 1.59M]
  ------------------
   99|   748k|      return readBuf[readBufNext++];
  100|   748k|    }
  101|  1.59M|    --dataLen;
  102|  1.59M|    if (dataLen < 0) {
  ------------------
  |  Branch (102:9): [True: 618k, False: 973k]
  ------------------
  103|   618k|      return 0xff;
  104|   618k|    }
  105|  1.59M|  }
  106|  1.29M|  ++nBytesRead;
  107|  1.29M|  return (Guint)str->getChar() & 0xff;
  108|  2.66M|}

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

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

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

_ZN5LexerC2EP4XRefP6Stream:
   46|   231k|Lexer::Lexer(XRef *xref, Stream *str) {
   47|   231k|  Object obj;
   48|       |
   49|   231k|  curStr.initStream(str);
   50|   231k|  streams = new Array(xref);
   51|   231k|  streams->add(curStr.copy(&obj));
   52|   231k|  strPtr = 0;
   53|   231k|  freeArray = gTrue;
  ------------------
  |  |   17|   231k|#define gTrue 1
  ------------------
   54|   231k|  curStr.streamReset();
   55|   231k|}
_ZN5LexerD2Ev:
   75|   231k|Lexer::~Lexer() {
   76|   231k|  if (!curStr.isNone()) {
  ------------------
  |  Branch (76:7): [True: 83.9k, False: 147k]
  ------------------
   77|  83.9k|    curStr.streamClose();
   78|  83.9k|    curStr.free();
   79|  83.9k|  }
   80|   231k|  if (freeArray) {
  ------------------
  |  Branch (80:7): [True: 231k, False: 0]
  ------------------
   81|   231k|    delete streams;
   82|   231k|  }
   83|   231k|}
_ZN5Lexer7getCharEv:
   85|   634M|int Lexer::getChar() {
   86|   634M|  int c;
   87|       |
   88|   634M|  c = EOF;
   89|   634M|  while (!curStr.isNone() && (c = curStr.streamGetChar()) == EOF) {
  ------------------
  |  Branch (89:10): [True: 566M, False: 68.2M]
  |  Branch (89:30): [True: 147k, False: 566M]
  ------------------
   90|   147k|    curStr.streamClose();
   91|   147k|    curStr.free();
   92|   147k|    ++strPtr;
   93|   147k|    if (strPtr < streams->getLength()) {
  ------------------
  |  Branch (93:9): [True: 0, False: 147k]
  ------------------
   94|      0|      streams->get(strPtr, &curStr);
   95|      0|      curStr.streamReset();
   96|      0|    }
   97|   147k|  }
   98|   634M|  return c;
   99|   634M|}
_ZN5Lexer8lookCharEv:
  101|   189M|int Lexer::lookChar() {
  102|   189M|  if (curStr.isNone()) {
  ------------------
  |  Branch (102:7): [True: 1.33k, False: 189M]
  ------------------
  103|  1.33k|    return EOF;
  104|  1.33k|  }
  105|   189M|  return curStr.streamLookChar();
  106|   189M|}
_ZN5Lexer6getObjEP6Object:
  108|   106M|Object *Lexer::getObj(Object *obj) {
  109|   106M|  char *p;
  110|   106M|  int c, c2;
  111|   106M|  GBool comment, neg, doubleMinus, done, invalid;
  112|   106M|  int numParen, nErrors;
  113|   106M|  int xi;
  114|   106M|  double xf, scale;
  115|   106M|  GString *s;
  116|   106M|  int n, m;
  117|       |
  118|       |  // skip whitespace and comments
  119|   106M|  comment = gFalse;
  ------------------
  |  |   18|   106M|#define gFalse 0
  ------------------
  120|   188M|  while (1) {
  ------------------
  |  Branch (120:10): [True: 188M, Folded]
  ------------------
  121|   188M|    if ((c = getChar()) == EOF) {
  ------------------
  |  Branch (121:9): [True: 68.1M, False: 120M]
  ------------------
  122|  68.1M|      return obj->initEOF();
  123|  68.1M|    }
  124|   120M|    if (comment) {
  ------------------
  |  Branch (124:9): [True: 12.1M, False: 108M]
  ------------------
  125|  12.1M|      if (c == '\r' || c == '\n')
  ------------------
  |  Branch (125:11): [True: 87.4k, False: 12.0M]
  |  Branch (125:24): [True: 112k, False: 11.9M]
  ------------------
  126|   199k|	comment = gFalse;
  ------------------
  |  |   18|   199k|#define gFalse 0
  ------------------
  127|   108M|    } else if (c == '%') {
  ------------------
  |  Branch (127:16): [True: 200k, False: 108M]
  ------------------
  128|   200k|      comment = gTrue;
  ------------------
  |  |   17|   200k|#define gTrue 1
  ------------------
  129|   108M|    } else if (specialChars[c] != 1) {
  ------------------
  |  Branch (129:16): [True: 38.1M, False: 70.3M]
  ------------------
  130|  38.1M|      break;
  131|  38.1M|    }
  132|   120M|  }
  133|       |
  134|       |  // start reading token
  135|  38.1M|  switch (c) {
  136|       |
  137|       |  // number
  138|  4.08M|  case '0': case '1': case '2': case '3': case '4':
  ------------------
  |  Branch (138:3): [True: 2.20M, False: 35.9M]
  |  Branch (138:13): [True: 774k, False: 37.3M]
  |  Branch (138:23): [True: 653k, False: 37.5M]
  |  Branch (138:33): [True: 168k, False: 37.9M]
  |  Branch (138:43): [True: 281k, False: 37.8M]
  ------------------
  139|  5.31M|  case '5': case '6': case '7': case '8': case '9':
  ------------------
  |  Branch (139:3): [True: 151k, False: 38.0M]
  |  Branch (139:13): [True: 283k, False: 37.8M]
  |  Branch (139:23): [True: 102k, False: 38.0M]
  |  Branch (139:33): [True: 493k, False: 37.6M]
  |  Branch (139:43): [True: 203k, False: 37.9M]
  ------------------
  140|  5.77M|  case '+': case '-': case '.':
  ------------------
  |  Branch (140:3): [True: 21.4k, False: 38.1M]
  |  Branch (140:13): [True: 243k, False: 37.9M]
  |  Branch (140:23): [True: 199k, False: 37.9M]
  ------------------
  141|       |    // Adobe's number lexer has some "interesting" behavior:
  142|       |    // "--123" is interpreted as 0
  143|       |    // "--123.4" is interpreted as -123.4 [I've seen this in the wild]
  144|       |    // "50-100" is interpreted as 50 [I've seen this in the wild]
  145|       |    // "50--100" is interpreted as 50
  146|       |    // "50-100.0" is an error -- but older versions of Acrobat may
  147|       |    //   have interpreted it as 50100.0 (?)
  148|       |    // "50--100.0" is an error -- but older versions of Acrobat may
  149|       |    //   have interpreted it as 50100.0 (?)
  150|       |    // "50.0-100" is interpreted as 50.0 (or maybe 50.0100?)
  151|       |    // "50.0--100" is interpreted as 50.0 (or maybe 50.0100?)
  152|       |    // "-50-100" is interpreted as -50
  153|       |    // "-" is interpreted as 0
  154|       |    // "-." is interpreted as 0.0
  155|  5.77M|    neg = gFalse;
  ------------------
  |  |   18|  5.77M|#define gFalse 0
  ------------------
  156|  5.77M|    doubleMinus = gFalse;
  ------------------
  |  |   18|  5.77M|#define gFalse 0
  ------------------
  157|  5.77M|    xf = xi = 0;
  158|  5.77M|    if (c == '+') {
  ------------------
  |  Branch (158:9): [True: 21.4k, False: 5.75M]
  ------------------
  159|       |      // just ignore it
  160|  5.75M|    } else if (c == '-') {
  ------------------
  |  Branch (160:16): [True: 243k, False: 5.51M]
  ------------------
  161|   243k|      neg = gTrue;
  ------------------
  |  |   17|   243k|#define gTrue 1
  ------------------
  162|   243k|      if (lookChar() == '-') {
  ------------------
  |  Branch (162:11): [True: 9.92k, False: 233k]
  ------------------
  163|  9.92k|	doubleMinus = gTrue;
  ------------------
  |  |   17|  9.92k|#define gTrue 1
  ------------------
  164|  15.3k|	do {
  165|  15.3k|	  getChar();
  166|  15.3k|	} while (lookChar() == '-');
  ------------------
  |  Branch (166:11): [True: 5.40k, False: 9.92k]
  ------------------
  167|  9.92k|      }
  168|  5.51M|    } else if (c == '.') {
  ------------------
  |  Branch (168:16): [True: 199k, False: 5.31M]
  ------------------
  169|   199k|      goto doReal;
  170|  5.31M|    } else {
  171|  5.31M|      xf = xi = c - '0';
  172|  5.31M|    }
  173|  11.8M|    while (1) {
  ------------------
  |  Branch (173:12): [True: 11.8M, Folded]
  ------------------
  174|  11.8M|      c = lookChar();
  175|  11.8M|      if (isdigit(c)) {
  ------------------
  |  Branch (175:11): [True: 6.25M, False: 5.58M]
  ------------------
  176|  6.25M|	getChar();
  177|  6.25M|	xi = xi * 10 + (c - '0');
  178|  6.25M|	if (xf < 1e20) {
  ------------------
  |  Branch (178:6): [True: 5.84M, False: 411k]
  ------------------
  179|  5.84M|	  xf = xf * 10 + (c - '0');
  180|  5.84M|	}
  181|  6.25M|      } else if (c == '.') {
  ------------------
  |  Branch (181:18): [True: 317k, False: 5.26M]
  ------------------
  182|   317k|	getChar();
  183|   317k|	goto doReal;
  184|  5.26M|      } else {
  185|  5.26M|	break;
  186|  5.26M|      }
  187|  11.8M|    }
  188|  5.26M|    while ((c = lookChar()) == '-' || isdigit(c)) {
  ------------------
  |  Branch (188:12): [True: 1.61k, False: 5.26M]
  |  Branch (188:39): [True: 2.86k, False: 5.26M]
  ------------------
  189|  4.47k|      getChar();
  190|  4.47k|    }
  191|  5.26M|    if (neg) {
  ------------------
  |  Branch (191:9): [True: 238k, False: 5.02M]
  ------------------
  192|   238k|      xi = -xi;
  193|   238k|    }
  194|  5.26M|    if (doubleMinus) {
  ------------------
  |  Branch (194:9): [True: 9.92k, False: 5.25M]
  ------------------
  195|  9.92k|      xi = 0;
  196|  9.92k|    }
  197|  5.26M|    obj->initInt(xi);
  198|  5.26M|    break;
  199|   516k|  doReal:
  200|   516k|    scale = 0.1;
  201|   982k|    while (1) {
  ------------------
  |  Branch (201:12): [True: 982k, Folded]
  ------------------
  202|   982k|      c = lookChar();
  203|   982k|      if (c == '-') {
  ------------------
  |  Branch (203:11): [True: 8.57k, False: 973k]
  ------------------
  204|  8.57k|	error(errSyntaxWarning, getPos(), "Badly formatted number");
  205|  8.57k|	getChar();
  206|  8.57k|	continue;
  207|  8.57k|      }
  208|   973k|      if (!isdigit(c)) {
  ------------------
  |  Branch (208:11): [True: 516k, False: 457k]
  ------------------
  209|   516k|	break;
  210|   516k|      }
  211|   457k|      getChar();
  212|   457k|      xf = xf + scale * (c - '0');
  213|   457k|      scale *= 0.1;
  214|   457k|    }
  215|   516k|    while ((c = lookChar()) == '-' || isdigit(c)) {
  ------------------
  |  Branch (215:12): [True: 0, False: 516k]
  |  Branch (215:39): [True: 0, False: 516k]
  ------------------
  216|      0|      getChar();
  217|      0|    }
  218|   516k|    if (neg) {
  ------------------
  |  Branch (218:9): [True: 5.00k, False: 511k]
  ------------------
  219|  5.00k|      xf = -xf;
  220|  5.00k|    }
  221|   516k|    obj->initReal(xf);
  222|   516k|    break;
  223|       |
  224|       |  // string
  225|   162k|  case '(':
  ------------------
  |  Branch (225:3): [True: 162k, False: 37.9M]
  ------------------
  226|   162k|    p = tokBuf;
  227|   162k|    n = 0;
  228|   162k|    numParen = 1;
  229|   162k|    done = gFalse;
  ------------------
  |  |   18|   162k|#define gFalse 0
  ------------------
  230|   162k|    s = NULL;
  231|   245M|    do {
  232|   245M|      c2 = EOF;
  233|   245M|      switch (c = getChar()) {
  234|       |
  235|  5.77k|      case EOF:
  ------------------
  |  Branch (235:7): [True: 5.77k, False: 245M]
  ------------------
  236|  5.77k|	error(errSyntaxError, getPos(), "Unterminated string");
  237|  5.77k|	done = gTrue;
  ------------------
  |  |   17|  5.77k|#define gTrue 1
  ------------------
  238|  5.77k|	break;
  239|       |
  240|   380k|      case '(':
  ------------------
  |  Branch (240:7): [True: 380k, False: 244M]
  ------------------
  241|   380k|	++numParen;
  242|   380k|	c2 = c;
  243|   380k|	break;
  244|       |
  245|   521k|      case ')':
  ------------------
  |  Branch (245:7): [True: 521k, False: 244M]
  ------------------
  246|   521k|	if (--numParen == 0) {
  ------------------
  |  Branch (246:6): [True: 156k, False: 365k]
  ------------------
  247|   156k|	  done = gTrue;
  ------------------
  |  |   17|   156k|#define gTrue 1
  ------------------
  248|   365k|	} else {
  249|   365k|	  c2 = c;
  250|   365k|	}
  251|   521k|	break;
  252|       |
  253|  4.48M|      case '\r':
  ------------------
  |  Branch (253:7): [True: 4.48M, False: 240M]
  ------------------
  254|       |	// The PDF spec says that any literal end-of-line sequence
  255|       |	// (LF, CR, CR+LF) is translated to a single LF char.
  256|  4.48M|	c = lookChar();
  257|  4.48M|	if (c == '\n') {
  ------------------
  |  Branch (257:6): [True: 108k, False: 4.37M]
  ------------------
  258|   108k|	  getChar();
  259|   108k|	}
  260|  4.48M|	c2 = '\n';
  261|  4.48M|	break;
  262|       |
  263|   133k|      case '\\':
  ------------------
  |  Branch (263:7): [True: 133k, False: 245M]
  ------------------
  264|   133k|	switch (c = getChar()) {
  265|    453|	case 'n':
  ------------------
  |  Branch (265:2): [True: 453, False: 132k]
  ------------------
  266|    453|	  c2 = '\n';
  267|    453|	  break;
  268|  9.52k|	case 'r':
  ------------------
  |  Branch (268:2): [True: 9.52k, False: 123k]
  ------------------
  269|  9.52k|	  c2 = '\r';
  270|  9.52k|	  break;
  271|  22.2k|	case 't':
  ------------------
  |  Branch (271:2): [True: 22.2k, False: 111k]
  ------------------
  272|  22.2k|	  c2 = '\t';
  273|  22.2k|	  break;
  274|    340|	case 'b':
  ------------------
  |  Branch (274:2): [True: 340, False: 132k]
  ------------------
  275|    340|	  c2 = '\b';
  276|    340|	  break;
  277|      1|	case 'f':
  ------------------
  |  Branch (277:2): [True: 1, False: 133k]
  ------------------
  278|      1|	  c2 = '\f';
  279|      1|	  break;
  280|  1.60k|	case '\\':
  ------------------
  |  Branch (280:2): [True: 1.60k, False: 131k]
  ------------------
  281|  6.85k|	case '(':
  ------------------
  |  Branch (281:2): [True: 5.25k, False: 128k]
  ------------------
  282|  14.6k|	case ')':
  ------------------
  |  Branch (282:2): [True: 7.79k, False: 125k]
  ------------------
  283|  14.6k|	  c2 = c;
  284|  14.6k|	  break;
  285|  6.66k|	case '0': case '1': case '2': case '3':
  ------------------
  |  Branch (285:2): [True: 4.52k, False: 128k]
  |  Branch (285:12): [True: 1.38k, False: 131k]
  |  Branch (285:22): [True: 205, False: 133k]
  |  Branch (285:32): [True: 551, False: 132k]
  ------------------
  286|  28.8k|	case '4': case '5': case '6': case '7':
  ------------------
  |  Branch (286:2): [True: 4.04k, False: 129k]
  |  Branch (286:12): [True: 6.49k, False: 126k]
  |  Branch (286:22): [True: 6.15k, False: 127k]
  |  Branch (286:32): [True: 5.45k, False: 127k]
  ------------------
  287|  28.8k|	  c2 = c - '0';
  288|  28.8k|	  c = lookChar();
  289|  28.8k|	  if (c >= '0' && c <= '7') {
  ------------------
  |  Branch (289:8): [True: 13.6k, False: 15.1k]
  |  Branch (289:20): [True: 5.78k, False: 7.87k]
  ------------------
  290|  5.78k|	    getChar();
  291|  5.78k|	    c2 = (c2 << 3) + (c - '0');
  292|  5.78k|	    c = lookChar();
  293|  5.78k|	    if (c >= '0' && c <= '7') {
  ------------------
  |  Branch (293:10): [True: 1.66k, False: 4.12k]
  |  Branch (293:22): [True: 193, False: 1.46k]
  ------------------
  294|    193|	      getChar();
  295|    193|	      c2 = (c2 << 3) + (c - '0');
  296|    193|	    }
  297|  5.78k|	  }
  298|  28.8k|	  break;
  299|  1.72k|	case '\r':
  ------------------
  |  Branch (299:2): [True: 1.72k, False: 131k]
  ------------------
  300|  1.72k|	  c = lookChar();
  301|  1.72k|	  if (c == '\n') {
  ------------------
  |  Branch (301:8): [True: 1.38k, False: 334]
  ------------------
  302|  1.38k|	    getChar();
  303|  1.38k|	  }
  304|  1.72k|	  break;
  305|  7.06k|	case '\n':
  ------------------
  |  Branch (305:2): [True: 7.06k, False: 126k]
  ------------------
  306|  7.06k|	  break;
  307|    998|	case EOF:
  ------------------
  |  Branch (307:2): [True: 998, False: 132k]
  ------------------
  308|    998|	  error(errSyntaxError, getPos(), "Unterminated string");
  309|    998|	  done = gTrue;
  ------------------
  |  |   17|    998|#define gTrue 1
  ------------------
  310|    998|	  break;
  311|  47.5k|	default:
  ------------------
  |  Branch (311:2): [True: 47.5k, False: 85.7k]
  ------------------
  312|  47.5k|	  c2 = c;
  313|  47.5k|	  break;
  314|   133k|	}
  315|   133k|	break;
  316|       |
  317|   239M|      default:
  ------------------
  |  Branch (317:7): [True: 239M, False: 5.52M]
  ------------------
  318|   239M|	c2 = c;
  319|   239M|	break;
  320|   245M|      }
  321|       |
  322|   245M|      if (c2 != EOF) {
  ------------------
  |  Branch (322:11): [True: 244M, False: 171k]
  ------------------
  323|   244M|	if (n == tokBufSize) {
  ------------------
  |  |   19|   244M|#define tokBufSize 128		// size of token buffer
  ------------------
  |  Branch (323:6): [True: 1.85M, False: 243M]
  ------------------
  324|  1.85M|	  if (!s)
  ------------------
  |  Branch (324:8): [True: 54.7k, False: 1.80M]
  ------------------
  325|  54.7k|	    s = new GString(tokBuf, tokBufSize);
  ------------------
  |  |   19|  54.7k|#define tokBufSize 128		// size of token buffer
  ------------------
  326|  1.80M|	  else
  327|  1.80M|	    s->append(tokBuf, tokBufSize);
  ------------------
  |  |   19|  1.80M|#define tokBufSize 128		// size of token buffer
  ------------------
  328|  1.85M|	  p = tokBuf;
  329|  1.85M|	  n = 0;
  330|  1.85M|	}
  331|   244M|	*p++ = (char)c2;
  332|   244M|	++n;
  333|   244M|      }
  334|   245M|    } while (!done);
  ------------------
  |  Branch (334:14): [True: 244M, False: 162k]
  ------------------
  335|   162k|    if (!s)
  ------------------
  |  Branch (335:9): [True: 108k, False: 54.7k]
  ------------------
  336|   108k|      s = new GString(tokBuf, n);
  337|  54.7k|    else
  338|  54.7k|      s->append(tokBuf, n);
  339|   162k|    obj->initString(s);
  340|   162k|    break;
  341|       |
  342|       |  // name
  343|  5.52M|  case '/':
  ------------------
  |  Branch (343:3): [True: 5.52M, False: 32.6M]
  ------------------
  344|  5.52M|    p = tokBuf;
  345|  5.52M|    n = 0;
  346|  5.52M|    s = NULL;
  347|  5.52M|    invalid = gFalse;
  ------------------
  |  |   18|  5.52M|#define gFalse 0
  ------------------
  348|  20.4M|    while ((c = lookChar()) != EOF && !specialChars[c]) {
  ------------------
  |  Branch (348:12): [True: 20.4M, False: 1.66k]
  |  Branch (348:39): [True: 14.9M, False: 5.52M]
  ------------------
  349|  14.9M|      getChar();
  350|  14.9M|      if (c == '#') {
  ------------------
  |  Branch (350:11): [True: 816k, False: 14.1M]
  ------------------
  351|   816k|	c2 = lookChar();
  352|   816k|	if (c2 >= '0' && c2 <= '9') {
  ------------------
  |  Branch (352:6): [True: 400k, False: 416k]
  |  Branch (352:19): [True: 292, False: 399k]
  ------------------
  353|    292|	  c = c2 - '0';
  354|   816k|	} else if (c2 >= 'A' && c2 <= 'F') {
  ------------------
  |  Branch (354:13): [True: 399k, False: 416k]
  |  Branch (354:26): [True: 46.4k, False: 353k]
  ------------------
  355|  46.4k|	  c = c2 - 'A' + 10;
  356|   769k|	} else if (c2 >= 'a' && c2 <= 'f') {
  ------------------
  |  Branch (356:13): [True: 353k, False: 416k]
  |  Branch (356:26): [True: 95.6k, False: 257k]
  ------------------
  357|  95.6k|	  c = c2 - 'a' + 10;
  358|   674k|	} else {
  359|   674k|	  error(errSyntaxError, getPos(), "Invalid hex escape in name");
  360|   674k|	  goto notEscChar;
  361|   674k|	}
  362|   142k|	getChar();
  363|   142k|	c2 = lookChar();
  364|   142k|	if (c2 >= '0' && c2 <= '9') {
  ------------------
  |  Branch (364:6): [True: 142k, False: 114]
  |  Branch (364:19): [True: 26.2k, False: 115k]
  ------------------
  365|  26.2k|	  c = (c << 4) + (c2 - '0');
  366|   116k|	} else if (c2 >= 'A' && c2 <= 'F') {
  ------------------
  |  Branch (366:13): [True: 93.3k, False: 22.7k]
  |  Branch (366:26): [True: 46.3k, False: 47.0k]
  ------------------
  367|  46.3k|	  c = (c << 4) + (c2 - 'A' + 10);
  368|  69.7k|	} else if (c2 >= 'a' && c2 <= 'f') {
  ------------------
  |  Branch (368:13): [True: 715, False: 69.0k]
  |  Branch (368:26): [True: 219, False: 496]
  ------------------
  369|    219|	  c = (c << 4) + (c2 - 'a' + 10);
  370|  69.5k|	} else {
  371|  69.5k|	  error(errSyntaxError, getPos(), "Invalid hex escape in name");
  372|  69.5k|	  goto notEscChar;
  373|  69.5k|	}
  374|  72.7k|	getChar();
  375|  72.7k|	if (c == 0) {
  ------------------
  |  Branch (375:6): [True: 72, False: 72.7k]
  ------------------
  376|     72|	  invalid = gTrue;
  ------------------
  |  |   17|     72|#define gTrue 1
  ------------------
  377|     72|	}
  378|  72.7k|      }
  379|  14.9M|     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.9M|      ++n;
  384|  14.9M|      if (n < tokBufSize) {
  ------------------
  |  |   19|  14.9M|#define tokBufSize 128		// size of token buffer
  ------------------
  |  Branch (384:11): [True: 14.7M, False: 159k]
  ------------------
  385|  14.7M|	*p++ = (char)c;
  386|  14.7M|      } else if (n == tokBufSize) {
  ------------------
  |  |   19|   159k|#define tokBufSize 128		// size of token buffer
  ------------------
  |  Branch (386:18): [True: 791, False: 158k]
  ------------------
  387|    791|	*p = (char)c;
  388|    791|	s = new GString(tokBuf, n);
  389|   158k|      } else {
  390|   158k|	s->append((char)c);
  391|   158k|      }
  392|  14.9M|    }
  393|  5.52M|    if (invalid) {
  ------------------
  |  Branch (393:9): [True: 72, False: 5.52M]
  ------------------
  394|     72|      error(errSyntaxError, getPos(), "Null character in name");
  395|     72|      obj->initError();
  396|     72|      if (s) {
  ------------------
  |  Branch (396:11): [True: 0, False: 72]
  ------------------
  397|      0|	delete s;
  398|      0|      }
  399|  5.52M|    } else if (n < tokBufSize) {
  ------------------
  |  |   19|  5.52M|#define tokBufSize 128		// size of token buffer
  ------------------
  |  Branch (399:16): [True: 5.52M, False: 791]
  ------------------
  400|  5.52M|      *p = '\0';
  401|  5.52M|      obj->initName(tokBuf);
  402|  5.52M|    } else {
  403|    791|      obj->initName(s->getCString());
  404|    791|      delete s;
  405|    791|    }
  406|  5.52M|    break;
  407|       |
  408|       |  // array punctuation
  409|  4.88M|  case '[':
  ------------------
  |  Branch (409:3): [True: 4.88M, False: 33.2M]
  ------------------
  410|  5.28M|  case ']':
  ------------------
  |  Branch (410:3): [True: 399k, False: 37.7M]
  ------------------
  411|  5.28M|    tokBuf[0] = (char)c;
  412|  5.28M|    tokBuf[1] = '\0';
  413|  5.28M|    obj->initCmd(tokBuf);
  414|  5.28M|    break;
  415|       |
  416|       |  // hex string or dict punctuation
  417|  3.65M|  case '<':
  ------------------
  |  Branch (417:3): [True: 3.65M, False: 34.4M]
  ------------------
  418|  3.65M|    c = lookChar();
  419|       |
  420|       |    // dict punctuation
  421|  3.65M|    if (c == '<') {
  ------------------
  |  Branch (421:9): [True: 2.96M, False: 689k]
  ------------------
  422|  2.96M|      getChar();
  423|  2.96M|      tokBuf[0] = tokBuf[1] = '<';
  424|  2.96M|      tokBuf[2] = '\0';
  425|  2.96M|      obj->initCmd(tokBuf);
  426|       |
  427|       |    // hex string
  428|  2.96M|    } else {
  429|   689k|      p = tokBuf;
  430|   689k|      m = n = 0;
  431|   689k|      c2 = 0;
  432|   689k|      s = NULL;
  433|   689k|      nErrors = 0;
  434|  47.2M|      while (nErrors < 100) {
  ------------------
  |  Branch (434:14): [True: 47.0M, False: 147k]
  ------------------
  435|  47.0M|	c = getChar();
  436|  47.0M|	if (c == '>') {
  ------------------
  |  Branch (436:6): [True: 539k, False: 46.5M]
  ------------------
  437|   539k|	  break;
  438|  46.5M|	} else if (c == EOF) {
  ------------------
  |  Branch (438:13): [True: 1.46k, False: 46.5M]
  ------------------
  439|  1.46k|	  error(errSyntaxError, getPos(), "Unterminated hex string");
  440|  1.46k|	  break;
  441|  46.5M|	} else if (specialChars[c] != 1) {
  ------------------
  |  Branch (441:13): [True: 41.5M, False: 4.98M]
  ------------------
  442|  41.5M|	  c2 = c2 << 4;
  443|  41.5M|	  if (c >= '0' && c <= '9') {
  ------------------
  |  Branch (443:8): [True: 37.3M, False: 4.23M]
  |  Branch (443:20): [True: 4.31M, False: 32.9M]
  ------------------
  444|  4.31M|	    c2 += c - '0';
  445|  37.2M|	  } else if (c >= 'A' && c <= 'F') {
  ------------------
  |  Branch (445:15): [True: 29.2M, False: 7.97M]
  |  Branch (445:27): [True: 546k, False: 28.7M]
  ------------------
  446|   546k|	    c2 += c - 'A' + 10;
  447|  36.6M|	  } else if (c >= 'a' && c <= 'f') {
  ------------------
  |  Branch (447:15): [True: 26.3M, False: 10.3M]
  |  Branch (447:27): [True: 5.86M, False: 20.4M]
  ------------------
  448|  5.86M|	    c2 += c - 'a' + 10;
  449|  30.8M|	  } else {
  450|  30.8M|	    error(errSyntaxError, getPos(),
  451|  30.8M|		  "Illegal character <{0:02x}> in hex string", c);
  452|  30.8M|	    ++nErrors;
  453|  30.8M|	  }
  454|  41.5M|	  if (++m == 2) {
  ------------------
  |  Branch (454:8): [True: 20.6M, False: 20.9M]
  ------------------
  455|  20.6M|	    if (n == tokBufSize) {
  ------------------
  |  |   19|  20.6M|#define tokBufSize 128		// size of token buffer
  ------------------
  |  Branch (455:10): [True: 2.27k, False: 20.6M]
  ------------------
  456|  2.27k|	      if (!s)
  ------------------
  |  Branch (456:12): [True: 881, False: 1.39k]
  ------------------
  457|    881|		s = new GString(tokBuf, tokBufSize);
  ------------------
  |  |   19|    881|#define tokBufSize 128		// size of token buffer
  ------------------
  458|  1.39k|	      else
  459|  1.39k|		s->append(tokBuf, tokBufSize);
  ------------------
  |  |   19|  1.39k|#define tokBufSize 128		// size of token buffer
  ------------------
  460|  2.27k|	      p = tokBuf;
  461|  2.27k|	      n = 0;
  462|  2.27k|	    }
  463|  20.6M|	    *p++ = (char)c2;
  464|  20.6M|	    ++n;
  465|  20.6M|	    c2 = 0;
  466|  20.6M|	    m = 0;
  467|  20.6M|	  }
  468|  41.5M|	}
  469|  47.0M|      }
  470|   689k|      if (!s)
  ------------------
  |  Branch (470:11): [True: 688k, False: 881]
  ------------------
  471|   688k|	s = new GString(tokBuf, n);
  472|    881|      else
  473|    881|	s->append(tokBuf, n);
  474|   689k|      if (m == 1)
  ------------------
  |  Branch (474:11): [True: 317k, False: 371k]
  ------------------
  475|   317k|	s->append((char)(c2 << 4));
  476|   689k|      obj->initString(s);
  477|   689k|    }
  478|  3.65M|    break;
  479|       |
  480|       |  // dict punctuation
  481|  2.60M|  case '>':
  ------------------
  |  Branch (481:3): [True: 2.60M, False: 35.5M]
  ------------------
  482|  2.60M|    c = lookChar();
  483|  2.60M|    if (c == '>') {
  ------------------
  |  Branch (483:9): [True: 1.62M, False: 971k]
  ------------------
  484|  1.62M|      getChar();
  485|  1.62M|      tokBuf[0] = tokBuf[1] = '>';
  486|  1.62M|      tokBuf[2] = '\0';
  487|  1.62M|      obj->initCmd(tokBuf);
  488|  1.62M|    } else {
  489|   971k|      error(errSyntaxError, getPos(), "Illegal character '>'");
  490|   971k|      obj->initError();
  491|   971k|    }
  492|  2.60M|    break;
  493|       |
  494|       |  // error
  495|   702k|  case ')':
  ------------------
  |  Branch (495:3): [True: 702k, False: 37.4M]
  ------------------
  496|   860k|  case '{':
  ------------------
  |  Branch (496:3): [True: 158k, False: 37.9M]
  ------------------
  497|   942k|  case '}':
  ------------------
  |  Branch (497:3): [True: 82.3k, False: 38.0M]
  ------------------
  498|   942k|    error(errSyntaxError, getPos(), "Illegal character '{0:c}'", c);
  499|   942k|    obj->initError();
  500|   942k|    break;
  501|       |
  502|       |  // command
  503|  14.2M|  default:
  ------------------
  |  Branch (503:3): [True: 14.2M, False: 23.9M]
  ------------------
  504|  14.2M|    p = tokBuf;
  505|  14.2M|    *p++ = (char)c;
  506|  14.2M|    n = 1;
  507|   138M|    while ((c = lookChar()) != EOF && !specialChars[c]) {
  ------------------
  |  Branch (507:12): [True: 138M, False: 11.3k]
  |  Branch (507:39): [True: 124M, False: 13.7M]
  ------------------
  508|   124M|      getChar();
  509|   124M|      if (++n == tokBufSize) {
  ------------------
  |  |   19|   124M|#define tokBufSize 128		// size of token buffer
  ------------------
  |  Branch (509:11): [True: 451k, False: 123M]
  ------------------
  510|   451k|	error(errSyntaxError, getPos(), "Command token too long");
  511|   451k|	break;
  512|   451k|      }
  513|   123M|      *p++ = (char)c;
  514|   123M|    }
  515|  14.2M|    *p = '\0';
  516|  14.2M|    if (tokBuf[0] == 't' && !strcmp(tokBuf, "true")) {
  ------------------
  |  Branch (516:9): [True: 1.90M, False: 12.2M]
  |  Branch (516:29): [True: 69.0k, False: 1.83M]
  ------------------
  517|  69.0k|      obj->initBool(gTrue);
  ------------------
  |  |   17|  69.0k|#define gTrue 1
  ------------------
  518|  14.1M|    } else if (tokBuf[0] == 'f' && !strcmp(tokBuf, "false")) {
  ------------------
  |  Branch (518:16): [True: 19.2k, False: 14.1M]
  |  Branch (518:36): [True: 501, False: 18.6k]
  ------------------
  519|    501|      obj->initBool(gFalse);
  ------------------
  |  |   18|    501|#define gFalse 0
  ------------------
  520|  14.1M|    } else if (tokBuf[0] == 'n' && !strcmp(tokBuf, "null")) {
  ------------------
  |  Branch (520:16): [True: 89.4k, False: 14.0M]
  |  Branch (520:36): [True: 116, False: 89.2k]
  ------------------
  521|    116|      obj->initNull();
  522|  14.1M|    } else {
  523|  14.1M|      obj->initCmd(tokBuf);
  524|  14.1M|    }
  525|  14.2M|    break;
  526|  38.1M|  }
  527|       |
  528|  38.1M|  return obj;
  529|  38.1M|}
_ZN5Lexer14skipToNextLineEv:
  531|  59.7k|void Lexer::skipToNextLine() {
  532|  59.7k|  int c;
  533|       |
  534|   126k|  while (1) {
  ------------------
  |  Branch (534:10): [True: 126k, Folded]
  ------------------
  535|   126k|    c = getChar();
  536|   126k|    if (c == EOF || c == '\n') {
  ------------------
  |  Branch (536:9): [True: 925, False: 125k]
  |  Branch (536:21): [True: 11.6k, False: 113k]
  ------------------
  537|  12.5k|      return;
  538|  12.5k|    }
  539|   113k|    if (c == '\r') {
  ------------------
  |  Branch (539:9): [True: 47.1k, False: 66.5k]
  ------------------
  540|  47.1k|      if ((c = lookChar()) == '\n') {
  ------------------
  |  Branch (540:11): [True: 42.9k, False: 4.22k]
  ------------------
  541|  42.9k|	getChar();
  542|  42.9k|      }
  543|  47.1k|      return;
  544|  47.1k|    }
  545|   113k|  }
  546|  59.7k|}
_ZN5Lexer9skipToEOFEv:
  548|  28.2k|void Lexer::skipToEOF() {
  549|  1.57M|  while (getChar() != EOF) ;
  ------------------
  |  Branch (549:10): [True: 1.55M, False: 28.2k]
  ------------------
  550|  28.2k|}
_ZN5Lexer7isSpaceEi:
  552|  31.5M|GBool Lexer::isSpace(int c) {
  553|  31.5M|  return c >= 0 && c <= 0xff && specialChars[c] == 1;
  ------------------
  |  Branch (553:10): [True: 31.5M, False: 2.80k]
  |  Branch (553:20): [True: 31.5M, False: 0]
  |  Branch (553:33): [True: 5.19M, False: 26.3M]
  ------------------
  554|  31.5M|}

_ZN5Lexer8skipCharEv:
   49|   283k|  void skipChar() { getChar(); }
_ZN5Lexer9getStreamEv:
   56|   236k|    { return curStr.isNone() ? (Stream *)NULL : curStr.getStream(); }
  ------------------
  |  Branch (56:14): [True: 925, False: 235k]
  ------------------
_ZN5Lexer6getPosEv:
   60|  46.5M|    { return curStr.isNone() ? -1 : curStr.streamGetPos(); }
  ------------------
  |  Branch (60:14): [True: 338k, False: 46.2M]
  ------------------
_ZN5Lexer6setPosEli:
   64|  53.7k|    { if (!curStr.isNone()) curStr.streamSetPos(pos, dir); }
  ------------------
  |  Branch (64:11): [True: 53.7k, False: 0]
  ------------------

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

_ZN10LinkActionD2Ev:
   41|     82|  virtual ~LinkAction() {}
_ZN8LinkDest4isOkEv:
   85|      7|  GBool isOk() { return ok; }
_ZN8LinkGoTo4isOkEv:
  135|      7|  virtual GBool isOk() { return dest || namedDest; }
  ------------------
  |  Branch (135:33): [True: 6, False: 1]
  |  Branch (135:41): [True: 0, False: 1]
  ------------------
_ZN7LinkURI4isOkEv:
  223|     61|  virtual GBool isOk() { return uri != NULL; }
_ZN14LinkJavaScript4isOkEv:
  296|      6|  virtual GBool isOk() { return js != NULL; }
_ZN11LinkUnknown4isOkEv:
  373|      8|  virtual GBool isOk() { return action != NULL; }

_ZN14NameToCharCodeC2Ev:
   25|  4.79k|NameToCharCode::NameToCharCode() {
   26|  4.79k|  int i;
   27|       |
   28|  4.79k|  size = 31;
   29|  4.79k|  len = 0;
   30|  4.79k|  tab = (NameToCharCodeEntry *)gmallocn(size, sizeof(NameToCharCodeEntry));
   31|   153k|  for (i = 0; i < size; ++i) {
  ------------------
  |  Branch (31:15): [True: 148k, False: 4.79k]
  ------------------
   32|       |    tab[i].name = NULL;
   33|   148k|  }
   34|  4.79k|}
_ZN14NameToCharCodeD2Ev:
   36|  4.79k|NameToCharCode::~NameToCharCode() {
   37|  4.79k|  int i;
   38|       |
   39|  40.4M|  for (i = 0; i < size; ++i) {
  ------------------
  |  Branch (39:15): [True: 40.4M, False: 4.79k]
  ------------------
   40|  40.4M|    if (tab[i].name) {
  ------------------
  |  Branch (40:9): [True: 10.7M, False: 29.7M]
  ------------------
   41|  10.7M|      gfree(tab[i].name);
   42|  10.7M|    }
   43|  40.4M|  }
   44|  4.79k|  gfree(tab);
   45|  4.79k|}
_ZN14NameToCharCode3addEPKcj:
   47|  10.7M|void NameToCharCode::add(const char *name, CharCode c) {
   48|  10.7M|  NameToCharCodeEntry *oldTab;
   49|  10.7M|  int h, i, oldSize;
   50|       |
   51|       |  // expand the table if necessary
   52|  10.7M|  if (len >= size / 2) {
  ------------------
  |  Branch (52:7): [True: 31.1k, False: 10.6M]
  ------------------
   53|  31.1k|    oldSize = size;
   54|  31.1k|    oldTab = tab;
   55|  31.1k|    size = 2*size + 1;
   56|  31.1k|    tab = (NameToCharCodeEntry *)gmallocn(size, sizeof(NameToCharCodeEntry));
   57|  80.6M|    for (h = 0; h < size; ++h) {
  ------------------
  |  Branch (57:17): [True: 80.6M, False: 31.1k]
  ------------------
   58|  80.6M|      tab[h].name = NULL;
   59|  80.6M|    }
   60|  40.3M|    for (i = 0; i < oldSize; ++i) {
  ------------------
  |  Branch (60:17): [True: 40.3M, False: 31.1k]
  ------------------
   61|  40.3M|      if (oldTab[i].name) {
  ------------------
  |  Branch (61:11): [True: 20.1M, False: 20.1M]
  ------------------
   62|  20.1M|	h = hash(oldTab[i].name);
   63|  29.4M|	while (tab[h].name) {
  ------------------
  |  Branch (63:9): [True: 9.28M, False: 20.1M]
  ------------------
   64|  9.28M|	  if (++h == size) {
  ------------------
  |  Branch (64:8): [True: 0, False: 9.28M]
  ------------------
   65|      0|	    h = 0;
   66|      0|	  }
   67|  9.28M|	}
   68|  20.1M|	tab[h] = oldTab[i];
   69|  20.1M|      }
   70|  40.3M|    }
   71|  31.1k|    gfree(oldTab);
   72|  31.1k|  }
   73|       |
   74|       |  // add the new name
   75|  10.7M|  h = hash(name);
   76|  44.4M|  while (tab[h].name && strcmp(tab[h].name, name)) {
  ------------------
  |  Branch (76:10): [True: 33.7M, False: 10.7M]
  |  Branch (76:25): [True: 33.7M, False: 2.39k]
  ------------------
   77|  33.7M|    if (++h == size) {
  ------------------
  |  Branch (77:9): [True: 7.19k, False: 33.7M]
  ------------------
   78|  7.19k|      h = 0;
   79|  7.19k|    }
   80|  33.7M|  }
   81|  10.7M|  if (!tab[h].name) {
  ------------------
  |  Branch (81:7): [True: 10.7M, False: 2.39k]
  ------------------
   82|  10.7M|    tab[h].name = copyString(name);
   83|  10.7M|  }
   84|  10.7M|  tab[h].c = c;
   85|       |
   86|  10.7M|  ++len;
   87|  10.7M|}
_ZN14NameToCharCode4hashEPKc:
  104|  30.8M|int NameToCharCode::hash(const char *name) {
  105|  30.8M|  const char *p;
  106|  30.8M|  unsigned int h;
  107|       |
  108|  30.8M|  h = 0;
  109|   362M|  for (p = name; *p; ++p) {
  ------------------
  |  Branch (109:18): [True: 331M, False: 30.8M]
  ------------------
  110|   331M|    h = 17 * h + (int)(*p & 0xff);
  111|   331M|  }
  112|  30.8M|  return (int)(h % size);
  113|  30.8M|}

_ZN6Object9initArrayEP4XRef:
   51|   563k|Object *Object::initArray(XRef *xref) {
   52|   563k|  initObj(objArray);
  ------------------
  |  |   77|   563k|#define initObj(t) type = t
  ------------------
   53|   563k|  array = new Array(xref);
   54|   563k|  return this;
   55|   563k|}
_ZN6Object8initDictEP4XRef:
   57|   478k|Object *Object::initDict(XRef *xref) {
   58|   478k|  initObj(objDict);
  ------------------
  |  |   77|   478k|#define initObj(t) type = t
  ------------------
   59|   478k|  dict = new Dict(xref);
   60|   478k|  return this;
   61|   478k|}
_ZN6Object8initDictEP4Dict:
   63|  2.93k|Object *Object::initDict(Dict *dictA) {
   64|  2.93k|  initObj(objDict);
  ------------------
  |  |   77|  2.93k|#define initObj(t) type = t
  ------------------
   65|  2.93k|  dict = dictA;
   66|  2.93k|  dict->incRef();
   67|  2.93k|  return this;
   68|  2.93k|}
_ZN6Object10initStreamEP6Stream:
   70|   288k|Object *Object::initStream(Stream *streamA) {
   71|   288k|  initObj(objStream);
  ------------------
  |  |   77|   288k|#define initObj(t) type = t
  ------------------
   72|   288k|  stream = streamA;
   73|   288k|  return this;
   74|   288k|}
_ZN6Object4copyEPS_:
   76|  89.7M|Object *Object::copy(Object *obj) {
   77|  89.7M|  *obj = *this;
   78|  89.7M|  switch (type) {
   79|   484k|  case objString:
  ------------------
  |  Branch (79:3): [True: 484k, False: 89.2M]
  ------------------
   80|   484k|    obj->string = string->copy();
   81|   484k|    break;
   82|  4.00M|  case objName:
  ------------------
  |  Branch (82:3): [True: 4.00M, False: 85.7M]
  ------------------
   83|  4.00M|    obj->name = copyString(name);
   84|  4.00M|    break;
   85|   148k|  case objArray:
  ------------------
  |  Branch (85:3): [True: 148k, False: 89.5M]
  ------------------
   86|   148k|    array->incRef();
   87|   148k|    break;
   88|   724k|  case objDict:
  ------------------
  |  Branch (88:3): [True: 724k, False: 88.9M]
  ------------------
   89|   724k|    dict->incRef();
   90|   724k|    break;
   91|   495k|  case objStream:
  ------------------
  |  Branch (91:3): [True: 495k, False: 89.2M]
  ------------------
   92|   495k|    obj->stream = stream->copy();
   93|   495k|    break;
   94|  13.2M|  case objCmd:
  ------------------
  |  Branch (94:3): [True: 13.2M, False: 76.5M]
  ------------------
   95|  13.2M|    obj->cmd = copyString(cmd);
   96|  13.2M|    break;
   97|  70.6M|  default:
  ------------------
  |  Branch (97:3): [True: 70.6M, False: 19.0M]
  ------------------
   98|  70.6M|    break;
   99|  89.7M|  }
  100|       |#ifdef DEBUG_OBJECT_MEM
  101|       |#if MULTITHREADED
  102|       |  gAtomicIncrement(&numAlloc[type]);
  103|       |#else
  104|       |  ++numAlloc[type];
  105|       |#endif
  106|       |#endif
  107|  89.7M|  return obj;
  108|  89.7M|}
_ZN6Object5fetchEP4XRefPS_i:
  110|  1.42M|Object *Object::fetch(XRef *xref, Object *obj, int recursion) {
  111|  1.42M|  return (type == objRef && xref) ?
  ------------------
  |  Branch (111:11): [True: 295k, False: 1.12M]
  |  Branch (111:29): [True: 295k, False: 0]
  ------------------
  112|  1.12M|         xref->fetch(ref.num, ref.gen, obj, recursion) : copy(obj);
  113|  1.42M|}
_ZN6Object4freeEv:
  115|   234M|void Object::free() {
  116|   234M|  switch (type) {
  117|  1.35M|  case objString:
  ------------------
  |  Branch (117:3): [True: 1.35M, False: 233M]
  ------------------
  118|  1.35M|    delete string;
  119|  1.35M|    break;
  120|  9.52M|  case objName:
  ------------------
  |  Branch (120:3): [True: 9.52M, False: 225M]
  ------------------
  121|  9.52M|    gfree(name);
  122|  9.52M|    break;
  123|   712k|  case objArray:
  ------------------
  |  Branch (123:3): [True: 712k, False: 234M]
  ------------------
  124|   712k|    if (!array->decRef()) {
  ------------------
  |  Branch (124:9): [True: 563k, False: 148k]
  ------------------
  125|   563k|      delete array;
  126|   563k|    }
  127|   712k|    break;
  128|  1.20M|  case objDict:
  ------------------
  |  Branch (128:3): [True: 1.20M, False: 233M]
  ------------------
  129|  1.20M|    if (!dict->decRef()) {
  ------------------
  |  Branch (129:9): [True: 478k, False: 727k]
  ------------------
  130|   478k|      delete dict;
  131|   478k|    }
  132|  1.20M|    break;
  133|   784k|  case objStream:
  ------------------
  |  Branch (133:3): [True: 784k, False: 233M]
  ------------------
  134|   784k|    delete stream;
  135|   784k|    break;
  136|  37.2M|  case objCmd:
  ------------------
  |  Branch (136:3): [True: 37.2M, False: 197M]
  ------------------
  137|  37.2M|    gfree(cmd);
  138|  37.2M|    break;
  139|   183M|  default:
  ------------------
  |  Branch (139:3): [True: 183M, False: 50.8M]
  ------------------
  140|   183M|    break;
  141|   234M|  }
  142|       |#ifdef DEBUG_OBJECT_MEM
  143|       |#if MULTITHREADED
  144|       |  gAtomicDecrement(&numAlloc[type]);
  145|       |#else
  146|       |  --numAlloc[type];
  147|       |#endif
  148|       |#endif
  149|   234M|  type = objNone;
  150|   234M|}
_ZN6Object11getTypeNameEv:
  152|   174k|const char *Object::getTypeName() {
  153|   174k|  return objTypeNames[type];
  154|   174k|}

_ZN6ObjectC2Ev:
   85|   228M|    type(objNone) {}
_ZN6Object8initNullEv:
   99|  33.6M|    { initObj(objNull); return this; }
  ------------------
  |  |   77|  33.6M|#define initObj(t) type = t
  ------------------
_ZN6Object8isStreamEv:
  134|  32.4M|  GBool isStream() { return type == objStream; }
_ZN6Object9getStreamEv:
  158|   430k|  Stream *getStream() { return stream; }
_ZN6Object8initBoolEi:
   89|  69.5k|    { initObj(objBool); booln = boolnA; return this; }
  ------------------
  |  |   77|  69.5k|#define initObj(t) type = t
  ------------------
_ZN6Object7initIntEi:
   91|  8.39M|    { initObj(objInt); intg = intgA; return this; }
  ------------------
  |  |   77|  8.39M|#define initObj(t) type = t
  ------------------
_ZN6Object8initRealEd:
   93|   516k|    { initObj(objReal); real = realA; return this; }
  ------------------
  |  |   77|   516k|#define initObj(t) type = t
  ------------------
_ZN6Object10initStringEP7GString:
   95|   869k|    { initObj(objString); string = stringA; return this; }
  ------------------
  |  |   77|   869k|#define initObj(t) type = t
  ------------------
_ZN6Object8initNameEPKc:
   97|  5.52M|    { initObj(objName); name = copyString(nameA); return this; }
  ------------------
  |  |   77|  5.52M|#define initObj(t) type = t
  ------------------
_ZN6Object7initRefEii:
  105|   423k|    { initObj(objRef); ref.num = numA; ref.gen = genA; return this; }
  ------------------
  |  |   77|   423k|#define initObj(t) type = t
  ------------------
_ZN6Object7initCmdEPc:
  107|  24.0M|    { initObj(objCmd); cmd = copyString(cmdA); return this; }
  ------------------
  |  |   77|  24.0M|#define initObj(t) type = t
  ------------------
_ZN6Object9initErrorEv:
  109|  1.91M|    { initObj(objError); return this; }
  ------------------
  |  |   77|  1.91M|#define initObj(t) type = t
  ------------------
_ZN6Object7initEOFEv:
  111|  68.1M|    { initObj(objEOF); return this; }
  ------------------
  |  |   77|  68.1M|#define initObj(t) type = t
  ------------------
_ZN6Object6isBoolEv:
  125|  5.84k|  GBool isBool() { return type == objBool; }
_ZN6Object5isIntEv:
  126|   128M|  GBool isInt() { return type == objInt; }
_ZN6Object5isNumEv:
  128|  19.9k|  GBool isNum() { return type == objInt || type == objReal; }
  ------------------
  |  Branch (128:26): [True: 489, False: 19.4k]
  |  Branch (128:44): [True: 4.69k, False: 14.7k]
  ------------------
_ZN6Object8isStringEv:
  129|  85.8M|  GBool isString() { return type == objString; }
_ZN6Object6isNameEv:
  130|  14.3M|  GBool isName() { return type == objName; }
_ZN6Object6isNullEv:
  131|   170k|  GBool isNull() { return type == objNull; }
_ZN6Object7isArrayEv:
  132|   766k|  GBool isArray() { return type == objArray; }
_ZN6Object6isDictEv:
  133|   539k|  GBool isDict() { return type == objDict; }
_ZN6Object5isRefEv:
  135|  1.48M|  GBool isRef() { return type == objRef; }
_ZN6Object7isErrorEv:
  137|  1.94M|  GBool isError() { return type == objError; }
_ZN6Object5isEOFEv:
  138|  36.1M|  GBool isEOF() { return type == objEOF; }
_ZN6Object6isNoneEv:
  139|   870M|  GBool isNone() { return type == objNone; }
_ZN6Object6isNameEPKc:
  143|   288k|    { return type == objName && !strcmp(name, nameA); }
  ------------------
  |  Branch (143:14): [True: 263k, False: 24.9k]
  |  Branch (143:33): [True: 125k, False: 138k]
  ------------------
_ZN6Object5isCmdEPKc:
  147|   157M|    { return type == objCmd && !strcmp(cmd, cmdA); }
  ------------------
  |  Branch (147:14): [True: 53.9M, False: 103M]
  |  Branch (147:32): [True: 2.53M, False: 51.4M]
  ------------------
_ZN6Object7getBoolEv:
  150|    668|  GBool getBool() { return booln; }
_ZN6Object6getIntEv:
  151|  4.55M|  int getInt() { return intg; }
_ZN6Object6getNumEv:
  153|  5.18k|  double getNum() { return type == objInt ? (double)intg : real; }
  ------------------
  |  Branch (153:28): [True: 489, False: 4.69k]
  ------------------
_ZN6Object9getStringEv:
  154|  71.6k|  GString *getString() { return string; }
_ZN6Object7getNameEv:
  155|  1.99M|  char *getName() { return name; }
_ZN6Object8getArrayEv:
  156|      7|  Array *getArray() { return array; }
_ZN6Object7getDictEv:
  157|   457k|  Dict *getDict() { return dict; }
_ZN6Object6getRefEv:
  159|  48.4k|  Ref getRef() { return ref; }
_ZN6Object9getRefNumEv:
  160|   243k|  int getRefNum() { return ref.num; }
_ZN6Object9getRefGenEv:
  161|  33.2k|  int getRefGen() { return ref.gen; }
_ZN6Object14arrayGetLengthEv:
  233|  1.38M|  { return array->getLength(); }
_ZN6Object8arrayAddEPS_:
  236|  18.6M|  { array->add(elem); }
_ZN6Object8arrayGetEiPS_i:
  239|   113k|  { return array->get(i, obj, recursion); }
_ZN6Object10arrayGetNFEiPS_:
  242|  1.21M|  { return array->getNF(i, obj); }
_ZN6Object7dictAddEPcPS_:
  254|  1.91M|  { dict->add(key, val); }
_ZN6Object10dictLookupEPKcPS_i:
  263|   384k|  { return dict->lookup(key, obj, recursion); }
_ZN6Object12dictLookupNFEPKcPS_:
  266|  33.2k|  { return dict->lookupNF(key, obj); }
_ZN6Object11streamResetEv:
  290|   241k|  { stream->reset(); }
_ZN6Object11streamCloseEv:
  293|   238k|  { stream->close(); }
_ZN6Object13streamGetCharEv:
  296|   566M|  { return stream->getChar(); }
_ZN6Object14streamLookCharEv:
  299|   189M|  { return stream->lookChar(); }
_ZN6Object12streamGetPosEv:
  308|  46.2M|  { return stream->getPos(); }
_ZN6Object12streamSetPosEli:
  311|  53.7k|  { stream->setPos(pos, dir); }
_ZN6Object13streamGetDictEv:
  314|   411k|  { return stream->getDict(); }

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

_ZN20OptionalContentGroup8setStateEi:
   83|    582|  void setState(GBool stateA) { state = stateA; }
_ZN20OptionalContentGroup21getInViewUsageAppDictEv:
   84|    562|  GBool getInViewUsageAppDict() { return inViewUsageAppDict; }

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

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

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

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

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

_ZN6ParserC2EP4XRefP5Lexeri:
   22|   231k|Parser::Parser(XRef *xrefA, Lexer *lexerA, GBool allowStreamsA) {
   23|   231k|  xref = xrefA;
   24|   231k|  lexer = lexerA;
   25|   231k|  inlineImg = 0;
   26|   231k|  allowStreams = allowStreamsA;
   27|   231k|  lexer->getObj(&buf1);
   28|   231k|  lexer->getObj(&buf2);
   29|   231k|}
_ZN6ParserD2Ev:
   31|   231k|Parser::~Parser() {
   32|   231k|  buf1.free();
   33|   231k|  buf2.free();
   34|   231k|  delete lexer;
   35|   231k|}
_ZN6Parser6getObjEP6ObjectiPh14CryptAlgorithmiiii:
   40|  90.2M|		       int objNum, int objGen, int recursion) {
   41|  90.2M|  char *key;
   42|  90.2M|  Stream *str;
   43|  90.2M|  Object obj2;
   44|  90.2M|  int num;
   45|  90.2M|  DecryptStream *decrypt;
   46|  90.2M|  GString *s, *s2;
   47|  90.2M|  int c;
   48|       |
   49|       |  // refill buffer after inline image data
   50|  90.2M|  if (inlineImg == 2) {
  ------------------
  |  Branch (50:7): [True: 52.7k, False: 90.2M]
  ------------------
   51|  52.7k|    buf1.free();
   52|  52.7k|    buf2.free();
   53|  52.7k|    lexer->getObj(&buf1);
   54|  52.7k|    lexer->getObj(&buf2);
   55|  52.7k|    inlineImg = 0;
   56|  52.7k|  }
   57|       |
   58|       |  // array
   59|  90.2M|  if (!simpleOnly && recursion < objectRecursionLimit && buf1.isCmd("[")) {
  ------------------
  |  |   20|   110M|#define objectRecursionLimit 500
  ------------------
  |  Branch (59:7): [True: 20.6M, False: 69.6M]
  |  Branch (59:22): [True: 8.41M, False: 12.2M]
  |  Branch (59:58): [True: 563k, False: 7.85M]
  ------------------
   60|   563k|    shift();
   61|   563k|    obj->initArray(xref);
   62|  19.1M|    while (!buf1.isCmd("]") && !buf1.isEOF())
  ------------------
  |  Branch (62:12): [True: 18.9M, False: 256k]
  |  Branch (62:32): [True: 18.6M, False: 307k]
  ------------------
   63|  18.6M|      obj->arrayAdd(getObj(&obj2, gFalse, fileKey, encAlgorithm, keyLength,
  ------------------
  |  |   18|  18.6M|#define gFalse 0
  ------------------
   64|  18.6M|			   objNum, objGen, recursion + 1));
   65|   563k|    if (buf1.isEOF())
  ------------------
  |  Branch (65:9): [True: 307k, False: 256k]
  ------------------
   66|   307k|      error(errSyntaxError, getPos(), "End of file inside array");
   67|   563k|    shift();
   68|       |
   69|       |  // dictionary or stream
   70|  89.7M|  } else if (!simpleOnly && recursion < objectRecursionLimit &&
  ------------------
  |  |   20|   109M|#define objectRecursionLimit 500
  ------------------
  |  Branch (70:14): [True: 20.0M, False: 69.6M]
  |  Branch (70:29): [True: 7.85M, False: 12.2M]
  ------------------
   71|  7.85M|	     buf1.isCmd("<<")) {
  ------------------
  |  Branch (71:7): [True: 478k, False: 7.37M]
  ------------------
   72|   478k|    shift();
   73|   478k|    obj->initDict(xref);
   74|  14.6M|    while (!buf1.isCmd(">>") && !buf1.isEOF()) {
  ------------------
  |  Branch (74:12): [True: 14.2M, False: 424k]
  |  Branch (74:33): [True: 14.2M, False: 19.4k]
  ------------------
   75|  14.2M|      if (!buf1.isName()) {
  ------------------
  |  Branch (75:11): [True: 12.2M, False: 1.94M]
  ------------------
   76|  12.2M|	error(errSyntaxError, getPos(),
   77|  12.2M|	      "Dictionary key must be a name object");
   78|  12.2M|	shift();
   79|  12.2M|      } else {
   80|  1.94M|	key = copyString(buf1.getName());
   81|  1.94M|	shift();
   82|  1.94M|	if (buf1.isEOF() || buf1.isError()) {
  ------------------
  |  Branch (82:6): [True: 751, False: 1.94M]
  |  Branch (82:22): [True: 33.2k, False: 1.91M]
  ------------------
   83|  34.0k|	  gfree(key);
   84|  34.0k|	  break;
   85|  34.0k|	}
   86|  1.91M|	obj->dictAdd(key, getObj(&obj2, gFalse,
  ------------------
  |  |   18|  1.91M|#define gFalse 0
  ------------------
   87|  1.91M|				 fileKey, encAlgorithm, keyLength,
   88|  1.91M|				 objNum, objGen, recursion + 1));
   89|  1.91M|      }
   90|  14.2M|    }
   91|   478k|    if (buf1.isEOF())
  ------------------
  |  Branch (91:9): [True: 20.1k, False: 457k]
  ------------------
   92|  20.1k|      error(errSyntaxError, getPos(), "End of file inside dictionary");
   93|       |    // stream objects are not allowed inside content streams or
   94|       |    // object streams
   95|   478k|    if (allowStreams && buf2.isCmd("stream")) {
  ------------------
  |  Branch (95:9): [True: 237k, False: 240k]
  |  Branch (95:25): [True: 59.7k, False: 178k]
  ------------------
   96|  59.7k|      if ((str = makeStream(obj, fileKey, encAlgorithm, keyLength,
  ------------------
  |  Branch (96:11): [True: 56.9k, False: 2.77k]
  ------------------
   97|  59.7k|			    objNum, objGen, recursion + 1))) {
   98|  56.9k|	obj->initStream(str);
   99|  56.9k|      } else {
  100|  2.77k|	obj->free();
  101|  2.77k|	obj->initError();
  102|  2.77k|      }
  103|   418k|    } else {
  104|   418k|      shift();
  105|   418k|    }
  106|       |
  107|       |  // indirect reference or integer
  108|  89.2M|  } else if (buf1.isInt()) {
  ------------------
  |  Branch (108:14): [True: 3.53M, False: 85.7M]
  ------------------
  109|  3.53M|    num = buf1.getInt();
  110|  3.53M|    shift();
  111|  3.53M|    if (buf1.isInt() && buf2.isCmd("R")) {
  ------------------
  |  Branch (111:9): [True: 1.44M, False: 2.09M]
  |  Branch (111:25): [True: 411k, False: 1.03M]
  ------------------
  112|   411k|      int gen = buf1.getInt();
  113|   411k|      if (num >= 0 && gen >= 0) {
  ------------------
  |  Branch (113:11): [True: 409k, False: 1.82k]
  |  Branch (113:23): [True: 409k, False: 318]
  ------------------
  114|   409k|	obj->initRef(num, gen);
  115|   409k|      } else {
  116|  2.14k|	error(errSyntaxError, getPos(),
  117|  2.14k|	      "Negative number or generation in indirect reference");
  118|  2.14k|	obj->initError();
  119|  2.14k|      }
  120|   411k|      shift();
  121|   411k|      shift();
  122|  3.12M|    } else {
  123|  3.12M|      obj->initInt(num);
  124|  3.12M|    }
  125|       |
  126|       |  // string
  127|  85.7M|  } else if (buf1.isString() && fileKey) {
  ------------------
  |  Branch (127:14): [True: 426k, False: 85.2M]
  |  Branch (127:33): [True: 17.4k, False: 409k]
  ------------------
  128|  17.4k|    s = buf1.getString();
  129|  17.4k|    s2 = new GString();
  130|  17.4k|    obj2.initNull();
  131|  17.4k|    decrypt = new DecryptStream(new MemStream(s->getCString(), 0,
  132|  17.4k|					      s->getLength(), &obj2),
  133|  17.4k|				fileKey, encAlgorithm, keyLength,
  134|  17.4k|				objNum, objGen);
  135|  17.4k|    decrypt->reset();
  136|   898k|    while ((c = decrypt->getChar()) != EOF) {
  ------------------
  |  Branch (136:12): [True: 880k, False: 17.4k]
  ------------------
  137|   880k|      s2->append((char)c);
  138|   880k|    }
  139|  17.4k|    delete decrypt;
  140|  17.4k|    obj->initString(s2);
  141|  17.4k|    shift();
  142|       |
  143|       |  // simple object
  144|  85.6M|  } else {
  145|  85.6M|    buf1.copy(obj);
  146|  85.6M|    shift();
  147|  85.6M|  }
  148|       |
  149|  90.2M|  return obj;
  150|  90.2M|}
_ZN6Parser10makeStreamEP6ObjectPh14CryptAlgorithmiiii:
  154|  59.7k|			   int objNum, int objGen, int recursion) {
  155|       |  // get stream start position
  156|  59.7k|  lexer->skipToNextLine();
  157|  59.7k|  Stream *curStr = lexer->getStream();
  158|  59.7k|  if (!curStr) {
  ------------------
  |  Branch (158:7): [True: 925, False: 58.8k]
  ------------------
  159|    925|    return NULL;
  160|    925|  }
  161|  58.8k|  GFileOffset pos = curStr->getPos();
  162|       |
  163|  58.8k|  GBool haveLength = gFalse;
  ------------------
  |  |   18|  58.8k|#define gFalse 0
  ------------------
  164|  58.8k|  GFileOffset length = 0;
  165|  58.8k|  GFileOffset endPos;
  166|       |
  167|       |  // check for length in damaged file
  168|  58.8k|  if (xref && xref->getStreamEnd(pos, &endPos)) {
  ------------------
  |  Branch (168:7): [True: 58.5k, False: 222]
  |  Branch (168:15): [True: 45.0k, False: 13.5k]
  ------------------
  169|  45.0k|    length = endPos - pos;
  170|  45.0k|    haveLength = gTrue;
  ------------------
  |  |   17|  45.0k|#define gTrue 1
  ------------------
  171|       |
  172|       |  // get length from the stream object
  173|  45.0k|  } else {
  174|  13.7k|    Object obj;
  175|  13.7k|    dict->dictLookup("Length", &obj, recursion);
  176|  13.7k|    if (obj.isInt()) {
  ------------------
  |  Branch (176:9): [True: 8.68k, False: 5.08k]
  ------------------
  177|  8.68k|      length = (GFileOffset)(Guint)obj.getInt();
  178|  8.68k|      haveLength = gTrue;
  ------------------
  |  |   17|  8.68k|#define gTrue 1
  ------------------
  179|  8.68k|    } else {
  180|  5.08k|      error(errSyntaxError, getPos(),
  181|  5.08k|	    "Missing or invalid 'Length' attribute in stream");
  182|  5.08k|    }
  183|  13.7k|    obj.free();
  184|  13.7k|  }
  185|       |
  186|       |  // in badly damaged PDF files, we can run off the end of the input
  187|       |  // stream immediately after the "stream" token
  188|  58.8k|  if (!lexer->getStream()) {
  ------------------
  |  Branch (188:7): [True: 0, False: 58.8k]
  ------------------
  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|  58.8k|  BaseStream *baseStr =
  195|  58.8k|      (BaseStream *)lexer->getStream()->getBaseStream()->copy();
  196|       |
  197|       |  // 'Length' attribute is missing -- search for 'endstream'
  198|  58.8k|  if (!haveLength) {
  ------------------
  |  Branch (198:7): [True: 5.08k, False: 53.7k]
  ------------------
  199|  5.08k|    GBool foundEndstream = gFalse;
  ------------------
  |  |   18|  5.08k|#define gFalse 0
  ------------------
  200|  5.08k|    char endstreamBuf[8];
  201|  5.08k|    if ((curStr = lexer->getStream())) {
  ------------------
  |  Branch (201:9): [True: 5.08k, False: 0]
  ------------------
  202|  5.08k|      int c;
  203|  3.99M|      while ((c = curStr->getChar()) != EOF) {
  ------------------
  |  Branch (203:14): [True: 3.99M, False: 1.85k]
  ------------------
  204|  3.99M|	if (c == 'e' &&
  ------------------
  |  Branch (204:6): [True: 168k, False: 3.82M]
  ------------------
  205|   168k|	    curStr->getBlock(endstreamBuf, 8) == 8 &&
  ------------------
  |  Branch (205:6): [True: 167k, False: 1.09k]
  ------------------
  206|   167k|	    !memcmp(endstreamBuf, "ndstream", 8)) {
  ------------------
  |  Branch (206:6): [True: 3.23k, False: 164k]
  ------------------
  207|  3.23k|	  length = curStr->getPos() - 9 - pos;
  208|  3.23k|	  foundEndstream = gTrue;
  ------------------
  |  |   17|  3.23k|#define gTrue 1
  ------------------
  209|  3.23k|	  break;
  210|  3.23k|	}
  211|  3.99M|      }
  212|  5.08k|    }
  213|  5.08k|    if (!foundEndstream) {
  ------------------
  |  Branch (213:9): [True: 1.85k, False: 3.23k]
  ------------------
  214|  1.85k|      error(errSyntaxError, getPos(), "Couldn't find 'endstream' for stream");
  215|  1.85k|      delete baseStr;
  216|  1.85k|      return NULL;
  217|  1.85k|    }
  218|  5.08k|  }
  219|       |
  220|       |  // make new base stream
  221|  56.9k|  Stream *str = baseStr->makeSubStream(pos, gTrue, length, dict);
  ------------------
  |  |   17|  56.9k|#define gTrue 1
  ------------------
  222|       |
  223|       |  // look for the 'endstream' marker
  224|  56.9k|  if (haveLength) {
  ------------------
  |  Branch (224:7): [True: 53.7k, False: 3.23k]
  ------------------
  225|       |    // skip over stream data
  226|  53.7k|    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|  53.7k|    GBool foundEndstream = gFalse;
  ------------------
  |  |   18|  53.7k|#define gFalse 0
  ------------------
  235|  53.7k|    char endstreamBuf[8];
  236|  53.7k|    if ((curStr = lexer->getStream())) {
  ------------------
  |  Branch (236:9): [True: 53.7k, False: 0]
  ------------------
  237|       |      // skip up to 100 whitespace chars
  238|  53.7k|      int c;
  239|  56.1k|      for (int i = 0; i < 100; ++i) {
  ------------------
  |  Branch (239:23): [True: 56.1k, False: 5]
  ------------------
  240|  56.1k|	c = curStr->getChar();
  241|  56.1k|	if (!Lexer::isSpace(c)) {
  ------------------
  |  Branch (241:6): [True: 53.7k, False: 2.47k]
  ------------------
  242|  53.7k|	  break;
  243|  53.7k|	}
  244|  56.1k|      }
  245|  53.7k|      if (c == 'e') {
  ------------------
  |  Branch (245:11): [True: 46.8k, False: 6.85k]
  ------------------
  246|  46.8k|	if (curStr->getBlock(endstreamBuf, 8) == 8 &&
  ------------------
  |  Branch (246:6): [True: 46.6k, False: 203]
  ------------------
  247|  46.6k|	    !memcmp(endstreamBuf, "ndstream", 8)) {
  ------------------
  |  Branch (247:6): [True: 45.2k, False: 1.44k]
  ------------------
  248|  45.2k|	  foundEndstream = gTrue;
  ------------------
  |  |   17|  45.2k|#define gTrue 1
  ------------------
  249|  45.2k|	}
  250|  46.8k|      }
  251|  53.7k|    }
  252|  53.7k|    if (!foundEndstream) {
  ------------------
  |  Branch (252:9): [True: 8.50k, False: 45.2k]
  ------------------
  253|  8.50k|      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|  8.50k|      Object obj;
  258|  8.50k|      dict->copy(&obj);
  259|  8.50k|      delete str;
  260|  8.50k|      length += 5000;
  261|  8.50k|      str = baseStr->makeSubStream(pos, gTrue, length, &obj);
  ------------------
  |  |   17|  8.50k|#define gTrue 1
  ------------------
  262|  8.50k|    }
  263|  53.7k|  }
  264|       |
  265|       |  // free the copied base stream
  266|  56.9k|  delete baseStr;
  267|       |
  268|       |  // handle decryption
  269|  56.9k|  if (fileKey) {
  ------------------
  |  Branch (269:7): [True: 2.99k, False: 53.9k]
  ------------------
  270|       |    // the 'Crypt' filter is used to mark unencrypted metadata streams
  271|       |    //~ this should also check for an empty DecodeParams entry
  272|  2.99k|    GBool encrypted = gTrue;
  ------------------
  |  |   17|  2.99k|#define gTrue 1
  ------------------
  273|  2.99k|    Object obj;
  274|  2.99k|    dict->dictLookup("Filter", &obj, recursion);
  275|  2.99k|    if (obj.isName("Crypt")) {
  ------------------
  |  Branch (275:9): [True: 78, False: 2.91k]
  ------------------
  276|     78|      encrypted = gFalse;
  ------------------
  |  |   18|     78|#define gFalse 0
  ------------------
  277|  2.91k|    } else if (obj.isArray() && obj.arrayGetLength() >= 1) {
  ------------------
  |  Branch (277:16): [True: 409, False: 2.50k]
  |  Branch (277:33): [True: 362, False: 47]
  ------------------
  278|    362|      Object obj2;
  279|    362|      if (obj.arrayGet(0, &obj2)->isName("Crypt")) {
  ------------------
  |  Branch (279:11): [True: 0, False: 362]
  ------------------
  280|      0|	encrypted = gFalse;
  ------------------
  |  |   18|      0|#define gFalse 0
  ------------------
  281|      0|      }
  282|    362|      obj2.free();
  283|    362|    }
  284|  2.99k|    obj.free();
  285|  2.99k|    if (encrypted) {
  ------------------
  |  Branch (285:9): [True: 2.91k, False: 78]
  ------------------
  286|  2.91k|      str = new DecryptStream(str, fileKey, encAlgorithm, keyLength,
  287|  2.91k|			      objNum, objGen);
  288|  2.91k|    }
  289|  2.99k|  }
  290|       |
  291|       |  // get filters
  292|  56.9k|  str = str->addFilters(dict, recursion);
  293|       |
  294|  56.9k|  return str;
  295|  58.8k|}
_ZN6Parser5shiftEv:
  297|   106M|void Parser::shift() {
  298|   106M|  if (inlineImg > 0) {
  ------------------
  |  Branch (298:7): [True: 513k, False: 105M]
  ------------------
  299|   513k|    if (inlineImg < 2) {
  ------------------
  |  Branch (299:9): [True: 283k, False: 230k]
  ------------------
  300|   283k|      ++inlineImg;
  301|   283k|    } else {
  302|       |      // in a damaged content stream, if 'ID' shows up in the middle
  303|       |      // of a dictionary, we need to reset
  304|   230k|      inlineImg = 0;
  305|   230k|    }
  306|   105M|  } else if (buf2.isCmd("ID")) {
  ------------------
  |  Branch (306:14): [True: 283k, False: 105M]
  ------------------
  307|   283k|    lexer->skipChar();		// skip char after 'ID' command
  308|   283k|    inlineImg = 1;
  309|   283k|  }
  310|   106M|  buf1.free();
  311|   106M|  buf1 = buf2;
  312|   106M|  if (inlineImg > 0)		// don't buffer inline image data
  ------------------
  |  Branch (312:7): [True: 566k, False: 105M]
  ------------------
  313|   566k|    buf2.initNull();
  314|   105M|  else
  315|   105M|    lexer->getObj(&buf2);
  316|   106M|}

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

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

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

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

_ZN10BaseStream13getBaseStreamEv:
  178|  58.8k|  virtual BaseStream *getBaseStream() { return this; }
_ZN10BaseStream7getDictEv:
  180|   411k|  virtual Dict *getDict() { return dict.getDict(); }
_ZN10BaseStream11getFileNameEv:
  181|  2.39k|  virtual GString *getFileName() { return NULL; }
_ZN12FilterStream6getPosEv:
  206|  3.71M|  virtual GFileOffset getPos() { return str->getPos(); }
_ZN12FilterStream7getDictEv:
  210|   280k|  virtual Dict *getDict() { return str->getDict(); }
_ZN15StreamPredictor4isOkEv:
  277|  7.47k|  GBool isOk() { return ok; }
_ZN15StreamPredictor12getPredictorEv:
  285|  5.49k|  int getPredictor() { return predictor; }
_ZN15StreamPredictor8getWidthEv:
  286|  5.49k|  int getWidth() { return width; }
_ZN15StreamPredictor9getNCompsEv:
  287|  5.49k|  int getNComps() { return nComps; }
_ZN15StreamPredictor8getNBitsEv:
  288|  5.49k|  int getNBits() { return nBits; }
_ZN9MemStream7getCharEv:
  366|   570M|    { return (bufPtr < bufEnd) ? (*bufPtr++ & 0xff) : EOF; }
  ------------------
  |  Branch (366:14): [True: 567M, False: 2.53M]
  ------------------
_ZN9MemStream8lookCharEv:
  368|   130M|    { return (bufPtr < bufEnd) ? (*bufPtr & 0xff) : EOF; }
  ------------------
  |  Branch (368:14): [True: 130M, False: 4.36k]
  ------------------
_ZN9MemStream6getPosEv:
  370|  47.9M|  virtual GFileOffset getPos() { return (GFileOffset)(bufPtr - buf); }
_ZN9MemStream8getStartEv:
  372|  4.75k|  virtual GFileOffset getStart() { return start; }
_ZN11EmbedStream5resetEv:
  405|  31.7k|  virtual void reset() {}
_ZN11EmbedStream6getPosEv:
  409|  41.0k|  virtual GFileOffset getPos() { return str->getPos(); }
_ZN14ASCIIHexStream7getCharEv:
  434|  8.44k|    { int c = lookChar(); buf = EOF; return c; }
_ZN13ASCII85Stream7getCharEv:
  459|  2.83M|    { int ch = lookChar(); ++index; return ch; }
_ZN15RunLengthStream7getCharEv:
  538|  8.57M|    { return (bufPtr >= bufEnd && !fillBuf()) ? EOF : (*bufPtr++ & 0xff); }
  ------------------
  |  Branch (538:15): [True: 470k, False: 8.10M]
  |  Branch (538:35): [True: 232k, False: 238k]
  ------------------
_ZN15RunLengthStream8lookCharEv:
  540|  93.6k|    { return (bufPtr >= bufEnd && !fillBuf()) ? EOF : (*bufPtr & 0xff); }
  ------------------
  |  Branch (540:15): [True: 2.45k, False: 91.2k]
  |  Branch (540:35): [True: 292, False: 2.16k]
  ------------------
_ZN14CCITTFaxStream7eatBitsEi:
  609|  44.6M|  void eatBits(int n) { if ((inputBits -= n) < 0) inputBits = 0; }
  ------------------
  |  Branch (609:29): [True: 205, False: 44.6M]
  ------------------
_ZN9EOFStream5resetEv:
  873|  1.24k|  virtual void reset() {}
_ZN9EOFStream7getCharEv:
  874|    551|  virtual int getChar() { return EOF; }
_ZN9EOFStream8getBlockEPci:
  876|    265|  virtual int getBlock(char *blk, int size) { return 0; }

_ZN10TextStringC2Ev:
   21|  56.1k|TextString::TextString() {
   22|       |  u = NULL;
   23|  56.1k|  len = size = 0;
   24|  56.1k|}
_ZN10TextStringC2EP7GString:
   26|  10.2k|TextString::TextString(GString *s) {
   27|       |  u = NULL;
   28|  10.2k|  len = size = 0;
   29|  10.2k|  append(s);
   30|  10.2k|}
_ZN10TextStringC2EPS_:
   32|     40|TextString::TextString(TextString *s) {
   33|     40|  len = size = s->len;
   34|     40|  if (len) {
  ------------------
  |  Branch (34:7): [True: 40, False: 0]
  ------------------
   35|     40|    u = (Unicode *)gmallocn(size, sizeof(Unicode));
   36|     40|    memcpy(u, s->u, len * sizeof(Unicode));
   37|     40|  } else {
   38|       |    u = NULL;
   39|      0|  }
   40|     40|}
_ZN10TextStringD2Ev:
   42|  66.3k|TextString::~TextString() {
   43|  66.3k|  gfree(u);
   44|  66.3k|}
_ZN10TextString6appendEP7GString:
   53|  10.2k|TextString *TextString::append(GString *s) {
   54|  10.2k|  return insert(len, s);
   55|  10.2k|}
_ZN10TextString6insertEij:
   57|  43.1k|TextString *TextString::insert(int idx, Unicode c) {
   58|  43.1k|  if (idx >= 0 && idx <= len) {
  ------------------
  |  Branch (58:7): [True: 43.1k, False: 0]
  |  Branch (58:19): [True: 43.1k, False: 0]
  ------------------
   59|  43.1k|    expand(1);
   60|  43.1k|    if (idx < len) {
  ------------------
  |  Branch (60:9): [True: 43.1k, False: 0]
  ------------------
   61|  43.1k|      memmove(u + idx + 1, u + idx, (len - idx) * sizeof(Unicode));
   62|  43.1k|    }
   63|  43.1k|    u[idx] = c;
   64|  43.1k|    ++len;
   65|  43.1k|  }
   66|  43.1k|  return this;
   67|  43.1k|}
_ZN10TextString6insertEiPji:
   69|   215k|TextString *TextString::insert(int idx, Unicode *u2, int n) {
   70|   215k|  if (idx >= 0 && idx <= len) {
  ------------------
  |  Branch (70:7): [True: 215k, False: 0]
  |  Branch (70:19): [True: 215k, False: 0]
  ------------------
   71|   215k|    expand(n);
   72|   215k|    if (idx < len) {
  ------------------
  |  Branch (72:9): [True: 115k, False: 99.5k]
  ------------------
   73|   115k|      memmove(u + idx + n, u + idx, (len - idx) * sizeof(Unicode));
   74|   115k|    }
   75|   215k|    memcpy(u + idx, u2, n * sizeof(Unicode));
   76|   215k|    len += n;
   77|   215k|  }
   78|   215k|  return this;
   79|   215k|}
_ZN10TextString6insertEiP7GString:
   81|  53.6k|TextString *TextString::insert(int idx, GString *s) {
   82|  53.6k|  Unicode uBuf[100];
   83|  53.6k|  int n, i;
   84|       |
   85|  53.6k|  if (idx >= 0 && idx <= len) {
  ------------------
  |  Branch (85:7): [True: 53.6k, False: 0]
  |  Branch (85:19): [True: 53.6k, False: 0]
  ------------------
   86|       |    // look for a UTF-16BE BOM
   87|  53.6k|    if ((s->getChar(0) & 0xff) == 0xfe &&
  ------------------
  |  Branch (87:9): [True: 32.4k, False: 21.2k]
  ------------------
   88|  32.4k|	(s->getChar(1) & 0xff) == 0xff) {
  ------------------
  |  Branch (88:2): [True: 31.6k, False: 756]
  ------------------
   89|  31.6k|      i = 2;
   90|  31.6k|      n = 0;
   91|  3.46M|      while (getUTF16BE(s, &i, uBuf + n)) {
  ------------------
  |  Branch (91:14): [True: 3.43M, False: 31.6k]
  ------------------
   92|  3.43M|	++n;
   93|  3.43M|	if (n == sizeof(uBuf) / sizeof(Unicode)) {
  ------------------
  |  Branch (93:6): [True: 23.7k, False: 3.40M]
  ------------------
   94|  23.7k|	  insert(idx, uBuf, n);
   95|  23.7k|	  idx += n;
   96|  23.7k|	  n = 0;
   97|  23.7k|	}
   98|  3.43M|      }
   99|  31.6k|      if (n > 0) {
  ------------------
  |  Branch (99:11): [True: 31.6k, False: 4]
  ------------------
  100|  31.6k|	insert(idx, uBuf, n);
  101|  31.6k|      }
  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|  31.6k|    } else if ((s->getChar(0) & 0xff) == 0xff &&
  ------------------
  |  Branch (106:16): [True: 6.21k, False: 15.8k]
  ------------------
  107|  6.21k|	       (s->getChar(1) & 0xff) == 0xfe) {
  ------------------
  |  Branch (107:9): [True: 6.20k, False: 1]
  ------------------
  108|  6.20k|      i = 2;
  109|  6.20k|      n = 0;
  110|  11.1M|      while (getUTF16LE(s, &i, uBuf + n)) {
  ------------------
  |  Branch (110:14): [True: 11.1M, False: 6.20k]
  ------------------
  111|  11.1M|	++n;
  112|  11.1M|	if (n == sizeof(uBuf) / sizeof(Unicode)) {
  ------------------
  |  Branch (112:6): [True: 108k, False: 11.0M]
  ------------------
  113|   108k|	  insert(idx, uBuf, n);
  114|   108k|	  idx += n;
  115|   108k|	  n = 0;
  116|   108k|	}
  117|  11.1M|      }
  118|  6.20k|      if (n > 0) {
  ------------------
  |  Branch (118:11): [True: 6.17k, False: 32]
  ------------------
  119|  6.17k|	insert(idx, uBuf, n);
  120|  6.17k|      }
  121|       |
  122|       |    // look for a UTF-8 BOM
  123|  15.8k|    } else if ((s->getChar(0) & 0xff) == 0xef &&
  ------------------
  |  Branch (123:16): [True: 1.17k, False: 14.6k]
  ------------------
  124|  1.17k|	       (s->getChar(1) & 0xff) == 0xbb &&
  ------------------
  |  Branch (124:9): [True: 881, False: 293]
  ------------------
  125|    881|	       (s->getChar(2) & 0xff) == 0xbf) {
  ------------------
  |  Branch (125:9): [True: 652, False: 229]
  ------------------
  126|    652|      i = 3;
  127|    652|      n = 0;
  128|  4.55M|      while (getUTF8(s, &i, uBuf + n)) {
  ------------------
  |  Branch (128:14): [True: 4.55M, False: 652]
  ------------------
  129|  4.55M|	++n;
  130|  4.55M|	if (n == sizeof(uBuf) / sizeof(Unicode)) {
  ------------------
  |  Branch (130:6): [True: 45.2k, False: 4.50M]
  ------------------
  131|  45.2k|	  insert(idx, uBuf, n);
  132|  45.2k|	  idx += n;
  133|  45.2k|	  n = 0;
  134|  45.2k|	}
  135|  4.55M|      }
  136|    652|      if (n > 0) {
  ------------------
  |  Branch (136:11): [True: 571, False: 81]
  ------------------
  137|    571|	insert(idx, uBuf, n);
  138|    571|      }
  139|       |
  140|       |    // otherwise, use PDFDocEncoding
  141|  15.1k|    } else {
  142|  15.1k|      n = s->getLength();
  143|  15.1k|      expand(n);
  144|  15.1k|      if (idx < len) {
  ------------------
  |  Branch (144:11): [True: 13.5k, False: 1.64k]
  ------------------
  145|  13.5k|	memmove(u + idx + n, u + idx, (len - idx) * sizeof(Unicode));
  146|  13.5k|      }
  147|  11.2M|      for (i = 0; i < n; ++i) {
  ------------------
  |  Branch (147:19): [True: 11.2M, False: 15.1k]
  ------------------
  148|  11.2M|	u[idx + i] = pdfDocEncoding[s->getChar(i) & 0xff];
  149|  11.2M|      }
  150|  15.1k|      len += n;
  151|  15.1k|    }
  152|  53.6k|  }
  153|  53.6k|  return this;
  154|  53.6k|}
_ZN10TextString6expandEi:
  156|   273k|void TextString::expand(int delta) {
  157|   273k|  int newLen;
  158|       |
  159|   273k|  newLen = len + delta;
  160|   273k|  if (delta > INT_MAX - len) {
  ------------------
  |  Branch (160:7): [True: 0, False: 273k]
  ------------------
  161|       |    // trigger an out-of-memory error
  162|      0|    size = -1;
  163|   273k|  } else if (newLen <= size) {
  ------------------
  |  Branch (163:14): [True: 235k, False: 38.0k]
  ------------------
  164|   235k|    return;
  165|   235k|  } else if (size > 0 && size <= INT_MAX / 2 && size*2 >= newLen) {
  ------------------
  |  Branch (165:14): [True: 27.5k, False: 10.5k]
  |  Branch (165:26): [True: 27.5k, False: 0]
  |  Branch (165:49): [True: 26.6k, False: 928]
  ------------------
  166|  26.6k|    size *= 2;
  167|  26.6k|  } else {
  168|  11.4k|    size = newLen;
  169|  11.4k|  }
  170|  38.0k|  u = (Unicode *)greallocn(u, size, sizeof(Unicode));
  171|  38.0k|}
_ZN10TextString6toUTF8Ev:
  201|    146|GString *TextString::toUTF8() {
  202|    146|  GString *s = new GString();
  203|  71.5k|  for (int i = 0; i < len; ++i) {
  ------------------
  |  Branch (203:19): [True: 71.3k, False: 146]
  ------------------
  204|  71.3k|    char buf[8];
  205|  71.3k|    int n = mapUTF8(u[i], buf, sizeof(buf));
  206|  71.3k|    s->append(buf, n);
  207|  71.3k|  }
  208|    146|  return s;
  209|    146|}

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

_Z7mapUTF8jPci:
   12|  71.3k|int mapUTF8(Unicode u, char *buf, int bufSize) {
   13|  71.3k|  if        (u <= 0x0000007f) {
  ------------------
  |  Branch (13:14): [True: 67.5k, False: 3.81k]
  ------------------
   14|  67.5k|    if (bufSize < 1) {
  ------------------
  |  Branch (14:9): [True: 0, False: 67.5k]
  ------------------
   15|      0|      return 0;
   16|      0|    }
   17|  67.5k|    buf[0] = (char)u;
   18|  67.5k|    return 1;
   19|  67.5k|  } else if (u <= 0x000007ff) {
  ------------------
  |  Branch (19:14): [True: 1.24k, False: 2.56k]
  ------------------
   20|  1.24k|    if (bufSize < 2) {
  ------------------
  |  Branch (20:9): [True: 0, False: 1.24k]
  ------------------
   21|      0|      return 0;
   22|      0|    }
   23|  1.24k|    buf[0] = (char)(0xc0 + (u >> 6));
   24|  1.24k|    buf[1] = (char)(0x80 + (u & 0x3f));
   25|  1.24k|    return 2;
   26|  2.56k|  } else if (u <= 0x0000ffff) {
  ------------------
  |  Branch (26:14): [True: 2.36k, False: 201]
  ------------------
   27|  2.36k|    if (bufSize < 3) {
  ------------------
  |  Branch (27:9): [True: 0, False: 2.36k]
  ------------------
   28|      0|      return 0;
   29|      0|    }
   30|  2.36k|    buf[0] = (char)(0xe0 + (u >> 12));
   31|  2.36k|    buf[1] = (char)(0x80 + ((u >> 6) & 0x3f));
   32|  2.36k|    buf[2] = (char)(0x80 + (u & 0x3f));
   33|  2.36k|    return 3;
   34|  2.36k|  } else if (u <= 0x0010ffff) {
  ------------------
  |  Branch (34:14): [True: 76, False: 125]
  ------------------
   35|     76|    if (bufSize < 4) {
  ------------------
  |  Branch (35:9): [True: 0, False: 76]
  ------------------
   36|      0|      return 0;
   37|      0|    }
   38|     76|    buf[0] = (char)(0xf0 + (u >> 18));
   39|     76|    buf[1] = (char)(0x80 + ((u >> 12) & 0x3f));
   40|     76|    buf[2] = (char)(0x80 + ((u >> 6) & 0x3f));
   41|     76|    buf[3] = (char)(0x80 + (u & 0x3f));
   42|     76|    return 4;
   43|    125|  } else {
   44|    125|    return 0;
   45|    125|  }
   46|  71.3k|}
_Z7getUTF8P7GStringPiPj:
   61|  4.55M|GBool getUTF8(GString *s, int *i, Unicode *u) {
   62|  4.55M|  Guchar c0, c1, c2, c3, c4, c5;
   63|       |
   64|  4.55M|  if (*i >= s->getLength()) {
  ------------------
  |  Branch (64:7): [True: 652, False: 4.55M]
  ------------------
   65|    652|    return gFalse;
  ------------------
  |  |   18|    652|#define gFalse 0
  ------------------
   66|    652|  }
   67|  4.55M|  c0 = (Guchar)s->getChar((*i)++);
   68|  4.55M|  if (c0 < 0x80) {
  ------------------
  |  Branch (68:7): [True: 3.66M, False: 887k]
  ------------------
   69|  3.66M|    *u = (Unicode)c0;
   70|  3.66M|  } else if (c0 < 0xe0) {
  ------------------
  |  Branch (70:14): [True: 534k, False: 353k]
  ------------------
   71|   534k|    if (*i < s->getLength() &&
  ------------------
  |  Branch (71:9): [True: 534k, False: 68]
  ------------------
   72|   534k|	((c1 = (Guchar)s->getChar(*i)) & 0xc0) == 0x80) {
  ------------------
  |  Branch (72:2): [True: 161k, False: 372k]
  ------------------
   73|   161k|      *i += 1;
   74|   161k|      *u = (Unicode)(((c0 & 0x1f) << 6) |
   75|   161k|		     (c1 & 0x3f));
   76|   372k|    } else {
   77|   372k|      *u =  (Unicode)c0;
   78|   372k|    }
   79|   534k|  } else if (c0 < 0xf0) {
  ------------------
  |  Branch (79:14): [True: 117k, False: 236k]
  ------------------
   80|   117k|    if (*i < s->getLength() - 1 &&
  ------------------
  |  Branch (80:9): [True: 117k, False: 286]
  ------------------
   81|   117k|	((c1 = (Guchar)s->getChar(*i)) & 0xc0) == 0x80 &&
  ------------------
  |  Branch (81:2): [True: 20.7k, False: 96.2k]
  ------------------
   82|  20.7k|	((c2 = (Guchar)s->getChar(*i + 1)) & 0xc0) == 0x80) {
  ------------------
  |  Branch (82:2): [True: 7.02k, False: 13.7k]
  ------------------
   83|  7.02k|      *i += 2;
   84|  7.02k|      *u = (Unicode)(((c0 & 0x0f) << 12) |
   85|  7.02k|		     ((c1 & 0x3f) << 6) |
   86|  7.02k|		     (c2 & 0x3f));
   87|   110k|    } else {
   88|   110k|      *u = (Unicode)c0;
   89|   110k|    }
   90|   236k|  } else if (c0 < 0xf8) {
  ------------------
  |  Branch (90:14): [True: 36.1k, False: 199k]
  ------------------
   91|  36.1k|    if (*i < s->getLength() - 2 &&
  ------------------
  |  Branch (91:9): [True: 36.0k, False: 106]
  ------------------
   92|  36.0k|	((c1 = (Guchar)s->getChar(*i)) & 0xc0) == 0x80 &&
  ------------------
  |  Branch (92:2): [True: 13.2k, False: 22.8k]
  ------------------
   93|  13.2k|	((c2 = (Guchar)s->getChar(*i + 1)) & 0xc0) == 0x80 &&
  ------------------
  |  Branch (93:2): [True: 4.48k, False: 8.72k]
  ------------------
   94|  4.48k|	((c3 = (Guchar)s->getChar(*i + 2)) & 0xc0) == 0x80) {
  ------------------
  |  Branch (94:2): [True: 3.24k, False: 1.23k]
  ------------------
   95|  3.24k|      *i += 3;
   96|  3.24k|      *u = (Unicode)(((c0 & 0x07) << 18) |
   97|  3.24k|		     ((c1 & 0x3f) << 12) |
   98|  3.24k|		     ((c2 & 0x3f) << 6) |
   99|  3.24k|		     (c3 & 0x3f));
  100|  32.8k|    } else {
  101|  32.8k|      *u = (Unicode)c0;
  102|  32.8k|    }
  103|   199k|  } else if (c0 < 0xfc) {
  ------------------
  |  Branch (103:14): [True: 9.13k, False: 190k]
  ------------------
  104|  9.13k|    if (*i < s->getLength() - 3 &&
  ------------------
  |  Branch (104:9): [True: 9.02k, False: 112]
  ------------------
  105|  9.02k|	((c1 = (Guchar)s->getChar(*i)) & 0xc0) == 0x80 &&
  ------------------
  |  Branch (105:2): [True: 2.44k, False: 6.58k]
  ------------------
  106|  2.44k|	((c2 = (Guchar)s->getChar(*i + 1)) & 0xc0) == 0x80 &&
  ------------------
  |  Branch (106:2): [True: 1.18k, False: 1.26k]
  ------------------
  107|  1.18k|	((c3 = (Guchar)s->getChar(*i + 2)) & 0xc0) == 0x80 &&
  ------------------
  |  Branch (107:2): [True: 668, False: 513]
  ------------------
  108|    668|	((c4 = (Guchar)s->getChar(*i + 3)) & 0xc0) == 0x80) {
  ------------------
  |  Branch (108:2): [True: 575, False: 93]
  ------------------
  109|    575|      *i += 4;
  110|    575|      *u = (Unicode)(((c0 & 0x03) << 24) |
  111|    575|		     ((c1 & 0x3f) << 18) |
  112|    575|		     ((c2 & 0x3f) << 12) |
  113|    575|		     ((c3 & 0x3f) << 6) |
  114|    575|		     (c4 & 0x3f));
  115|  8.56k|    } else {
  116|  8.56k|      *u = (Unicode)c0;
  117|  8.56k|    }
  118|   190k|  } else if (c0 < 0xfe) {
  ------------------
  |  Branch (118:14): [True: 35.3k, False: 155k]
  ------------------
  119|  35.3k|    if (*i < s->getLength() - 4 &&
  ------------------
  |  Branch (119:9): [True: 34.2k, False: 1.05k]
  ------------------
  120|  34.2k|	((c1 = (Guchar)s->getChar(*i)) & 0xc0) == 0x80 &&
  ------------------
  |  Branch (120:2): [True: 4.33k, False: 29.9k]
  ------------------
  121|  4.33k|	((c2 = (Guchar)s->getChar(*i + 1)) & 0xc0) == 0x80 &&
  ------------------
  |  Branch (121:2): [True: 3.42k, False: 905]
  ------------------
  122|  3.42k|	((c3 = (Guchar)s->getChar(*i + 2)) & 0xc0) == 0x80 &&
  ------------------
  |  Branch (122:2): [True: 3.22k, False: 206]
  ------------------
  123|  3.22k|	((c4 = (Guchar)s->getChar(*i + 3)) & 0xc0) == 0x80 &&
  ------------------
  |  Branch (123:2): [True: 3.10k, False: 118]
  ------------------
  124|  3.10k|	((c5 = (Guchar)s->getChar(*i + 4)) & 0xc0) == 0x80) {
  ------------------
  |  Branch (124:2): [True: 2.90k, False: 203]
  ------------------
  125|  2.90k|      *i += 5;
  126|  2.90k|      *u = (Unicode)(((c0 & 0x01) << 30) |
  127|  2.90k|		     ((c1 & 0x3f) << 24) |
  128|  2.90k|		     ((c2 & 0x3f) << 18) |
  129|  2.90k|		     ((c3 & 0x3f) << 12) |
  130|  2.90k|		     ((c4 & 0x3f) << 6) |
  131|  2.90k|		     (c5 & 0x3f));
  132|  32.4k|    } else {
  133|  32.4k|      *u = (Unicode)c0;
  134|  32.4k|    }
  135|   155k|  } else {
  136|   155k|    *u = (Unicode)c0;
  137|   155k|  }
  138|  4.55M|  return gTrue;
  ------------------
  |  |   17|  4.55M|#define gTrue 1
  ------------------
  139|  4.55M|}
_Z10getUTF16BEP7GStringPiPj:
  141|  3.46M|GBool getUTF16BE(GString *s, int *i, Unicode *u) {
  142|  3.46M|  int w0, w1;
  143|       |
  144|  3.46M|  if (*i >= s->getLength() - 1) {
  ------------------
  |  Branch (144:7): [True: 31.6k, False: 3.43M]
  ------------------
  145|  31.6k|    return gFalse;
  ------------------
  |  |   18|  31.6k|#define gFalse 0
  ------------------
  146|  31.6k|  }
  147|  3.43M|  w0 = ((s->getChar(*i) & 0xff) << 8) | (s->getChar(*i + 1) & 0xff);
  148|  3.43M|  *i += 2;
  149|  3.43M|  if (w0 < 0xd800 || w0 >= 0xe000) {
  ------------------
  |  Branch (149:7): [True: 3.28M, False: 149k]
  |  Branch (149:22): [True: 66.1k, False: 83.4k]
  ------------------
  150|  3.34M|    *u = (Unicode)w0;
  151|  3.34M|  } else {
  152|  83.4k|    if (*i < s->getLength() - 1) {
  ------------------
  |  Branch (152:9): [True: 83.0k, False: 382]
  ------------------
  153|  83.0k|      w1 = ((s->getChar(*i) & 0xff) << 8) | (s->getChar(*i + 1) & 0xff);
  154|  83.0k|      *i += 2;
  155|  83.0k|      *u = 0x10000 + ((w0 - 0xd800) << 10) + (w1 - 0xdc00);
  156|  83.0k|    } else {
  157|    382|      *u = (Unicode)w0;
  158|    382|    }
  159|  83.4k|  }
  160|  3.43M|  return gTrue;
  ------------------
  |  |   17|  3.43M|#define gTrue 1
  ------------------
  161|  3.46M|}
_Z10getUTF16LEP7GStringPiPj:
  163|  11.1M|GBool getUTF16LE(GString *s, int *i, Unicode *u) {
  164|  11.1M|  int w0, w1;
  165|       |
  166|  11.1M|  if (*i >= s->getLength() - 1) {
  ------------------
  |  Branch (166:7): [True: 6.20k, False: 11.1M]
  ------------------
  167|  6.20k|    return gFalse;
  ------------------
  |  |   18|  6.20k|#define gFalse 0
  ------------------
  168|  6.20k|  }
  169|  11.1M|  w0 = (s->getChar(*i) & 0xff) | ((s->getChar(*i + 1) & 0xff) << 8);
  170|  11.1M|  *i += 2;
  171|  11.1M|  if (w0 < 0xd800 || w0 >= 0xe000) {
  ------------------
  |  Branch (171:7): [True: 10.9M, False: 204k]
  |  Branch (171:22): [True: 186k, False: 18.1k]
  ------------------
  172|  11.1M|    *u = (Unicode)w0;
  173|  11.1M|  } else {
  174|  18.1k|    if (*i < s->getLength() - 1) {
  ------------------
  |  Branch (174:9): [True: 17.8k, False: 226]
  ------------------
  175|  17.8k|      w1 = (s->getChar(*i) & 0xff) | ((s->getChar(*i + 1) & 0xff) << 8);
  176|  17.8k|      *i += 2;
  177|  17.8k|      *u = 0x10000 + ((w0 - 0xd800) << 10) + (w1 - 0xdc00);
  178|  17.8k|    } else {
  179|    226|      *u = (Unicode)w0;
  180|    226|    }
  181|  18.1k|  }
  182|  11.1M|  return gTrue;
  ------------------
  |  |   17|  11.1M|#define gTrue 1
  ------------------
  183|  11.1M|}

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

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

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

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

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

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

_ZN6ZxNodeC2Ev:
   64|  2.34M|ZxNode::ZxNode() {
   65|  2.34M|  next = NULL;
   66|  2.34M|  parent = NULL;
   67|       |  firstChild = lastChild = NULL;
   68|  2.34M|}
_ZN6ZxNodeD2Ev:
   70|  2.34M|ZxNode::~ZxNode() {
   71|  2.34M|  ZxNode *child;
   72|       |
   73|  4.69M|  while (firstChild) {
  ------------------
  |  Branch (73:10): [True: 2.34M, False: 2.34M]
  ------------------
   74|  2.34M|    child = firstChild;
   75|  2.34M|    firstChild = firstChild->next;
   76|  2.34M|    delete child;
   77|  2.34M|  }
   78|  2.34M|}
_ZN6ZxNode21findFirstChildElementEPKc:
  143|   217k|ZxElement *ZxNode::findFirstChildElement(const char *type) {
  144|   217k|  ZxNode *child;
  145|       |
  146|   691k|  for (child = firstChild; child; child = child->next) {
  ------------------
  |  Branch (146:28): [True: 490k, False: 201k]
  ------------------
  147|   490k|    if (child->isElement(type)) {
  ------------------
  |  Branch (147:9): [True: 15.6k, False: 474k]
  ------------------
  148|  15.6k|      return (ZxElement *)child;
  149|  15.6k|    }
  150|   490k|  }
  151|   201k|  return NULL;
  152|   217k|}
_ZN6ZxNode8addChildEPS_:
  186|  2.34M|void ZxNode::addChild(ZxNode *child) {
  187|  2.34M|  if (lastChild) {
  ------------------
  |  Branch (187:7): [True: 2.05M, False: 294k]
  ------------------
  188|  2.05M|    lastChild->next = child;
  189|  2.05M|    lastChild = child;
  190|  2.05M|  } else {
  191|   294k|    firstChild = lastChild = child;
  192|   294k|  }
  193|  2.34M|  child->parent = this;
  194|       |  child->next = NULL;
  195|  2.34M|}
_ZN5ZxDocC2Ev:
  199|    655|ZxDoc::ZxDoc() {
  200|    655|  xmlDecl = NULL;
  201|    655|  docTypeDecl = NULL;
  202|       |  root = NULL;
  203|    655|}
_ZN5ZxDoc7loadMemEPKcj:
  205|    655|ZxDoc *ZxDoc::loadMem(const char *data, Guint dataLen) {
  206|    655|  ZxDoc *doc;
  207|       |
  208|    655|  doc = new ZxDoc();
  209|    655|  if (!doc->parse(data, dataLen)) {
  ------------------
  |  Branch (209:7): [True: 54, False: 601]
  ------------------
  210|     54|    delete doc;
  211|     54|    return NULL;
  212|     54|  }
  213|    601|  return doc;
  214|    655|}
_ZN5ZxDoc8addChildEP6ZxNode:
  262|    965|void ZxDoc::addChild(ZxNode *node) {
  263|    965|  if (node->isXMLDecl() && !xmlDecl) {
  ------------------
  |  Branch (263:7): [True: 277, False: 688]
  |  Branch (263:28): [True: 277, False: 0]
  ------------------
  264|    277|    xmlDecl = (ZxXMLDecl *)node;
  265|    688|  } else if (node->isDocTypeDecl() && !docTypeDecl) {
  ------------------
  |  Branch (265:14): [True: 1, False: 687]
  |  Branch (265:39): [True: 1, False: 0]
  ------------------
  266|      1|    docTypeDecl = (ZxDocTypeDecl *)node;
  267|    687|  } else if (node->isElement() && !root) {
  ------------------
  |  Branch (267:14): [True: 601, False: 86]
  |  Branch (267:35): [True: 601, False: 0]
  ------------------
  268|    601|    root = (ZxElement *)node;
  269|    601|  }
  270|    965|  ZxNode::addChild(node);
  271|    965|}
_ZN5ZxDoc5parseEPKcj:
  273|    655|bool ZxDoc::parse(const char *data, Guint dataLen) {
  274|    655|  parsePtr = data;
  275|    655|  parseEnd = data + dataLen;
  276|       |  
  277|    655|  parseSpace();
  278|    655|  parseBOM();
  279|    655|  parseSpace();
  280|    655|  parseXMLDecl(this);
  281|    655|  parseMisc(this);
  282|    655|  parseDocTypeDecl(this);
  283|    655|  parseMisc(this);
  284|    655|  if (match("<")) {
  ------------------
  |  Branch (284:7): [True: 601, False: 54]
  ------------------
  285|    601|    parseElement(this);
  286|    601|  }
  287|    655|  parseMisc(this);
  288|       |  return root != NULL;
  289|    655|}
_ZN5ZxDoc12parseXMLDeclEP6ZxNode:
  291|    655|void ZxDoc::parseXMLDecl(ZxNode *par) {
  292|    655|  GString *version, *encoding, *s;
  293|    655|  bool standalone;
  294|       |
  295|    655|  if (!match("<?xml")) {
  ------------------
  |  Branch (295:7): [True: 378, False: 277]
  ------------------
  296|    378|    return;
  297|    378|  }
  298|    277|  parsePtr += 5;
  299|    277|  parseSpace();
  300|       |
  301|       |  // version
  302|    277|  version = NULL;
  303|    277|  if (match("version")) {
  ------------------
  |  Branch (303:7): [True: 276, False: 1]
  ------------------
  304|    276|    parsePtr += 7;
  305|    276|    parseSpace();
  306|    276|    if (match("=")) {
  ------------------
  |  Branch (306:9): [True: 272, False: 4]
  ------------------
  307|    272|      ++parsePtr;
  308|    272|      parseSpace();
  309|    272|      version = parseQuotedString();
  310|    272|    }
  311|    276|  }
  312|    277|  if (!version) {
  ------------------
  |  Branch (312:7): [True: 5, False: 272]
  ------------------
  313|      5|    version = new GString("1.0");
  314|      5|  }
  315|    277|  parseSpace();
  316|       |	
  317|       |  // encoding
  318|    277|  encoding = NULL;
  319|    277|  if (match("encoding")) {
  ------------------
  |  Branch (319:7): [True: 253, False: 24]
  ------------------
  320|    253|    parsePtr += 8;
  321|    253|    parseSpace();
  322|    253|    if (match("=")) {
  ------------------
  |  Branch (322:9): [True: 248, False: 5]
  ------------------
  323|    248|      ++parsePtr;
  324|    248|      parseSpace();
  325|    248|      encoding = parseQuotedString();
  326|    248|    }
  327|    253|  }
  328|    277|  parseSpace();
  329|       |
  330|       |  // standalone
  331|    277|  standalone = false;
  332|    277|  if (match("standalone")) {
  ------------------
  |  Branch (332:7): [True: 13, False: 264]
  ------------------
  333|     13|    parsePtr += 10;
  334|     13|    parseSpace();
  335|     13|    if (match("=")) {
  ------------------
  |  Branch (335:9): [True: 8, False: 5]
  ------------------
  336|      8|      ++parsePtr;
  337|      8|      parseSpace();
  338|      8|      s = parseQuotedString();
  339|      8|      standalone = !s->cmp("yes");
  340|      8|      delete s;
  341|      8|    }
  342|     13|  }
  343|    277|  parseSpace();
  344|       |
  345|    277|  if (match("?>")) {
  ------------------
  |  Branch (345:7): [True: 246, False: 31]
  ------------------
  346|    246|    parsePtr += 2;
  347|    246|  }
  348|       |
  349|    277|  par->addChild(new ZxXMLDecl(version, encoding, standalone));
  350|    277|}
_ZN5ZxDoc16parseDocTypeDeclEP6ZxNode:
  353|    655|void ZxDoc::parseDocTypeDecl(ZxNode *par) {
  354|    655|  GString *name;
  355|    655|  int state;
  356|    655|  char c, quote;
  357|       |
  358|    655|  if (!match("<!DOCTYPE")) {
  ------------------
  |  Branch (358:7): [True: 654, False: 1]
  ------------------
  359|    654|    return;
  360|    654|  }
  361|      1|  parsePtr += 9;
  362|      1|  parseSpace();
  363|       |
  364|      1|  name = parseName();
  365|      1|  parseSpace();
  366|       |
  367|      1|  state = 0;
  368|      1|  quote = '\0';
  369|     76|  while (parsePtr < parseEnd && state < 4) {
  ------------------
  |  Branch (369:10): [True: 76, False: 0]
  |  Branch (369:33): [True: 75, False: 1]
  ------------------
  370|     75|    c = *parsePtr++;
  371|     75|    switch (state) {
  ------------------
  |  Branch (371:13): [True: 75, False: 0]
  ------------------
  372|     75|    case 0: // not in square brackets; not in quotes
  ------------------
  |  Branch (372:5): [True: 75, False: 0]
  ------------------
  373|     75|      if (c == '>') {
  ------------------
  |  Branch (373:11): [True: 1, False: 74]
  ------------------
  374|      1|	state = 4;
  375|     74|      } else if (c == '"' || c == '\'') {
  ------------------
  |  Branch (375:18): [True: 0, False: 74]
  |  Branch (375:30): [True: 0, False: 74]
  ------------------
  376|      0|	state = 1;
  377|     74|      } else if (c == '[') {
  ------------------
  |  Branch (377:18): [True: 0, False: 74]
  ------------------
  378|      0|	state = 2;
  379|      0|      }
  380|     75|      break;
  381|      0|    case 1: // not in square brackets; in quotes
  ------------------
  |  Branch (381:5): [True: 0, False: 75]
  ------------------
  382|      0|      if (c == quote) {
  ------------------
  |  Branch (382:11): [True: 0, False: 0]
  ------------------
  383|      0|	state = 0;
  384|      0|      }
  385|      0|      break;
  386|      0|    case 2: // in square brackets; not in quotes
  ------------------
  |  Branch (386:5): [True: 0, False: 75]
  ------------------
  387|      0|      if (c == ']') {
  ------------------
  |  Branch (387:11): [True: 0, False: 0]
  ------------------
  388|      0|	state = 0;
  389|      0|      } else if (c == '"' || c == '\'') {
  ------------------
  |  Branch (389:18): [True: 0, False: 0]
  |  Branch (389:30): [True: 0, False: 0]
  ------------------
  390|      0|	state = 3;
  391|      0|      }
  392|      0|      break;
  393|      0|    case 3: // in square brackets; in quotes
  ------------------
  |  Branch (393:5): [True: 0, False: 75]
  ------------------
  394|      0|      if (c == quote) {
  ------------------
  |  Branch (394:11): [True: 0, False: 0]
  ------------------
  395|      0|	state = 2;
  396|      0|      }
  397|      0|      break;
  398|     75|    }
  399|     75|  }
  400|       |
  401|      1|  par->addChild(new ZxDocTypeDecl(name));
  402|      1|}
_ZN5ZxDoc12parseElementEP6ZxNode:
  405|  1.29M|void ZxDoc::parseElement(ZxNode *par) {
  406|  1.29M|  GString *type;
  407|  1.29M|  ZxElement *elem;
  408|  1.29M|  ZxAttr *attr;
  409|       |
  410|  1.29M|  ++parsePtr;
  411|  1.29M|  type = parseName();
  412|  1.29M|  elem = new ZxElement(type);
  413|  1.29M|  parseSpace();
  414|  1.44M|  while ((attr = parseAttr())) {
  ------------------
  |  Branch (414:10): [True: 145k, False: 1.29M]
  ------------------
  415|   145k|    elem->addAttr(attr);
  416|   145k|    parseSpace();
  417|   145k|  }
  418|  1.29M|  if (match("/>")) {
  ------------------
  |  Branch (418:7): [True: 37.7k, False: 1.25M]
  ------------------
  419|  37.7k|    parsePtr += 2;
  420|  1.25M|  } else if (match(">")) {
  ------------------
  |  Branch (420:14): [True: 293k, False: 964k]
  ------------------
  421|   293k|    ++parsePtr;
  422|   293k|    parseContent(elem);
  423|   293k|  }
  424|  1.29M|  par->addChild(elem);
  425|  1.29M|}
_ZN5ZxDoc9parseAttrEv:
  427|  1.44M|ZxAttr *ZxDoc::parseAttr() {
  428|  1.44M|  GString *name, *value;
  429|  1.44M|  const char *start;
  430|  1.44M|  char quote, c;
  431|  1.44M|  unsigned int x;
  432|  1.44M|  int n;
  433|       |
  434|  1.44M|  name = parseName();
  435|  1.44M|  parseSpace();
  436|  1.44M|  if (!match("=")) {
  ------------------
  |  Branch (436:7): [True: 1.27M, False: 163k]
  ------------------
  437|  1.27M|    delete name;
  438|  1.27M|    return NULL;
  439|  1.27M|  }
  440|   163k|  ++parsePtr;
  441|   163k|  parseSpace();
  442|   163k|  if (!(parsePtr < parseEnd && (*parsePtr == '"' || *parsePtr == '\''))) {
  ------------------
  |  Branch (442:9): [True: 163k, False: 3]
  |  Branch (442:33): [True: 144k, False: 18.7k]
  |  Branch (442:53): [True: 470, False: 18.3k]
  ------------------
  443|  18.3k|    delete name;
  444|  18.3k|    return NULL;
  445|  18.3k|  }
  446|   145k|  quote = *parsePtr++;
  447|   145k|  value = new GString();
  448|   368k|  while (parsePtr < parseEnd && *parsePtr != quote) {
  ------------------
  |  Branch (448:10): [True: 368k, False: 76]
  |  Branch (448:33): [True: 223k, False: 145k]
  ------------------
  449|   223k|    if (*parsePtr == '&') {
  ------------------
  |  Branch (449:9): [True: 52.1k, False: 170k]
  ------------------
  450|  52.1k|      ++parsePtr;
  451|  52.1k|      if (parsePtr < parseEnd && *parsePtr == '#') {
  ------------------
  |  Branch (451:11): [True: 52.1k, False: 3]
  |  Branch (451:34): [True: 23.8k, False: 28.3k]
  ------------------
  452|  23.8k|	++parsePtr;
  453|  23.8k|	if (parsePtr < parseEnd && *parsePtr == 'x') {
  ------------------
  |  Branch (453:6): [True: 23.8k, False: 2]
  |  Branch (453:29): [True: 9.67k, False: 14.1k]
  ------------------
  454|  9.67k|	  ++parsePtr;
  455|  9.67k|	  x = 0;
  456|  16.1k|	  while (parsePtr < parseEnd) {
  ------------------
  |  Branch (456:11): [True: 16.1k, False: 2]
  ------------------
  457|  16.1k|	    c = *parsePtr;
  458|  16.1k|	    if (c >= '0' && c <= '9') {
  ------------------
  |  Branch (458:10): [True: 13.2k, False: 2.95k]
  |  Branch (458:22): [True: 1.15k, False: 12.0k]
  ------------------
  459|  1.15k|	      x = (x << 4) + (c - '0');
  460|  15.0k|	    } else if (c >= 'a' && c <= 'f') {
  ------------------
  |  Branch (460:17): [True: 6.24k, False: 8.76k]
  |  Branch (460:29): [True: 1.83k, False: 4.41k]
  ------------------
  461|  1.83k|	      x = (x << 4) + (10 + c - 'a');
  462|  13.1k|	    } else if (c >= 'A' && c <= 'F') {
  ------------------
  |  Branch (462:17): [True: 8.55k, False: 4.61k]
  |  Branch (462:29): [True: 3.49k, False: 5.05k]
  ------------------
  463|  3.49k|	      x = (x << 4) + (10 + c - 'A');
  464|  9.67k|	    } else {
  465|  9.67k|	      break;
  466|  9.67k|	    }
  467|  6.48k|	    ++parsePtr;
  468|  6.48k|	  }
  469|  9.67k|	  if (parsePtr < parseEnd && *parsePtr == ';') {
  ------------------
  |  Branch (469:8): [True: 9.67k, False: 2]
  |  Branch (469:31): [True: 348, False: 9.32k]
  ------------------
  470|    348|	    ++parsePtr;
  471|    348|	  }
  472|  9.67k|	  appendUTF8(value, x);
  473|  14.1k|	} else {
  474|  14.1k|	  x = 0;
  475|  15.4k|	  while (parsePtr < parseEnd) {
  ------------------
  |  Branch (475:11): [True: 15.4k, False: 5]
  ------------------
  476|  15.4k|	    c = *parsePtr;
  477|  15.4k|	    if (c >= '0' && c <= '9') {
  ------------------
  |  Branch (477:10): [True: 7.82k, False: 7.64k]
  |  Branch (477:22): [True: 1.31k, False: 6.50k]
  ------------------
  478|  1.31k|	      x = x * 10 + (c - '0');
  479|  14.1k|	    } else {
  480|  14.1k|	      break;
  481|  14.1k|	    }
  482|  1.31k|	    ++parsePtr;
  483|  1.31k|	  }
  484|  14.1k|	  if (parsePtr < parseEnd && *parsePtr == ';') {
  ------------------
  |  Branch (484:8): [True: 14.1k, False: 5]
  |  Branch (484:31): [True: 324, False: 13.8k]
  ------------------
  485|    324|	    ++parsePtr;
  486|    324|	  }
  487|  14.1k|	  appendUTF8(value, x);
  488|  14.1k|	}
  489|  28.3k|      } else {
  490|  28.3k|	start = parsePtr;
  491|  28.3k|	for (++parsePtr;
  492|  1.41M|	     parsePtr < parseEnd && *parsePtr != ';' &&
  ------------------
  |  Branch (492:7): [True: 1.41M, False: 8]
  |  Branch (492:30): [True: 1.40M, False: 2.94k]
  ------------------
  493|  1.40M|	       *parsePtr != quote && *parsePtr != '&';
  ------------------
  |  Branch (493:9): [True: 1.40M, False: 2.56k]
  |  Branch (493:31): [True: 1.38M, False: 22.8k]
  ------------------
  494|  1.38M|	     ++parsePtr) ;
  495|  28.3k|	n = (int)(parsePtr - start);
  496|  28.3k|	if (parsePtr < parseEnd && *parsePtr == ';') {
  ------------------
  |  Branch (496:6): [True: 28.3k, False: 8]
  |  Branch (496:29): [True: 2.94k, False: 25.4k]
  ------------------
  497|  2.94k|	  ++parsePtr;
  498|  2.94k|	}
  499|  28.3k|	if (n == 2 && !strncmp(start, "lt", 2)) {
  ------------------
  |  Branch (499:6): [True: 1.51k, False: 26.8k]
  |  Branch (499:16): [True: 239, False: 1.27k]
  ------------------
  500|    239|	  value->append('<');
  501|  28.1k|	} else if (n == 2 && !strncmp(start, "gt", 2)) {
  ------------------
  |  Branch (501:13): [True: 1.27k, False: 26.8k]
  |  Branch (501:23): [True: 278, False: 1.00k]
  ------------------
  502|    278|	  value->append('>');
  503|  27.8k|	} else if (n == 3 && !strncmp(start, "amp", 3)) {
  ------------------
  |  Branch (503:13): [True: 672, False: 27.1k]
  |  Branch (503:23): [True: 0, False: 672]
  ------------------
  504|      0|	  value->append('&');
  505|  27.8k|	} else if (n == 4 && !strncmp(start, "apos", 4)) {
  ------------------
  |  Branch (505:13): [True: 769, False: 27.0k]
  |  Branch (505:23): [True: 0, False: 769]
  ------------------
  506|      0|	  value->append('\'');
  507|  27.8k|	} else if (n == 4 && !strncmp(start, "quot", 4)) {
  ------------------
  |  Branch (507:13): [True: 769, False: 27.0k]
  |  Branch (507:23): [True: 0, False: 769]
  ------------------
  508|      0|	  value->append('"');
  509|  27.8k|	} else {
  510|  27.8k|	  value->append(start - 1, (int)(parsePtr - start) + 1);
  511|  27.8k|	}
  512|  28.3k|      }
  513|   170k|    } else {
  514|   170k|      start = parsePtr;
  515|   170k|      for (++parsePtr;
  516|  15.5M|	   parsePtr < parseEnd && *parsePtr != quote && *parsePtr != '&';
  ------------------
  |  Branch (516:5): [True: 15.5M, False: 56]
  |  Branch (516:28): [True: 15.3M, False: 142k]
  |  Branch (516:50): [True: 15.3M, False: 28.6k]
  ------------------
  517|  15.3M|	   ++parsePtr) ;
  518|   170k|      value->append(start, (int)(parsePtr - start));
  519|   170k|    }
  520|   223k|  }
  521|   145k|  if (parsePtr < parseEnd && *parsePtr == quote) {
  ------------------
  |  Branch (521:7): [True: 145k, False: 76]
  |  Branch (521:30): [True: 145k, False: 0]
  ------------------
  522|   145k|    ++parsePtr;
  523|   145k|  }
  524|   145k|  return new ZxAttr(name, value);
  525|   163k|}
_ZN5ZxDoc12parseContentEP9ZxElement:
  528|   293k|void ZxDoc::parseContent(ZxElement *par) {
  529|   293k|  GString *endType;
  530|       |
  531|   293k|  endType = (new GString("</"))->append(par->getType());
  532|       |
  533|  2.63M|  while (parsePtr < parseEnd) {
  ------------------
  |  Branch (533:10): [True: 2.42M, False: 214k]
  ------------------
  534|  2.42M|    if (match(endType->getCString())) {
  ------------------
  |  Branch (534:9): [True: 78.8k, False: 2.34M]
  ------------------
  535|  78.8k|      parsePtr += endType->getLength();
  536|  78.8k|      parseSpace();
  537|  78.8k|      if (match(">")) {
  ------------------
  |  Branch (537:11): [True: 51.5k, False: 27.3k]
  ------------------
  538|  51.5k|	++parsePtr;
  539|  51.5k|      }
  540|  78.8k|      break;
  541|  2.34M|    } else if (match("<?")) {
  ------------------
  |  Branch (541:16): [True: 25.5k, False: 2.31M]
  ------------------
  542|  25.5k|      parsePI(par);
  543|  2.31M|    } else if (match("<![CDATA[")) {
  ------------------
  |  Branch (543:16): [True: 39, False: 2.31M]
  ------------------
  544|     39|      parseCDSect(par);
  545|  2.31M|    } else if (match("<!--")) {
  ------------------
  |  Branch (545:16): [True: 903, False: 2.31M]
  ------------------
  546|    903|      parseComment(par);
  547|  2.31M|    } else if (match("<")) {
  ------------------
  |  Branch (547:16): [True: 1.29M, False: 1.02M]
  ------------------
  548|  1.29M|      parseElement(par);
  549|  1.29M|    } else {
  550|  1.02M|      parseCharData(par);
  551|  1.02M|    }
  552|  2.42M|  }
  553|       |
  554|   293k|  delete endType;
  555|   293k|}
_ZN5ZxDoc13parseCharDataEP9ZxElement:
  557|  1.02M|void ZxDoc::parseCharData(ZxElement *par) {
  558|  1.02M|  GString *data;
  559|  1.02M|  const char *start;
  560|  1.02M|  char c;
  561|  1.02M|  unsigned int x;
  562|  1.02M|  int n;
  563|       |
  564|  1.02M|  data = new GString();
  565|  2.65M|  while (parsePtr < parseEnd && *parsePtr != '<') {
  ------------------
  |  Branch (565:10): [True: 2.65M, False: 385]
  |  Branch (565:33): [True: 1.62M, False: 1.02M]
  ------------------
  566|  1.62M|    if (*parsePtr == '&') {
  ------------------
  |  Branch (566:9): [True: 430k, False: 1.19M]
  ------------------
  567|   430k|      ++parsePtr;
  568|   430k|      if (parsePtr < parseEnd && *parsePtr == '#') {
  ------------------
  |  Branch (568:11): [True: 430k, False: 5]
  |  Branch (568:34): [True: 185k, False: 245k]
  ------------------
  569|   185k|	++parsePtr;
  570|   185k|	if (parsePtr < parseEnd && *parsePtr == 'x') {
  ------------------
  |  Branch (570:6): [True: 185k, False: 6]
  |  Branch (570:29): [True: 12.7k, False: 172k]
  ------------------
  571|  12.7k|	  ++parsePtr;
  572|  12.7k|	  x = 0;
  573|  22.9k|	  while (parsePtr < parseEnd) {
  ------------------
  |  Branch (573:11): [True: 22.9k, False: 5]
  ------------------
  574|  22.9k|	    c = *parsePtr;
  575|  22.9k|	    if (c >= '0' && c <= '9') {
  ------------------
  |  Branch (575:10): [True: 18.3k, False: 4.65k]
  |  Branch (575:22): [True: 1.51k, False: 16.8k]
  ------------------
  576|  1.51k|	      x = (x << 4) + (c - '0');
  577|  21.4k|	    } else if (c >= 'a' && c <= 'f') {
  ------------------
  |  Branch (577:17): [True: 8.56k, False: 12.9k]
  |  Branch (577:29): [True: 3.31k, False: 5.24k]
  ------------------
  578|  3.31k|	      x = (x << 4) + (10 + c - 'a');
  579|  18.1k|	    } else if (c >= 'A' && c <= 'F') {
  ------------------
  |  Branch (579:17): [True: 11.7k, False: 6.38k]
  |  Branch (579:29): [True: 5.43k, False: 6.33k]
  ------------------
  580|  5.43k|	      x = (x << 4) + (10 + c - 'A');
  581|  12.7k|	    } else {
  582|  12.7k|	      break;
  583|  12.7k|	    }
  584|  10.2k|	    ++parsePtr;
  585|  10.2k|	  }
  586|  12.7k|	  if (parsePtr < parseEnd && *parsePtr == ';') {
  ------------------
  |  Branch (586:8): [True: 12.7k, False: 5]
  |  Branch (586:31): [True: 286, False: 12.4k]
  ------------------
  587|    286|	    ++parsePtr;
  588|    286|	  }
  589|  12.7k|	  appendUTF8(data, x);
  590|   172k|	} else {
  591|   172k|	  x = 0;
  592|   181k|	  while (parsePtr < parseEnd) {
  ------------------
  |  Branch (592:11): [True: 181k, False: 7]
  ------------------
  593|   181k|	    c = *parsePtr;
  594|   181k|	    if (c >= '0' && c <= '9') {
  ------------------
  |  Branch (594:10): [True: 101k, False: 79.9k]
  |  Branch (594:22): [True: 9.06k, False: 92.7k]
  ------------------
  595|  9.06k|	      x = x * 10 + (c - '0');
  596|   172k|	    } else {
  597|   172k|	      break;
  598|   172k|	    }
  599|  9.06k|	    ++parsePtr;
  600|  9.06k|	  }
  601|   172k|	  if (parsePtr < parseEnd && *parsePtr == ';') {
  ------------------
  |  Branch (601:8): [True: 172k, False: 7]
  |  Branch (601:31): [True: 457, False: 172k]
  ------------------
  602|    457|	    ++parsePtr;
  603|    457|	  }
  604|   172k|	  appendUTF8(data, x);
  605|   172k|	}
  606|   245k|      } else {
  607|   245k|	start = parsePtr;
  608|   245k|	for (++parsePtr;
  609|  4.57M|	     parsePtr < parseEnd && *parsePtr != ';' &&
  ------------------
  |  Branch (609:7): [True: 4.57M, False: 38]
  |  Branch (609:30): [True: 4.57M, False: 3.11k]
  ------------------
  610|  4.57M|	       *parsePtr != '<' && *parsePtr != '&';
  ------------------
  |  Branch (610:9): [True: 4.55M, False: 13.5k]
  |  Branch (610:29): [True: 4.32M, False: 228k]
  ------------------
  611|  4.32M|	     ++parsePtr) ;
  612|   245k|	n = (int)(parsePtr - start);
  613|   245k|	if (parsePtr < parseEnd && *parsePtr == ';') {
  ------------------
  |  Branch (613:6): [True: 245k, False: 38]
  |  Branch (613:29): [True: 3.11k, False: 242k]
  ------------------
  614|  3.11k|	  ++parsePtr;
  615|  3.11k|	}
  616|   245k|	if (n == 2 && !strncmp(start, "lt", 2)) {
  ------------------
  |  Branch (616:6): [True: 6.78k, False: 238k]
  |  Branch (616:16): [True: 471, False: 6.31k]
  ------------------
  617|    471|	  data->append('<');
  618|   244k|	} else if (n == 2 && !strncmp(start, "gt", 2)) {
  ------------------
  |  Branch (618:13): [True: 6.31k, False: 238k]
  |  Branch (618:23): [True: 314, False: 6.00k]
  ------------------
  619|    314|	  data->append('>');
  620|   244k|	} else if (n == 3 && !strncmp(start, "amp", 3)) {
  ------------------
  |  Branch (620:13): [True: 93.0k, False: 151k]
  |  Branch (620:23): [True: 0, False: 93.0k]
  ------------------
  621|      0|	  data->append('&');
  622|   244k|	} else if (n == 4 && !strncmp(start, "apos", 4)) {
  ------------------
  |  Branch (622:13): [True: 21.0k, False: 223k]
  |  Branch (622:23): [True: 0, False: 21.0k]
  ------------------
  623|      0|	  data->append('\'');
  624|   244k|	} else if (n == 4 && !strncmp(start, "quot", 4)) {
  ------------------
  |  Branch (624:13): [True: 21.0k, False: 223k]
  |  Branch (624:23): [True: 0, False: 21.0k]
  ------------------
  625|      0|	  data->append('"');
  626|   244k|	} else {
  627|   244k|	  data->append(start - 1, (int)(parsePtr - start) + 1);
  628|   244k|	}
  629|   245k|      }
  630|  1.19M|    } else {
  631|  1.19M|      start = parsePtr;
  632|  1.19M|      for (++parsePtr;
  633|  34.2M|	   parsePtr < parseEnd && *parsePtr != '<' && *parsePtr != '&';
  ------------------
  |  Branch (633:5): [True: 34.2M, False: 333]
  |  Branch (633:28): [True: 33.2M, False: 1.00M]
  |  Branch (633:48): [True: 33.0M, False: 190k]
  ------------------
  634|  33.0M|	   ++parsePtr) ;
  635|  1.19M|      data->append(start, (int)(parsePtr - start));
  636|  1.19M|    }
  637|  1.62M|  }
  638|  1.02M|  par->addChild(new ZxCharData(data, true));
  639|  1.02M|}
_ZN5ZxDoc10appendUTF8EP7GStringj:
  641|   209k|void ZxDoc::appendUTF8(GString *s, unsigned int c) {
  642|   209k|  if (c <= 0x7f) {
  ------------------
  |  Branch (642:7): [True: 204k, False: 5.08k]
  ------------------
  643|   204k|    s->append((char)c);
  644|   204k|  } else if (c <= 0x7ff) {
  ------------------
  |  Branch (644:14): [True: 1.48k, False: 3.59k]
  ------------------
  645|  1.48k|    s->append((char)(0xc0 + (c >> 6)));
  646|  1.48k|    s->append((char)(0x80 + (c & 0x3f)));
  647|  3.59k|  } else if (c <= 0xffff) {
  ------------------
  |  Branch (647:14): [True: 1.74k, False: 1.85k]
  ------------------
  648|  1.74k|    s->append((char)(0xe0 + (c >> 12)));
  649|  1.74k|    s->append((char)(0x80 + ((c >> 6) & 0x3f)));
  650|  1.74k|    s->append((char)(0x80 + (c & 0x3f)));
  651|  1.85k|  } else if (c <= 0x1fffff) {
  ------------------
  |  Branch (651:14): [True: 739, False: 1.11k]
  ------------------
  652|    739|    s->append((char)(0xf0 + (c >> 18)));
  653|    739|    s->append((char)(0x80 + ((c >> 12) & 0x3f)));
  654|    739|    s->append((char)(0x80 + ((c >> 6) & 0x3f)));
  655|    739|    s->append((char)(0x80 + (c & 0x3f)));
  656|  1.11k|  } else if (c <= 0x3ffffff) {
  ------------------
  |  Branch (656:14): [True: 322, False: 789]
  ------------------
  657|    322|    s->append((char)(0xf8 + (c >> 24)));
  658|    322|    s->append((char)(0x80 + ((c >> 18) & 0x3f)));
  659|    322|    s->append((char)(0x80 + ((c >> 12) & 0x3f)));
  660|    322|    s->append((char)(0x80 + ((c >> 6) & 0x3f)));
  661|    322|    s->append((char)(0x80 + (c & 0x3f)));
  662|    789|  } else if (c <= 0x7fffffff) {
  ------------------
  |  Branch (662:14): [True: 379, False: 410]
  ------------------
  663|    379|    s->append((char)(0xfc + (c >> 30)));
  664|    379|    s->append((char)(0x80 + ((c >> 24) & 0x3f)));
  665|    379|    s->append((char)(0x80 + ((c >> 18) & 0x3f)));
  666|    379|    s->append((char)(0x80 + ((c >> 12) & 0x3f)));
  667|    379|    s->append((char)(0x80 + ((c >> 6) & 0x3f)));
  668|    379|    s->append((char)(0x80 + (c & 0x3f)));
  669|    379|  }
  670|   209k|}
_ZN5ZxDoc11parseCDSectEP6ZxNode:
  673|     39|void ZxDoc::parseCDSect(ZxNode *par) {
  674|     39|  const char *start;
  675|       |
  676|     39|  parsePtr += 9;
  677|     39|  start = parsePtr;
  678|  85.8k|  while (parsePtr < parseEnd - 3) {
  ------------------
  |  Branch (678:10): [True: 85.8k, False: 5]
  ------------------
  679|  85.8k|    if (!strncmp(parsePtr, "]]>", 3)) {
  ------------------
  |  Branch (679:9): [True: 34, False: 85.8k]
  ------------------
  680|     34|      par->addChild(new ZxCharData(new GString(start, (int)(parsePtr - start)),
  681|     34|				   false));
  682|     34|      parsePtr += 3;
  683|     34|      return;
  684|     34|    }
  685|  85.8k|    ++parsePtr;
  686|  85.8k|  }
  687|      5|  parsePtr = parseEnd;
  688|      5|  par->addChild(new ZxCharData(new GString(start, (int)(parsePtr - start)),
  689|      5|			       false));
  690|      5|}
_ZN5ZxDoc9parseMiscEP6ZxNode:
  692|  1.96k|void ZxDoc::parseMisc(ZxNode *par) {
  693|  2.34k|  while (1) {
  ------------------
  |  Branch (693:10): [True: 2.34k, Folded]
  ------------------
  694|  2.34k|    if (match("<!--")) {
  ------------------
  |  Branch (694:9): [True: 0, False: 2.34k]
  ------------------
  695|      0|      parseComment(par);
  696|  2.34k|    } else if (match("<?")) {
  ------------------
  |  Branch (696:16): [True: 86, False: 2.25k]
  ------------------
  697|     86|      parsePI(par);
  698|  2.25k|    } else if (parsePtr < parseEnd && (*parsePtr == '\x20' ||
  ------------------
  |  Branch (698:16): [True: 1.69k, False: 566]
  |  Branch (698:40): [True: 0, False: 1.69k]
  ------------------
  699|  1.69k|				       *parsePtr == '\x09' ||
  ------------------
  |  Branch (699:12): [True: 0, False: 1.69k]
  ------------------
  700|  1.69k|				       *parsePtr == '\x0d' ||
  ------------------
  |  Branch (700:12): [True: 1, False: 1.69k]
  ------------------
  701|  1.69k|				       *parsePtr == '\x0a')) {
  ------------------
  |  Branch (701:12): [True: 291, False: 1.39k]
  ------------------
  702|    292|      ++parsePtr;
  703|  1.96k|    } else {
  704|  1.96k|      break;
  705|  1.96k|    }
  706|  2.34k|  }
  707|  1.96k|}
_ZN5ZxDoc12parseCommentEP6ZxNode:
  710|    903|void ZxDoc::parseComment(ZxNode *par) {
  711|    903|  const char *start;
  712|       |
  713|    903|  parsePtr += 4;
  714|    903|  start = parsePtr;
  715|  68.7k|  while (parsePtr <= parseEnd - 3) {
  ------------------
  |  Branch (715:10): [True: 68.7k, False: 0]
  ------------------
  716|  68.7k|    if (!strncmp(parsePtr, "-->", 3)) {
  ------------------
  |  Branch (716:9): [True: 903, False: 67.8k]
  ------------------
  717|    903|      par->addChild(new ZxComment(new GString(start, (int)(parsePtr - start))));
  718|    903|      parsePtr += 3;
  719|    903|      return;
  720|    903|    }
  721|  67.8k|    ++parsePtr;
  722|  67.8k|  }
  723|      0|  parsePtr = parseEnd;
  724|      0|}
_ZN5ZxDoc7parsePIEP6ZxNode:
  727|  25.6k|void ZxDoc::parsePI(ZxNode *par) {
  728|  25.6k|  GString *target;
  729|  25.6k|  const char *start;
  730|       |
  731|  25.6k|  parsePtr += 2;
  732|  25.6k|  target = parseName();
  733|  25.6k|  parseSpace();
  734|  25.6k|  start = parsePtr;
  735|  2.16M|  while (parsePtr <= parseEnd - 2) {
  ------------------
  |  Branch (735:10): [True: 2.16M, False: 51]
  ------------------
  736|  2.16M|    if (!strncmp(parsePtr, "?>", 2)) {
  ------------------
  |  Branch (736:9): [True: 25.6k, False: 2.13M]
  ------------------
  737|  25.6k|      par->addChild(new ZxPI(target, new GString(start,
  738|  25.6k|						 (int)(parsePtr - start))));
  739|  25.6k|      parsePtr += 2;
  740|  25.6k|      return;
  741|  25.6k|    }
  742|  2.13M|    ++parsePtr;
  743|  2.13M|  }
  744|     51|  parsePtr = parseEnd;
  745|     51|  par->addChild(new ZxPI(target, new GString(start, (int)(parsePtr - start))));
  746|     51|}
_ZN5ZxDoc9parseNameEv:
  750|  2.76M|GString *ZxDoc::parseName() {
  751|  2.76M|  GString *name;
  752|       |
  753|  2.76M|  name = new GString();
  754|  2.76M|  if (parsePtr < parseEnd && nameStartChar[*parsePtr & 0xff]) {
  ------------------
  |  Branch (754:7): [True: 2.76M, False: 109]
  |  Branch (754:30): [True: 1.43M, False: 1.32M]
  ------------------
  755|  1.43M|    name->append(*parsePtr++);
  756|  5.25M|    while (parsePtr < parseEnd && nameChar[*parsePtr & 0xff]) {
  ------------------
  |  Branch (756:12): [True: 5.25M, False: 17]
  |  Branch (756:35): [True: 3.81M, False: 1.43M]
  ------------------
  757|  3.81M|      name->append(*parsePtr++);
  758|  3.81M|    }
  759|  1.43M|  }
  760|  2.76M|  return name;
  761|  2.76M|}
_ZN5ZxDoc17parseQuotedStringEv:
  763|    528|GString *ZxDoc::parseQuotedString() {
  764|    528|  GString *s;
  765|    528|  const char *start;
  766|    528|  char quote;
  767|       |
  768|    528|  if (parsePtr < parseEnd && (*parsePtr == '"' || *parsePtr == '\'')) {
  ------------------
  |  Branch (768:7): [True: 528, False: 0]
  |  Branch (768:31): [True: 518, False: 10]
  |  Branch (768:51): [True: 4, False: 6]
  ------------------
  769|    522|    quote = *parsePtr++;
  770|    522|    start = parsePtr;
  771|  9.32k|    while (parsePtr < parseEnd && *parsePtr != quote) {
  ------------------
  |  Branch (771:12): [True: 9.32k, False: 0]
  |  Branch (771:35): [True: 8.79k, False: 522]
  ------------------
  772|  8.79k|      ++parsePtr;
  773|  8.79k|    }
  774|    522|    s = new GString(start, (int)(parsePtr - start));
  775|    522|    if (parsePtr < parseEnd && *parsePtr == quote) {
  ------------------
  |  Branch (775:9): [True: 522, False: 0]
  |  Branch (775:32): [True: 522, False: 0]
  ------------------
  776|    522|      ++parsePtr;
  777|    522|    }
  778|    522|  } else {
  779|      6|    s = new GString();
  780|      6|  }
  781|    528|  return s;
  782|    528|}
_ZN5ZxDoc8parseBOMEv:
  784|    655|void ZxDoc::parseBOM() {
  785|    655|  if (match("\xef\xbb\xbf")) {
  ------------------
  |  Branch (785:7): [True: 3, False: 652]
  ------------------
  786|      3|    parsePtr += 3;
  787|      3|  }
  788|    655|}
_ZN5ZxDoc10parseSpaceEv:
  790|  3.15M|void ZxDoc::parseSpace() {
  791|  5.49M|  while (parsePtr < parseEnd && (*parsePtr == '\x20' ||
  ------------------
  |  Branch (791:10): [True: 5.49M, False: 214]
  |  Branch (791:34): [True: 2.10M, False: 3.39M]
  ------------------
  792|  3.39M|				 *parsePtr == '\x09' ||
  ------------------
  |  Branch (792:6): [True: 10.6k, False: 3.38M]
  ------------------
  793|  3.38M|				 *parsePtr == '\x0d' ||
  ------------------
  |  Branch (793:6): [True: 26.5k, False: 3.35M]
  ------------------
  794|  3.35M|				 *parsePtr == '\x0a')) {
  ------------------
  |  Branch (794:6): [True: 199k, False: 3.15M]
  ------------------
  795|  2.34M|    ++parsePtr;
  796|  2.34M|  }
  797|  3.15M|}
_ZN5ZxDoc5matchEPKc:
  799|  15.8M|bool ZxDoc::match(const char *s) {
  800|  15.8M|  int n;
  801|       |
  802|  15.8M|  n = (int)strlen(s);
  803|  15.8M|  return parseEnd - parsePtr >= n && !strncmp(parsePtr, s, n);
  ------------------
  |  Branch (803:10): [True: 15.8M, False: 2.07k]
  |  Branch (803:38): [True: 1.95M, False: 13.8M]
  ------------------
  804|  15.8M|}
_ZN9ZxXMLDeclC2EP7GStringS1_b:
  822|    277|ZxXMLDecl::ZxXMLDecl(GString *versionA, GString *encodingA, bool standaloneA) {
  823|    277|  version = versionA;
  824|    277|  encoding = encodingA;
  825|    277|  standalone = standaloneA;
  826|    277|}
_ZN9ZxXMLDeclD2Ev:
  828|    277|ZxXMLDecl::~ZxXMLDecl() {
  829|    277|  delete version;
  830|    277|  if (encoding) {
  ------------------
  |  Branch (830:7): [True: 248, False: 29]
  ------------------
  831|    248|    delete encoding;
  832|    248|  }
  833|    277|}
_ZN13ZxDocTypeDeclC2EP7GString:
  858|      1|ZxDocTypeDecl::ZxDocTypeDecl(GString *nameA) {
  859|      1|  name = nameA;
  860|      1|}
_ZN13ZxDocTypeDeclD2Ev:
  862|      1|ZxDocTypeDecl::~ZxDocTypeDecl() {
  863|      1|  delete name;
  864|      1|}
_ZN9ZxCommentC2EP7GString:
  880|    903|ZxComment::ZxComment(GString *textA) {
  881|    903|  text = textA;
  882|    903|}
_ZN9ZxCommentD2Ev:
  884|    903|ZxComment::~ZxComment() {
  885|    903|  delete text;
  886|    903|}
_ZN4ZxPIC2EP7GStringS1_:
  902|  25.6k|ZxPI::ZxPI(GString *targetA, GString *textA) {
  903|  25.6k|  target = targetA;
  904|  25.6k|  text = textA;
  905|  25.6k|}
_ZN4ZxPID2Ev:
  907|  25.6k|ZxPI::~ZxPI() {
  908|  25.6k|  delete target;
  909|  25.6k|  delete text;
  910|  25.6k|}
_ZN9ZxElementC2EP7GString:
  928|  1.29M|ZxElement::ZxElement(GString *typeA) {
  929|  1.29M|  type = typeA;
  930|  1.29M|  attrs = new GHash();
  931|       |  firstAttr = lastAttr = NULL;
  932|  1.29M|}
_ZN9ZxElementD2Ev:
  934|  1.29M|ZxElement::~ZxElement() {
  935|  1.29M|  delete type;
  936|  1.29M|  deleteGHash(attrs, ZxAttr);
  ------------------
  |  |   60|  1.29M|  do {                                             \
  |  |   61|  1.29M|    GHash *_hash = (hash);                         \
  |  |   62|  1.29M|    {                                              \
  |  |   63|  1.29M|      GHashIter *_iter;                            \
  |  |   64|  1.29M|      GString *_key;                               \
  |  |   65|  1.29M|      void *_p;                                    \
  |  |   66|  1.29M|      _hash->startIter(&_iter);                    \
  |  |   67|  1.44M|      while (_hash->getNext(&_iter, &_key, &_p)) { \
  |  |  ------------------
  |  |  |  Branch (67:14): [True: 145k, False: 1.29M]
  |  |  ------------------
  |  |   68|   145k|        delete (T*)_p;                             \
  |  |   69|   145k|      }                                            \
  |  |   70|  1.29M|      delete _hash;                                \
  |  |   71|  1.29M|    }                                              \
  |  |   72|  1.29M|  } while(0)
  |  |  ------------------
  |  |  |  Branch (72:11): [Folded, False: 1.29M]
  |  |  ------------------
  ------------------
  937|  1.29M|}
_ZN9ZxElement9isElementEPKc:
  939|  1.63M|bool ZxElement::isElement(const char *typeA) {
  940|  1.63M|  return !type->cmp(typeA);
  941|  1.63M|}
_ZN9ZxElement8findAttrEPKc:
  943|   350k|ZxAttr *ZxElement::findAttr(const char *attrName) {
  944|   350k|  return (ZxAttr *)attrs->lookup(attrName);
  945|   350k|}
_ZN9ZxElement7addAttrEP6ZxAttr:
  947|   145k|void ZxElement::addAttr(ZxAttr *attr) {
  948|   145k|  attrs->add(attr->getName(), attr);
  949|   145k|  if (lastAttr) {
  ------------------
  |  Branch (949:7): [True: 49.0k, False: 96.3k]
  ------------------
  950|  49.0k|    lastAttr->next = attr;
  951|  49.0k|    lastAttr= attr;
  952|  96.3k|  } else {
  953|  96.3k|    firstAttr = lastAttr = attr;
  954|  96.3k|  }
  955|   145k|  attr->parent = this;
  956|       |  attr->next = NULL;
  957|   145k|}
_ZN6ZxAttrC2EP7GStringS1_:
 1025|   145k|ZxAttr::ZxAttr(GString *nameA, GString *valueA) {
 1026|   145k|  name = nameA;
 1027|   145k|  value = valueA;
 1028|   145k|  parent = NULL;
 1029|       |  next = NULL;
 1030|   145k|}
_ZN6ZxAttrD2Ev:
 1032|   145k|ZxAttr::~ZxAttr() {
 1033|   145k|  delete name;
 1034|   145k|  delete value;
 1035|   145k|}
_ZN10ZxCharDataC2EP7GStringb:
 1039|  1.02M|ZxCharData::ZxCharData(GString *dataA, bool parsedA) {
 1040|  1.02M|  data = dataA;
 1041|  1.02M|  parsed = parsedA;
 1042|  1.02M|}
_ZN10ZxCharDataD2Ev:
 1044|  1.02M|ZxCharData::~ZxCharData() {
 1045|  1.02M|  delete data;
 1046|  1.02M|}

_ZN5ZxDoc7getRootEv:
   88|  2.40k|  ZxElement *getRoot() { return root; }
_ZN10ZxCharData7getDataEv:
  257|  3.20k|  GString *getData() { return data; }
_ZN6ZxAttr8getValueEv:
  234|  43.4k|  GString *getValue() { return value; }
_ZN9ZxElement7getTypeEv:
  209|   446k|  GString *getType() { return type; }
_ZN6ZxNode9isXMLDeclEv:
   36|    688|  virtual bool isXMLDecl()  { return false; }
_ZN6ZxNode13isDocTypeDeclEv:
   37|    687|  virtual bool isDocTypeDecl() { return false; }
_ZN6ZxNode9isElementEv:
   40|   175k|  virtual bool isElement() { return false; }
_ZN6ZxNode9isElementEPKc:
   41|   211k|  virtual bool isElement(const char *type) { return false; }
_ZN6ZxNode10isCharDataEv:
   42|  1.39k|  virtual bool isCharData() { return false; }
_ZN6ZxNode13getFirstChildEv:
   43|   196k|  virtual ZxNode *getFirstChild() { return firstChild; }
_ZN6ZxNode12getNextChildEv:
   44|   514k|  virtual ZxNode *getNextChild() { return next; }
_ZN9ZxXMLDecl9isXMLDeclEv:
  129|    277|  virtual bool isXMLDecl() { return true; }
_ZN13ZxDocTypeDecl13isDocTypeDeclEv:
  151|      1|  virtual bool isDocTypeDecl() { return true; }
_ZN9ZxElement9isElementEv:
  207|   344k|  virtual bool isElement() { return true; }
_ZN6ZxAttr7getNameEv:
  233|   145k|  GString *getName() { return name; }
_ZN10ZxCharData10isCharDataEv:
  256|  3.20k|  virtual bool isCharData() { return true; }

