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

_ZN5GHashC2Ei:
   34|  1.63M|GHash::GHash(GBool deleteKeysA) {
   35|  1.63M|  int h;
   36|       |
   37|  1.63M|  deleteKeys = deleteKeysA;
   38|  1.63M|  size = 7;
   39|  1.63M|  tab = (GHashBucket **)gmallocn(size, sizeof(GHashBucket *));
   40|  13.0M|  for (h = 0; h < size; ++h) {
  ------------------
  |  Branch (40:15): [True: 11.4M, False: 1.63M]
  ------------------
   41|       |    tab[h] = NULL;
   42|  11.4M|  }
   43|  1.63M|  len = 0;
   44|  1.63M|}
_ZN5GHashD2Ev:
   46|  1.63M|GHash::~GHash() {
   47|  1.63M|  GHashBucket *p;
   48|  1.63M|  int h;
   49|       |
   50|  13.0M|  for (h = 0; h < size; ++h) {
  ------------------
  |  Branch (50:15): [True: 11.4M, False: 1.63M]
  ------------------
   51|  11.6M|    while (tab[h]) {
  ------------------
  |  Branch (51:12): [True: 235k, False: 11.4M]
  ------------------
   52|   235k|      p = tab[h];
   53|   235k|      tab[h] = p->next;
   54|   235k|      if (deleteKeys) {
  ------------------
  |  Branch (54:11): [True: 8.92k, False: 227k]
  ------------------
   55|  8.92k|	delete p->key;
   56|  8.92k|      }
   57|   235k|      delete p;
   58|   235k|    }
   59|  11.4M|  }
   60|  1.63M|  gfree(tab);
   61|  1.63M|}
_ZN5GHash3addEP7GStringPv:
   63|   208k|void GHash::add(GString *key, void *val) {
   64|   208k|  GHashBucket *p;
   65|   208k|  int h;
   66|       |
   67|       |  // expand the table if necessary
   68|   208k|  if (len >= size) {
  ------------------
  |  Branch (68:7): [True: 888, False: 208k]
  ------------------
   69|    888|    expand();
   70|    888|  }
   71|       |
   72|       |  // add the new symbol
   73|   208k|  p = new GHashBucket;
   74|   208k|  p->key = key;
   75|   208k|  p->val.p = val;
   76|   208k|  h = hash(key);
   77|   208k|  p->next = tab[h];
   78|   208k|  tab[h] = p;
   79|   208k|  ++len;
   80|   208k|}
_ZN5GHash3addEP7GStringi:
   82|  26.9k|void GHash::add(GString *key, int val) {
   83|  26.9k|  GHashBucket *p;
   84|  26.9k|  int h;
   85|       |
   86|       |  // expand the table if necessary
   87|  26.9k|  if (len >= size) {
  ------------------
  |  Branch (87:7): [True: 406, False: 26.5k]
  ------------------
   88|    406|    expand();
   89|    406|  }
   90|       |
   91|       |  // add the new symbol
   92|  26.9k|  p = new GHashBucket;
   93|  26.9k|  p->key = key;
   94|  26.9k|  p->val.i = val;
   95|  26.9k|  h = hash(key);
   96|  26.9k|  p->next = tab[h];
   97|  26.9k|  tab[h] = p;
   98|  26.9k|  ++len;
   99|  26.9k|}
_ZN5GHash7replaceEP7GStringi:
  115|  35.6k|void GHash::replace(GString *key, int val) {
  116|  35.6k|  GHashBucket *p;
  117|  35.6k|  int h;
  118|       |
  119|  35.6k|  if ((p = find(key, &h))) {
  ------------------
  |  Branch (119:7): [True: 8.69k, False: 26.9k]
  ------------------
  120|  8.69k|    p->val.i = val;
  121|  8.69k|    if (deleteKeys) {
  ------------------
  |  Branch (121:9): [True: 0, False: 8.69k]
  ------------------
  122|      0|      delete key;
  123|      0|    }
  124|  26.9k|  } else {
  125|  26.9k|    add(key, val);
  126|  26.9k|  }
  127|  35.6k|}
_ZN5GHash6lookupEP7GString:
  129|  5.35k|void *GHash::lookup(GString *key) {
  130|  5.35k|  GHashBucket *p;
  131|  5.35k|  int h;
  132|       |
  133|  5.35k|  if (!(p = find(key, &h))) {
  ------------------
  |  Branch (133:7): [True: 5.33k, False: 12]
  ------------------
  134|  5.33k|    return NULL;
  135|  5.33k|  }
  136|     12|  return p->val.p;
  137|  5.35k|}
_ZN5GHash9lookupIntEP7GString:
  139|  35.6k|int GHash::lookupInt(GString *key) {
  140|  35.6k|  GHashBucket *p;
  141|  35.6k|  int h;
  142|       |
  143|  35.6k|  if (!(p = find(key, &h))) {
  ------------------
  |  Branch (143:7): [True: 26.9k, False: 8.69k]
  ------------------
  144|  26.9k|    return 0;
  145|  26.9k|  }
  146|  8.69k|  return p->val.i;
  147|  35.6k|}
_ZN5GHash6lookupEPKc:
  149|   794k|void *GHash::lookup(const char *key) {
  150|   794k|  GHashBucket *p;
  151|   794k|  int h;
  152|       |
  153|   794k|  if (!(p = find(key, &h))) {
  ------------------
  |  Branch (153:7): [True: 758k, False: 36.8k]
  ------------------
  154|   758k|    return NULL;
  155|   758k|  }
  156|  36.8k|  return p->val.p;
  157|   794k|}
_ZN5GHash9startIterEPP9GHashIter:
  261|  1.58M|void GHash::startIter(GHashIter **iter) {
  262|  1.58M|  *iter = new GHashIter;
  263|  1.58M|  (*iter)->h = -1;
  264|       |  (*iter)->p = NULL;
  265|  1.58M|}
_ZN5GHash7getNextEPP9GHashIterPP7GStringPPv:
  267|  1.79M|GBool GHash::getNext(GHashIter **iter, GString **key, void **val) {
  268|  1.79M|  if (!*iter) {
  ------------------
  |  Branch (268:7): [True: 0, False: 1.79M]
  ------------------
  269|      0|    return gFalse;
  ------------------
  |  |   18|      0|#define gFalse 0
  ------------------
  270|      0|  }
  271|  1.79M|  if ((*iter)->p) {
  ------------------
  |  Branch (271:7): [True: 208k, False: 1.58M]
  ------------------
  272|   208k|    (*iter)->p = (*iter)->p->next;
  273|   208k|  }
  274|  12.9M|  while (!(*iter)->p) {
  ------------------
  |  Branch (274:10): [True: 12.7M, False: 208k]
  ------------------
  275|  12.7M|    if (++(*iter)->h == size) {
  ------------------
  |  Branch (275:9): [True: 1.58M, False: 11.1M]
  ------------------
  276|  1.58M|      delete *iter;
  277|  1.58M|      *iter = NULL;
  278|  1.58M|      return gFalse;
  ------------------
  |  |   18|  1.58M|#define gFalse 0
  ------------------
  279|  1.58M|    }
  280|  11.1M|    (*iter)->p = tab[(*iter)->h];
  281|  11.1M|  }
  282|   208k|  *key = (*iter)->p->key;
  283|   208k|  *val = (*iter)->p->val.p;
  284|   208k|  return gTrue;
  ------------------
  |  |   17|   208k|#define gTrue 1
  ------------------
  285|  1.79M|}
_ZN5GHash6expandEv:
  312|  1.29k|void GHash::expand() {
  313|  1.29k|  GHashBucket **oldTab;
  314|  1.29k|  GHashBucket *p;
  315|  1.29k|  int oldSize, h, i;
  316|       |
  317|  1.29k|  oldSize = size;
  318|  1.29k|  oldTab = tab;
  319|  1.29k|  size = 2*size + 1;
  320|  1.29k|  tab = (GHashBucket **)gmallocn(size, sizeof(GHashBucket *));
  321|  37.6k|  for (h = 0; h < size; ++h) {
  ------------------
  |  Branch (321:15): [True: 36.4k, False: 1.29k]
  ------------------
  322|  36.4k|    tab[h] = NULL;
  323|  36.4k|  }
  324|  18.8k|  for (i = 0; i < oldSize; ++i) {
  ------------------
  |  Branch (324:15): [True: 17.5k, False: 1.29k]
  ------------------
  325|  35.1k|    while (oldTab[i]) {
  ------------------
  |  Branch (325:12): [True: 17.5k, False: 17.5k]
  ------------------
  326|  17.5k|      p = oldTab[i];
  327|  17.5k|      oldTab[i] = oldTab[i]->next;
  328|  17.5k|      h = hash(p->key);
  329|  17.5k|      p->next = tab[h];
  330|  17.5k|      tab[h] = p;
  331|  17.5k|    }
  332|  17.5k|  }
  333|  1.29k|  gfree(oldTab);
  334|  1.29k|}
_ZN5GHash4findEP7GStringPi:
  336|  76.7k|GHashBucket *GHash::find(GString *key, int *h) {
  337|  76.7k|  GHashBucket *p;
  338|       |
  339|  76.7k|  *h = hash(key);
  340|  88.4k|  for (p = tab[*h]; p; p = p->next) {
  ------------------
  |  Branch (340:21): [True: 29.0k, False: 59.3k]
  ------------------
  341|  29.0k|    if (!p->key->cmp(key)) {
  ------------------
  |  Branch (341:9): [True: 17.3k, False: 11.6k]
  ------------------
  342|  17.3k|      return p;
  343|  17.3k|    }
  344|  29.0k|  }
  345|  59.3k|  return NULL;
  346|  76.7k|}
_ZN5GHash4findEPKcPi:
  348|   794k|GHashBucket *GHash::find(const char *key, int *h) {
  349|   794k|  GHashBucket *p;
  350|       |
  351|   794k|  *h = hash(key);
  352|   803k|  for (p = tab[*h]; p; p = p->next) {
  ------------------
  |  Branch (352:21): [True: 45.1k, False: 758k]
  ------------------
  353|  45.1k|    if (!p->key->cmp(key)) {
  ------------------
  |  Branch (353:9): [True: 36.8k, False: 8.35k]
  ------------------
  354|  36.8k|      return p;
  355|  36.8k|    }
  356|  45.1k|  }
  357|   758k|  return NULL;
  358|   794k|}
_ZN5GHash4hashEP7GString:
  360|   330k|int GHash::hash(GString *key) {
  361|   330k|  const char *p;
  362|   330k|  unsigned int h;
  363|   330k|  int i;
  364|       |
  365|   330k|  h = 0;
  366|  71.3M|  for (p = key->getCString(), i = 0; i < key->getLength(); ++p, ++i) {
  ------------------
  |  Branch (366:38): [True: 71.0M, False: 330k]
  ------------------
  367|  71.0M|    h = 17 * h + (int)(*p & 0xff);
  368|  71.0M|  }
  369|   330k|  return (int)(h % size);
  370|   330k|}
_ZN5GHash4hashEPKc:
  372|   794k|int GHash::hash(const char *key) {
  373|   794k|  const char *p;
  374|   794k|  unsigned int h;
  375|       |
  376|   794k|  h = 0;
  377|  7.41M|  for (p = key; *p; ++p) {
  ------------------
  |  Branch (377:17): [True: 6.62M, False: 794k]
  ------------------
  378|  6.62M|    h = 17 * h + (int)(*p & 0xff);
  379|  6.62M|  }
  380|   794k|  return (int)(h % size);
  381|   794k|}

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

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

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

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

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

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

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

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

_ZN8AcroForm4loadEP6PDFDocP7CatalogP6Object:
  337|  2.97k|AcroForm *AcroForm::load(PDFDoc *docA, Catalog *catalog, Object *acroFormObjA) {
  338|  2.97k|  Object acroFormObj2;
  339|  2.97k|  AcroForm *acroForm;
  340|  2.97k|  AcroFormField *field;
  341|  2.97k|  Object xfaObj, fieldsObj, annotsObj, annotRef, annotObj, obj1, obj2;
  342|  2.97k|  char *touchedObjs;
  343|  2.97k|  int pageNum, i, j;
  344|       |
  345|  2.97k|  touchedObjs = (char *)gmalloc(docA->getXRef()->getNumObjects());
  346|  2.97k|  memset(touchedObjs, 0, docA->getXRef()->getNumObjects());
  347|       |
  348|       |  // this is the normal case: acroFormObj is a dictionary, as expected
  349|  2.97k|  if (acroFormObjA->isDict()) {
  ------------------
  |  Branch (349:7): [True: 1.58k, False: 1.39k]
  ------------------
  350|  1.58k|    acroForm = new AcroForm(docA, acroFormObjA);
  351|       |
  352|  1.58k|    if (globalParams->getEnableXFA()) {
  ------------------
  |  Branch (352:9): [True: 1.58k, False: 0]
  ------------------
  353|  1.58k|      if (!acroFormObjA->dictLookup("XFA", &xfaObj)->isNull()) {
  ------------------
  |  Branch (353:11): [True: 1.29k, False: 287]
  ------------------
  354|  1.29k|	acroForm->xfaScanner = XFAScanner::load(&xfaObj);
  355|  1.29k|	if (!catalog->getNeedsRendering()) {
  ------------------
  |  Branch (355:6): [True: 1.28k, False: 7]
  ------------------
  356|  1.28k|	  acroForm->isStaticXFA = gTrue;
  ------------------
  |  |   17|  1.28k|#define gTrue 1
  ------------------
  357|  1.28k|	}
  358|  1.29k|      }
  359|  1.58k|      xfaObj.free();
  360|  1.58k|    }
  361|       |
  362|  1.58k|    if (acroFormObjA->dictLookup("NeedAppearances", &obj1)->isBool()) {
  ------------------
  |  Branch (362:9): [True: 45, False: 1.53k]
  ------------------
  363|     45|      acroForm->needAppearances = obj1.getBool();
  364|     45|    }
  365|  1.58k|    obj1.free();
  366|       |
  367|  1.58k|    acroForm->buildAnnotPageList(catalog);
  368|       |
  369|  1.58k|    if (!acroFormObjA->dictLookup("Fields", &obj1)->isArray()) {
  ------------------
  |  Branch (369:9): [True: 11, False: 1.57k]
  ------------------
  370|     11|      if (!obj1.isNull()) {
  ------------------
  |  Branch (370:11): [True: 0, False: 11]
  ------------------
  371|      0|	error(errSyntaxError, -1, "AcroForm Fields entry is wrong type");
  372|      0|      }
  373|     11|      obj1.free();
  374|     11|      delete acroForm;
  375|     11|      gfree(touchedObjs);
  376|     11|      return NULL;
  377|     11|    }
  378|  42.5k|    for (i = 0; i < obj1.arrayGetLength(); ++i) {
  ------------------
  |  Branch (378:17): [True: 40.9k, False: 1.57k]
  ------------------
  379|  40.9k|      obj1.arrayGetNF(i, &obj2);
  380|  40.9k|      acroForm->scanField(&obj2, touchedObjs);
  381|  40.9k|      obj2.free();
  382|  40.9k|    }
  383|  1.57k|    obj1.free();
  384|       |
  385|       |    // scan the annotations, looking for Widget-type annots that are
  386|       |    // not attached to the AcroForm object
  387|   175k|    for (pageNum = 1; pageNum <= catalog->getNumPages(); ++pageNum) {
  ------------------
  |  Branch (387:23): [True: 173k, False: 1.57k]
  ------------------
  388|   173k|      if (catalog->getPage(pageNum)->getAnnots(&annotsObj)->isArray()) {
  ------------------
  |  Branch (388:11): [True: 147k, False: 26.8k]
  ------------------
  389|  4.47M|	for (i = 0; i < annotsObj.arrayGetLength(); ++i) {
  ------------------
  |  Branch (389:14): [True: 4.33M, False: 147k]
  ------------------
  390|  4.33M|	  if (annotsObj.arrayGetNF(i, &annotRef)->isRef()) {
  ------------------
  |  Branch (390:8): [True: 1.17M, False: 3.15M]
  ------------------
  391|  1.40M|	    for (j = 0; j < acroForm->fields->getLength(); ++j) {
  ------------------
  |  Branch (391:18): [True: 321k, False: 1.08M]
  ------------------
  392|   321k|	      field = (AcroFormField *)acroForm->fields->get(j);
  393|   321k|	      if (field->fieldRef.isRef()) {
  ------------------
  |  Branch (393:12): [True: 258k, False: 62.3k]
  ------------------
  394|   258k|		if (field->fieldRef.getRefNum() == annotRef.getRefNum() &&
  ------------------
  |  Branch (394:7): [True: 120k, False: 137k]
  ------------------
  395|   120k|		    field->fieldRef.getRefGen() == annotRef.getRefGen()) {
  ------------------
  |  Branch (395:7): [True: 90.7k, False: 30.2k]
  ------------------
  396|  90.7k|		  break;
  397|  90.7k|		}
  398|   258k|	      }
  399|   321k|	    }
  400|  1.17M|	    if (j == acroForm->fields->getLength()) {
  ------------------
  |  Branch (400:10): [True: 1.08M, False: 90.7k]
  ------------------
  401|  1.08M|	      annotRef.fetch(acroForm->doc->getXRef(), &annotObj);
  402|  1.08M|	      if (annotObj.isDict()) {
  ------------------
  |  Branch (402:12): [True: 270k, False: 811k]
  ------------------
  403|   270k|		if (annotObj.dictLookup("Subtype", &obj1)->isName("Widget")) {
  ------------------
  |  Branch (403:7): [True: 137k, False: 133k]
  ------------------
  404|   137k|		  acroForm->scanField(&annotRef, touchedObjs);
  405|   137k|		}
  406|   270k|		obj1.free();
  407|   270k|	      }
  408|  1.08M|	      annotObj.free();
  409|  1.08M|	    }
  410|  1.17M|	  }
  411|  4.33M|	  annotRef.free();
  412|  4.33M|	}
  413|   147k|      }
  414|   173k|      annotsObj.free();
  415|   173k|    }
  416|       |
  417|       |  // if acroFormObjA is a null object, but there are Widget-type
  418|       |  // annots, we still create an AcroForm
  419|  1.57k|  } else {
  420|       |    // create an empty dict for acroFormObj
  421|  1.39k|    acroFormObj2.initDict(docA->getXRef());
  422|  1.39k|    acroForm = new AcroForm(docA, &acroFormObj2);
  423|  1.39k|    acroFormObj2.free();
  424|       |
  425|  1.39k|    acroForm->buildAnnotPageList(catalog);
  426|       |
  427|       |    // scan the annotations, looking for any Widget-type annots
  428|  39.4k|    for (pageNum = 1; pageNum <= catalog->getNumPages(); ++pageNum) {
  ------------------
  |  Branch (428:23): [True: 38.0k, False: 1.39k]
  ------------------
  429|  38.0k|      if (catalog->getPage(pageNum)->getAnnots(&annotsObj)->isArray()) {
  ------------------
  |  Branch (429:11): [True: 23.8k, False: 14.1k]
  ------------------
  430|   661k|	for (i = 0; i < annotsObj.arrayGetLength(); ++i) {
  ------------------
  |  Branch (430:14): [True: 637k, False: 23.8k]
  ------------------
  431|   637k|	  if (annotsObj.arrayGetNF(i, &annotRef)->isRef()) {
  ------------------
  |  Branch (431:8): [True: 140k, False: 497k]
  ------------------
  432|   140k|	    annotRef.fetch(acroForm->doc->getXRef(), &annotObj);
  433|   140k|	    if (annotObj.isDict()) {
  ------------------
  |  Branch (433:10): [True: 69.2k, False: 70.8k]
  ------------------
  434|  69.2k|	      if (annotObj.dictLookup("Subtype", &obj1)->isName("Widget")) {
  ------------------
  |  Branch (434:12): [True: 22.2k, False: 46.9k]
  ------------------
  435|  22.2k|		acroForm->scanField(&annotRef, touchedObjs);
  436|  22.2k|	      }
  437|  69.2k|	      obj1.free();
  438|  69.2k|	    }
  439|   140k|	    annotObj.free();
  440|   140k|	  }
  441|   637k|	  annotRef.free();
  442|   637k|	}
  443|  23.8k|      }
  444|  38.0k|      annotsObj.free();
  445|  38.0k|    }
  446|       |
  447|  1.39k|    if (acroForm->fields->getLength() == 0) {
  ------------------
  |  Branch (447:9): [True: 1.38k, False: 13]
  ------------------
  448|  1.38k|      delete acroForm;
  449|  1.38k|      acroForm = NULL;
  450|  1.38k|    }
  451|  1.39k|  }
  452|       |
  453|  2.96k|  gfree(touchedObjs);
  454|       |
  455|  2.96k|  return acroForm;
  456|  2.97k|}
_ZN8AcroFormC2EP6PDFDocP6Object:
  458|  2.97k|AcroForm::AcroForm(PDFDoc *docA, Object *acroFormObjA) {
  459|  2.97k|  doc = docA;
  460|  2.97k|  acroFormObjA->copy(&acroFormObj);
  461|  2.97k|  needAppearances = gFalse;
  ------------------
  |  |   18|  2.97k|#define gFalse 0
  ------------------
  462|  2.97k|  annotPages = new GList();
  463|  2.97k|  fields = new GList();
  464|  2.97k|  xfaScanner = NULL;
  465|  2.97k|  isStaticXFA = gFalse;
  ------------------
  |  |   18|  2.97k|#define gFalse 0
  ------------------
  466|  2.97k|}
_ZN8AcroFormD2Ev:
  468|  2.97k|AcroForm::~AcroForm() {
  469|  2.97k|  acroFormObj.free();
  470|  2.97k|  deleteGList(annotPages, AcroFormAnnotPage);
  ------------------
  |  |   94|  2.97k|  do {                                              \
  |  |   95|  2.97k|    GList *_list = (list);                          \
  |  |   96|  2.97k|    {                                               \
  |  |   97|  2.97k|      int _i;                                       \
  |  |   98|  1.31M|      for (_i = 0; _i < _list->getLength(); ++_i) { \
  |  |  ------------------
  |  |  |  Branch (98:20): [True: 1.31M, False: 2.97k]
  |  |  ------------------
  |  |   99|  1.31M|        delete (T*)_list->get(_i);                  \
  |  |  100|  1.31M|      }                                             \
  |  |  101|  2.97k|      delete _list;                                 \
  |  |  102|  2.97k|    }                                               \
  |  |  103|  2.97k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (103:12): [Folded, False: 2.97k]
  |  |  ------------------
  ------------------
  471|  2.97k|  deleteGList(fields, AcroFormField);
  ------------------
  |  |   94|  2.97k|  do {                                              \
  |  |   95|  2.97k|    GList *_list = (list);                          \
  |  |   96|  2.97k|    {                                               \
  |  |   97|  2.97k|      int _i;                                       \
  |  |   98|  6.66k|      for (_i = 0; _i < _list->getLength(); ++_i) { \
  |  |  ------------------
  |  |  |  Branch (98:20): [True: 3.68k, False: 2.97k]
  |  |  ------------------
  |  |   99|  3.68k|        delete (T*)_list->get(_i);                  \
  |  |  100|  3.68k|      }                                             \
  |  |  101|  2.97k|      delete _list;                                 \
  |  |  102|  2.97k|    }                                               \
  |  |  103|  2.97k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (103:12): [Folded, False: 2.97k]
  |  |  ------------------
  ------------------
  472|  2.97k|  delete xfaScanner;
  473|  2.97k|}
_ZN8AcroForm18buildAnnotPageListEP7Catalog:
  479|  2.97k|void AcroForm::buildAnnotPageList(Catalog *catalog) {
  480|  2.97k|  Object annotsObj, annotObj;
  481|  2.97k|  int pageNum, i;
  482|       |
  483|   214k|  for (pageNum = 1; pageNum <= catalog->getNumPages(); ++pageNum) {
  ------------------
  |  Branch (483:21): [True: 211k, False: 2.97k]
  ------------------
  484|   211k|    if (catalog->getPage(pageNum)->getAnnots(&annotsObj)->isArray()) {
  ------------------
  |  Branch (484:9): [True: 170k, False: 41.0k]
  ------------------
  485|  5.13M|      for (i = 0; i < annotsObj.arrayGetLength(); ++i) {
  ------------------
  |  Branch (485:19): [True: 4.96M, False: 170k]
  ------------------
  486|  4.96M|	if (annotsObj.arrayGetNF(i, &annotObj)->isRef()) {
  ------------------
  |  Branch (486:6): [True: 1.31M, False: 3.65M]
  ------------------
  487|  1.31M|	  annotPages->append(new AcroFormAnnotPage(annotObj.getRefNum(),
  488|  1.31M|						   annotObj.getRefGen(),
  489|  1.31M|						   pageNum));
  490|  1.31M|	}
  491|  4.96M|	annotObj.free();
  492|  4.96M|      }
  493|   170k|    }
  494|   211k|    annotsObj.free();
  495|   211k|  }
  496|       |  //~ sort the list
  497|  2.97k|}
_ZN8AcroForm9scanFieldEP6ObjectPc:
  518|   204k|void AcroForm::scanField(Object *fieldRef, char *touchedObjs) {
  519|   204k|  AcroFormField *field;
  520|   204k|  Object fieldObj, kidsRef, kidsObj, kidRef, kidObj, subtypeObj;
  521|   204k|  GBool isTerminal;
  522|   204k|  int i;
  523|       |
  524|       |  // check for an object loop
  525|   204k|  if (fieldRef->isRef()) {
  ------------------
  |  Branch (525:7): [True: 166k, False: 37.5k]
  ------------------
  526|   166k|    if (fieldRef->getRefNum() < 0 ||
  ------------------
  |  Branch (526:9): [True: 0, False: 166k]
  ------------------
  527|   166k|	fieldRef->getRefNum() >= doc->getXRef()->getNumObjects() ||
  ------------------
  |  Branch (527:2): [True: 777, False: 166k]
  ------------------
  528|   166k|	touchedObjs[fieldRef->getRefNum()]) {
  ------------------
  |  Branch (528:2): [True: 159k, False: 6.16k]
  ------------------
  529|   160k|      return;
  530|   160k|    }
  531|  6.16k|    touchedObjs[fieldRef->getRefNum()] = 1;
  532|  6.16k|  }
  533|       |
  534|  43.6k|  fieldRef->fetch(doc->getXRef(), &fieldObj);
  535|  43.6k|  if (!fieldObj.isDict()) {
  ------------------
  |  Branch (535:7): [True: 38.0k, False: 5.65k]
  ------------------
  536|  38.0k|    error(errSyntaxError, -1, "AcroForm field object is wrong type");
  537|  38.0k|    fieldObj.free();
  538|  38.0k|    return;
  539|  38.0k|  }
  540|       |
  541|       |  // look for a Kids entry, and check for an object loop there
  542|  5.65k|  if (fieldObj.dictLookupNF("Kids", &kidsRef)->isRef()) {
  ------------------
  |  Branch (542:7): [True: 151, False: 5.50k]
  ------------------
  543|    151|    if (kidsRef.getRefNum() < 0 ||
  ------------------
  |  Branch (543:9): [True: 0, False: 151]
  ------------------
  544|    151|	kidsRef.getRefNum() >= doc->getXRef()->getNumObjects() ||
  ------------------
  |  Branch (544:2): [True: 60, False: 91]
  ------------------
  545|    135|	touchedObjs[kidsRef.getRefNum()]) {
  ------------------
  |  Branch (545:2): [True: 75, False: 16]
  ------------------
  546|    135|      kidsRef.free();
  547|    135|      fieldObj.free();
  548|    135|      return;
  549|    135|    }
  550|     16|    touchedObjs[kidsRef.getRefNum()] = 1;
  551|     16|    kidsRef.fetch(doc->getXRef(), &kidsObj);
  552|  5.50k|  } else {
  553|  5.50k|    kidsRef.copy(&kidsObj);
  554|  5.50k|  }
  555|  5.51k|  kidsRef.free();
  556|       |
  557|       |  // if this field has a Kids array, and all of the kids have a Parent
  558|       |  // reference (i.e., they're all form fields, not widget
  559|       |  // annotations), then this is a non-terminal field, and we need to
  560|       |  // scan the kids
  561|  5.51k|  isTerminal = gTrue;
  ------------------
  |  |   17|  5.51k|#define gTrue 1
  ------------------
  562|  5.51k|  if (kidsObj.isArray()) {
  ------------------
  |  Branch (562:7): [True: 410, False: 5.10k]
  ------------------
  563|    410|    isTerminal = gFalse;
  ------------------
  |  |   18|    410|#define gFalse 0
  ------------------
  564|  8.02k|    for (i = 0; !isTerminal && i < kidsObj.arrayGetLength(); ++i) {
  ------------------
  |  Branch (564:17): [True: 7.89k, False: 129]
  |  Branch (564:32): [True: 7.61k, False: 281]
  ------------------
  565|  7.61k|      kidsObj.arrayGet(i, &kidObj);
  566|  7.61k|      if (kidObj.isDict()) {
  ------------------
  |  Branch (566:11): [True: 980, False: 6.63k]
  ------------------
  567|    980|	if (kidObj.dictLookup("Parent", &subtypeObj)->isNull()) {
  ------------------
  |  Branch (567:6): [True: 129, False: 851]
  ------------------
  568|    129|	  isTerminal = gTrue;
  ------------------
  |  |   17|    129|#define gTrue 1
  ------------------
  569|    129|	}
  570|    980|	subtypeObj.free();
  571|    980|      }
  572|  7.61k|      kidObj.free();
  573|  7.61k|    }
  574|    410|    if (!isTerminal) {
  ------------------
  |  Branch (574:9): [True: 281, False: 129]
  ------------------
  575|  4.09k|      for (i = 0; !isTerminal && i < kidsObj.arrayGetLength(); ++i) {
  ------------------
  |  Branch (575:19): [True: 4.09k, False: 0]
  |  Branch (575:34): [True: 3.81k, False: 281]
  ------------------
  576|  3.81k|	kidsObj.arrayGetNF(i, &kidRef);
  577|  3.81k|	scanField(&kidRef, touchedObjs);
  578|  3.81k|	kidRef.free();
  579|  3.81k|      }
  580|    281|    }
  581|    410|  }
  582|  5.51k|  kidsObj.free();
  583|       |
  584|  5.51k|  if (isTerminal) {
  ------------------
  |  Branch (584:7): [True: 5.23k, False: 281]
  ------------------
  585|  5.23k|    if ((field = AcroFormField::load(this, fieldRef))) {
  ------------------
  |  Branch (585:9): [True: 3.68k, False: 1.54k]
  ------------------
  586|  3.68k|      fields->append(field);
  587|  3.68k|    }
  588|  5.23k|  }
  589|       |
  590|  5.51k|  fieldObj.free();
  591|  5.51k|}
_ZN13AcroFormField4loadEP8AcroFormP6Object:
  647|  5.23k|AcroFormField *AcroFormField::load(AcroForm *acroFormA, Object *fieldRefA) {
  648|  5.23k|  GString *typeStr;
  649|  5.23k|  TextString *nameA;
  650|  5.23k|  GString *xfaName;
  651|  5.23k|  Guint flagsA;
  652|  5.23k|  GBool haveFlags, typeFromParentA;
  653|  5.23k|  Object fieldObjA, parentObj, parentObj2, obj1, obj2;
  654|  5.23k|  AcroFormFieldType typeA;
  655|  5.23k|  XFAField *xfaFieldA;
  656|  5.23k|  AcroFormField *field;
  657|  5.23k|  int depth, i0, i1;
  658|       |
  659|  5.23k|  fieldRefA->fetch(acroFormA->doc->getXRef(), &fieldObjA);
  660|       |
  661|       |  //----- get field info
  662|       |
  663|  5.23k|  if (fieldObjA.dictLookup("T", &obj1)->isString()) {
  ------------------
  |  Branch (663:7): [True: 3.58k, False: 1.64k]
  ------------------
  664|  3.58k|    nameA = new TextString(obj1.getString());
  665|  3.58k|  } else {
  666|  1.64k|    nameA = new TextString();
  667|  1.64k|  }
  668|  5.23k|  obj1.free();
  669|       |
  670|  5.23k|  if (fieldObjA.dictLookup("FT", &obj1)->isName()) {
  ------------------
  |  Branch (670:7): [True: 3.43k, False: 1.80k]
  ------------------
  671|  3.43k|    typeStr = new GString(obj1.getName());
  672|  3.43k|    typeFromParentA = gFalse;
  ------------------
  |  |   18|  3.43k|#define gFalse 0
  ------------------
  673|  3.43k|  } else {
  674|  1.80k|    typeStr = NULL;
  675|  1.80k|    typeFromParentA = gTrue;
  ------------------
  |  |   17|  1.80k|#define gTrue 1
  ------------------
  676|  1.80k|  }
  677|  5.23k|  obj1.free();
  678|       |
  679|  5.23k|  if (fieldObjA.dictLookup("Ff", &obj1)->isInt()) {
  ------------------
  |  Branch (679:7): [True: 2.51k, False: 2.72k]
  ------------------
  680|  2.51k|    flagsA = (Guint)obj1.getInt();
  681|  2.51k|    haveFlags = gTrue;
  ------------------
  |  |   17|  2.51k|#define gTrue 1
  ------------------
  682|  2.72k|  } else {
  683|  2.72k|    flagsA = 0;
  684|  2.72k|    haveFlags = gFalse;
  ------------------
  |  |   18|  2.72k|#define gFalse 0
  ------------------
  685|  2.72k|  }
  686|  5.23k|  obj1.free();
  687|       |
  688|       |  //----- get info from parent non-terminal fields
  689|       |
  690|  5.23k|  fieldObjA.dictLookup("Parent", &parentObj);
  691|  5.23k|  depth = 0;
  692|  46.8k|  while (parentObj.isDict() && depth < maxFieldObjectDepth) {
  ------------------
  |  |   72|  42.3k|#define maxFieldObjectDepth 50
  ------------------
  |  Branch (692:10): [True: 42.3k, False: 4.44k]
  |  Branch (692:32): [True: 41.5k, False: 790]
  ------------------
  693|       |
  694|  41.5k|    if (parentObj.dictLookup("T", &obj1)->isString()) {
  ------------------
  |  Branch (694:9): [True: 40.9k, False: 603]
  ------------------
  695|  40.9k|      if (nameA->getLength()) {
  ------------------
  |  Branch (695:11): [True: 40.3k, False: 606]
  ------------------
  696|  40.3k|	nameA->insert(0, (Unicode)'.');
  697|  40.3k|      }
  698|  40.9k|      nameA->insert(0, obj1.getString());
  699|  40.9k|    }
  700|  41.5k|    obj1.free();
  701|       |
  702|  41.5k|    if (!typeStr) {
  ------------------
  |  Branch (702:9): [True: 4.57k, False: 37.0k]
  ------------------
  703|  4.57k|      if (parentObj.dictLookup("FT", &obj1)->isName()) {
  ------------------
  |  Branch (703:11): [True: 383, False: 4.19k]
  ------------------
  704|    383|	typeStr = new GString(obj1.getName());
  705|    383|      }
  706|  4.57k|      obj1.free();
  707|  4.57k|    }
  708|       |
  709|  41.5k|    if (!haveFlags) {
  ------------------
  |  Branch (709:9): [True: 6.97k, False: 34.6k]
  ------------------
  710|  6.97k|      if (parentObj.dictLookup("Ff", &obj1)->isInt()) {
  ------------------
  |  Branch (710:11): [True: 504, False: 6.47k]
  ------------------
  711|    504|	flagsA = (Guint)obj1.getInt();
  712|    504|	haveFlags = gTrue;
  ------------------
  |  |   17|    504|#define gTrue 1
  ------------------
  713|    504|      }
  714|  6.97k|      obj1.free();
  715|  6.97k|    }
  716|       |
  717|  41.5k|    parentObj.dictLookup("Parent", &parentObj2);
  718|  41.5k|    parentObj.free();
  719|  41.5k|    parentObj = parentObj2;
  720|       |
  721|  41.5k|    ++depth;
  722|  41.5k|  }
  723|  5.23k|  parentObj.free();
  724|       |
  725|  5.23k|  if (!typeStr) {
  ------------------
  |  Branch (725:7): [True: 1.42k, False: 3.81k]
  ------------------
  726|  1.42k|    error(errSyntaxError, -1, "Missing type in AcroForm field");
  727|  1.42k|    goto err1;
  728|  1.42k|  }
  729|       |
  730|       |  //----- get static XFA info
  731|       |
  732|  3.81k|  xfaFieldA = NULL;
  733|  3.81k|  if (acroFormA->xfaScanner) {
  ------------------
  |  Branch (733:7): [True: 138, False: 3.67k]
  ------------------
  734|       |    // convert field name to UTF-8, and remove segments that start
  735|       |    // with '#' -- to match the XFA field name
  736|    138|    xfaName = nameA->toUTF8();
  737|    138|    i0 = 0;
  738|    983|    while (i0 < xfaName->getLength()) {
  ------------------
  |  Branch (738:12): [True: 845, False: 138]
  ------------------
  739|    845|      i1 = i0;
  740|  57.6k|      while (i1 < xfaName->getLength()) {
  ------------------
  |  Branch (740:14): [True: 57.5k, False: 111]
  ------------------
  741|  57.5k|	if (xfaName->getChar(i1) == '.') {
  ------------------
  |  Branch (741:6): [True: 734, False: 56.8k]
  ------------------
  742|    734|	  ++i1;
  743|    734|	  break;
  744|    734|	}
  745|  56.8k|	++i1;
  746|  56.8k|      }
  747|    845|      if (xfaName->getChar(i0) == '#') {
  ------------------
  |  Branch (747:11): [True: 325, False: 520]
  ------------------
  748|    325|	xfaName->del(i0, i1 - i0);
  749|    520|      } else {
  750|    520|	i0 = i1;
  751|    520|      }
  752|    845|    }
  753|    138|    xfaFieldA = acroFormA->xfaScanner->findField(xfaName);
  754|    138|    delete xfaName;
  755|    138|  }
  756|       |
  757|       |  //----- check for a radio button
  758|       |
  759|       |  // this is a kludge: if we see a Btn-type field with kids, and the
  760|       |  // Ff entry is missing, assume the kids are radio buttons
  761|  3.81k|  if (typeFromParentA && !typeStr->cmp("Btn") && !haveFlags) {
  ------------------
  |  Branch (761:7): [True: 383, False: 3.43k]
  |  Branch (761:26): [True: 137, False: 246]
  |  Branch (761:50): [True: 19, False: 118]
  ------------------
  762|     19|    flagsA = acroFormFlagRadio;
  ------------------
  |  |   40|     19|#define acroFormFlagRadio              (1 << 15)  // button
  ------------------
  763|     19|  }
  764|       |
  765|       |  //----- determine field type
  766|       |
  767|  3.81k|  if (!typeStr->cmp("Btn")) {
  ------------------
  |  Branch (767:7): [True: 850, False: 2.96k]
  ------------------
  768|    850|    if (flagsA & acroFormFlagPushbutton) {
  ------------------
  |  |   41|    850|#define acroFormFlagPushbutton         (1 << 16)  // button
  ------------------
  |  Branch (768:9): [True: 77, False: 773]
  ------------------
  769|     77|      typeA = acroFormFieldPushbutton;
  770|    773|    } else if (flagsA & acroFormFlagRadio) {
  ------------------
  |  |   40|    773|#define acroFormFlagRadio              (1 << 15)  // button
  ------------------
  |  Branch (770:16): [True: 130, False: 643]
  ------------------
  771|    130|      typeA = acroFormFieldRadioButton;
  772|    643|    } else {
  773|    643|      typeA = acroFormFieldCheckbox;
  774|    643|    }
  775|  2.96k|  } else if (!typeStr->cmp("Tx")) {
  ------------------
  |  Branch (775:14): [True: 2.81k, False: 152]
  ------------------
  776|  2.81k|    if (xfaFieldA && xfaFieldA->getBarcodeInfo()) {
  ------------------
  |  Branch (776:9): [True: 0, False: 2.81k]
  |  Branch (776:22): [True: 0, False: 0]
  ------------------
  777|      0|      typeA = acroFormFieldBarcode;
  778|  2.81k|    } else if (flagsA & acroFormFlagFileSelect) {
  ------------------
  |  |   45|  2.81k|#define acroFormFlagFileSelect         (1 << 20)  // text
  ------------------
  |  Branch (778:16): [True: 114, False: 2.69k]
  ------------------
  779|    114|      typeA = acroFormFieldFileSelect;
  780|  2.69k|    } else if (flagsA & acroFormFlagMultiline) {
  ------------------
  |  |   37|  2.69k|#define acroFormFlagMultiline          (1 << 12)  // text
  ------------------
  |  Branch (780:16): [True: 236, False: 2.46k]
  ------------------
  781|    236|      typeA = acroFormFieldMultilineText;
  782|  2.46k|    } else {
  783|  2.46k|      typeA = acroFormFieldText;
  784|  2.46k|    }
  785|  2.81k|  } else if (!typeStr->cmp("Ch")) {
  ------------------
  |  Branch (785:14): [True: 27, False: 125]
  ------------------
  786|     27|    if (flagsA & acroFormFlagCombo) {
  ------------------
  |  |   42|     27|#define acroFormFlagCombo              (1 << 17)  // choice
  ------------------
  |  Branch (786:9): [True: 10, False: 17]
  ------------------
  787|     10|      typeA = acroFormFieldComboBox;
  788|     17|    } else {
  789|     17|      typeA = acroFormFieldListBox;
  790|     17|    }
  791|    125|  } else if (!typeStr->cmp("Sig")) {
  ------------------
  |  Branch (791:14): [True: 0, False: 125]
  ------------------
  792|      0|    typeA = acroFormFieldSignature;
  793|    125|  } else {
  794|    125|    error(errSyntaxError, -1, "Invalid type in AcroForm field");
  795|    125|    goto err1;
  796|    125|  }
  797|  3.68k|  delete typeStr;
  798|       |
  799|  3.68k|  field = new AcroFormField(acroFormA, fieldRefA, &fieldObjA,
  800|  3.68k|			    typeA, nameA, flagsA, typeFromParentA, xfaFieldA);
  801|  3.68k|  fieldObjA.free();
  802|  3.68k|  return field;
  803|       |
  804|  1.54k| err1:
  805|  1.54k|  delete typeStr;
  806|  1.54k|  delete nameA;
  807|  1.54k|  fieldObjA.free();
  808|       |  return NULL;
  809|  3.81k|}
_ZN13AcroFormFieldC2EP8AcroFormP6ObjectS3_17AcroFormFieldTypeP10TextStringjiP8XFAField:
  815|  3.68k|			     XFAField *xfaFieldA) {
  816|  3.68k|  acroForm = acroFormA;
  817|  3.68k|  fieldRefA->copy(&fieldRef);
  818|  3.68k|  fieldObjA->copy(&fieldObj);
  819|  3.68k|  type = typeA;
  820|  3.68k|  name = nameA;
  821|  3.68k|  flags = flagsA;
  822|  3.68k|  typeFromParent = typeFromParentA;
  823|  3.68k|  xfaField = xfaFieldA;
  824|  3.68k|}
_ZN13AcroFormFieldD2Ev:
  826|  3.68k|AcroFormField::~AcroFormField() {
  827|  3.68k|  fieldRef.free();
  828|  3.68k|  fieldObj.free();
  829|  3.68k|  delete name;
  830|  3.68k|}
_ZN17AcroFormAnnotPageC2Eiii:
  327|  1.31M|    { annotNum = annotNumA; annotGen = annotGenA; pageNum = pageNumA; }

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

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

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

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

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

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

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

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

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

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

_ZN4DictC2EP4XRef:
   31|   632k|Dict::Dict(XRef *xrefA) {
   32|   632k|  xref = xrefA;
   33|   632k|  size = 8;
   34|   632k|  length = 0;
   35|   632k|  entries = (DictEntry *)gmallocn(size, sizeof(DictEntry));
   36|   632k|  hashTab = (DictEntry **)gmallocn(2 * size - 1, sizeof(DictEntry *));
   37|   632k|  memset(hashTab, 0, (2 * size - 1) * sizeof(DictEntry *));
   38|   632k|  ref = 1;
   39|   632k|}
_ZN4DictD2Ev:
   41|   632k|Dict::~Dict() {
   42|   632k|  int i;
   43|       |
   44|  2.83M|  for (i = 0; i < length; ++i) {
  ------------------
  |  Branch (44:15): [True: 2.20M, False: 632k]
  ------------------
   45|  2.20M|    gfree(entries[i].key);
   46|  2.20M|    entries[i].val.free();
   47|  2.20M|  }
   48|   632k|  gfree(entries);
   49|   632k|  gfree(hashTab);
   50|   632k|}
_ZN4Dict3addEPcP6Object:
   52|  2.73M|void Dict::add(char *key, Object *val) {
   53|  2.73M|  DictEntry *e;
   54|  2.73M|  int h;
   55|       |
   56|  2.73M|  if ((e = find(key))) {
  ------------------
  |  Branch (56:7): [True: 526k, False: 2.20M]
  ------------------
   57|   526k|    e->val.free();
   58|   526k|    e->val = *val;
   59|   526k|    gfree(key);
   60|  2.20M|  } else {
   61|  2.20M|    if (length == size) {
  ------------------
  |  Branch (61:9): [True: 73.2k, False: 2.13M]
  ------------------
   62|  73.2k|      expand();
   63|  73.2k|    }
   64|  2.20M|    h = hash(key);
   65|  2.20M|    entries[length].key = key;
   66|  2.20M|    entries[length].val = *val;
   67|  2.20M|    entries[length].next = hashTab[h];
   68|  2.20M|    hashTab[h] = &entries[length];
   69|  2.20M|    ++length;
   70|  2.20M|  }
   71|  2.73M|}
_ZN4Dict6expandEv:
   73|  73.2k|void Dict::expand() {
   74|  73.2k|  int h, i;
   75|       |
   76|  73.2k|  size *= 2;
   77|  73.2k|  entries = (DictEntry *)greallocn(entries, size, sizeof(DictEntry));
   78|  73.2k|  hashTab = (DictEntry **)greallocn(hashTab, 2 * size - 1,
   79|  73.2k|				    sizeof(DictEntry *));
   80|  73.2k|  memset(hashTab, 0, (2 * size - 1) * sizeof(DictEntry *));
   81|   688k|  for (i = 0; i < length; ++i) {
  ------------------
  |  Branch (81:15): [True: 614k, False: 73.2k]
  ------------------
   82|   614k|    h = hash(entries[i].key);
   83|   614k|    entries[i].next = hashTab[h];
   84|   614k|    hashTab[h] = &entries[i];
   85|   614k|  }
   86|  73.2k|}
_ZN4Dict4hashEPKc:
  101|  11.0M|int Dict::hash(const char *key) {
  102|  11.0M|  const char *p;
  103|  11.0M|  unsigned int h;
  104|       |
  105|  11.0M|  h = 0;
  106|  73.0M|  for (p = key; *p; ++p) {
  ------------------
  |  Branch (106:17): [True: 62.0M, False: 11.0M]
  ------------------
  107|  62.0M|    h = 17 * h + (int)(*p & 0xff);
  108|  62.0M|  }
  109|  11.0M|  return (int)(h % (2 * size - 1));
  110|  11.0M|}
_ZN4Dict6lookupEPKcP6Objecti:
  118|  4.80M|Object *Dict::lookup(const char *key, Object *obj, int recursion) {
  119|  4.80M|  DictEntry *e;
  120|       |
  121|  4.80M|  return (e = find(key)) ? e->val.fetch(xref, obj, recursion)
  ------------------
  |  Branch (121:10): [True: 1.31M, False: 3.48M]
  ------------------
  122|  4.80M|                         : obj->initNull();
  123|  4.80M|}
_ZN4Dict8lookupNFEPKcP6Object:
  125|   681k|Object *Dict::lookupNF(const char *key, Object *obj) {
  126|   681k|  DictEntry *e;
  127|       |
  128|   681k|  return (e = find(key)) ? e->val.copy(obj) : obj->initNull();
  ------------------
  |  Branch (128:10): [True: 210k, False: 471k]
  ------------------
  129|   681k|}
_ZN4Dict6getKeyEi:
  131|  2.55k|char *Dict::getKey(int i) {
  132|  2.55k|  return entries[i].key;
  133|  2.55k|}
_ZN4Dict6getValEiP6Object:
  135|  2.45k|Object *Dict::getVal(int i, Object *obj) {
  136|  2.45k|  return entries[i].val.fetch(xref, obj);
  137|  2.45k|}
_ZN4Dict8getValNFEiP6Object:
  139|    101|Object *Dict::getValNF(int i, Object *obj) {
  140|    101|  return entries[i].val.copy(obj);
  141|    101|}
_ZN4Dict4findEPKc:
   88|  8.21M|inline DictEntry *Dict::find(const char *key) {
   89|  8.21M|  DictEntry *e;
   90|  8.21M|  int h;
   91|       |
   92|  8.21M|  h = hash(key);
   93|  10.6M|  for (e = hashTab[h]; e; e = e->next) {
  ------------------
  |  Branch (93:24): [True: 4.48M, False: 6.16M]
  ------------------
   94|  4.48M|    if (!strcmp(key, e->key)) {
  ------------------
  |  Branch (94:9): [True: 2.05M, False: 2.43M]
  ------------------
   95|  2.05M|      return e;
   96|  2.05M|    }
   97|  4.48M|  }
   98|  6.16M|  return NULL;
   99|  8.21M|}

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

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

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

_ZN23JArithmeticDecoderStatsC2Ei:
   20|  4.57M|JArithmeticDecoderStats::JArithmeticDecoderStats(int contextSizeA) {
   21|  4.57M|  contextSize = contextSizeA;
   22|  4.57M|  cxTab = (Guchar *)gmallocn(contextSize, sizeof(Guchar));
   23|  4.57M|  reset();
   24|  4.57M|}
_ZN23JArithmeticDecoderStatsD2Ev:
   26|  4.57M|JArithmeticDecoderStats::~JArithmeticDecoderStats() {
   27|  4.57M|  gfree(cxTab);
   28|  4.57M|}
_ZN23JArithmeticDecoderStats4copyEv:
   30|  2.73k|JArithmeticDecoderStats *JArithmeticDecoderStats::copy() {
   31|  2.73k|  JArithmeticDecoderStats *stats;
   32|       |
   33|  2.73k|  stats = new JArithmeticDecoderStats(contextSize);
   34|  2.73k|  memcpy(stats->cxTab, cxTab, contextSize);
   35|  2.73k|  return stats;
   36|  2.73k|}
_ZN23JArithmeticDecoderStats5resetEv:
   38|  5.45M|void JArithmeticDecoderStats::reset() {
   39|  5.45M|  memset(cxTab, 0, contextSize);
   40|  5.45M|}
_ZN23JArithmeticDecoderStats8setEntryEjii:
   46|  3.41M|void JArithmeticDecoderStats::setEntry(Guint cx, int i, int mps) {
   47|  3.41M|  cxTab[cx] = (Guchar)((i << 1) + mps);
   48|  3.41M|}
_ZN18JArithmeticDecoderC2Ev:
   87|   601k|JArithmeticDecoder::JArithmeticDecoder() {
   88|   601k|  str = NULL;
   89|   601k|  dataLen = 0;
   90|   601k|  limitStream = gFalse;
  ------------------
  |  |   18|   601k|#define gFalse 0
  ------------------
   91|   601k|  nBytesRead = 0;
   92|   601k|  readBufNext = 0;
   93|   601k|  readBufLength = 0;
   94|   601k|}
_ZN18JArithmeticDecoderD2Ev:
  110|   600k|JArithmeticDecoder::~JArithmeticDecoder() {
  111|   600k|  cleanup();
  112|   600k|}
_ZN18JArithmeticDecoder5startEv:
  114|   791k|void JArithmeticDecoder::start() {
  115|   791k|  buf0 = readByte();
  116|   791k|  buf1 = readByte();
  117|       |
  118|       |  // INITDEC
  119|   791k|  c = (buf0 ^ 0xff) << 16;
  120|   791k|  byteIn();
  121|   791k|  c <<= 7;
  122|   791k|  ct -= 7;
  123|   791k|  a = 0x80000000;
  124|   791k|}
_ZN18JArithmeticDecoder7restartEi:
  126|  25.0k|void JArithmeticDecoder::restart(int dataLenA) {
  127|  25.0k|  Guint cAdd;
  128|  25.0k|  GBool prevFF;
  129|  25.0k|  int k, nBits;
  130|       |
  131|  25.0k|  if (dataLen >= 0) {
  ------------------
  |  Branch (131:7): [True: 18.4k, False: 6.63k]
  ------------------
  132|  18.4k|    dataLen = dataLenA;
  133|  18.4k|  } else if (dataLen == -1) {
  ------------------
  |  Branch (133:14): [True: 1.85k, False: 4.77k]
  ------------------
  134|  1.85k|    dataLen = dataLenA;
  135|  1.85k|    buf1 = readByte();
  136|  4.77k|  } else {
  137|  4.77k|    k = (-dataLen - 1) * 8 - ct;
  138|  4.77k|    dataLen = dataLenA;
  139|  4.77k|    cAdd = 0;
  140|  4.77k|    prevFF = gFalse;
  ------------------
  |  |   18|  4.77k|#define gFalse 0
  ------------------
  141|   430k|    while (k > 0) {
  ------------------
  |  Branch (141:12): [True: 425k, False: 4.77k]
  ------------------
  142|   425k|      buf0 = readByte();
  143|   425k|      if (prevFF) {
  ------------------
  |  Branch (143:11): [True: 325k, False: 100k]
  ------------------
  144|   325k|	cAdd += 0xfe00 - (buf0 << 9);
  145|   325k|	nBits = 7;
  146|   325k|      } else {
  147|   100k|	cAdd += 0xff00 - (buf0 << 8);
  148|   100k|	nBits = 8;
  149|   100k|      }
  150|   425k|      prevFF = buf0 == 0xff;
  151|   425k|      if (k > nBits) {
  ------------------
  |  Branch (151:11): [True: 421k, False: 4.77k]
  ------------------
  152|   421k|	cAdd <<= nBits;
  153|   421k|	k -= nBits;
  154|   421k|      } else {
  155|  4.77k|	cAdd <<= k;
  156|  4.77k|	ct = nBits - k;
  157|  4.77k|	k = 0;
  158|  4.77k|      }
  159|   425k|    }
  160|  4.77k|    c += cAdd;
  161|  4.77k|    buf1 = readByte();
  162|  4.77k|  }
  163|  25.0k|}
_ZN18JArithmeticDecoder7cleanupEv:
  165|  1.54M|void JArithmeticDecoder::cleanup() {
  166|  1.54M|  if (limitStream) {
  ------------------
  |  Branch (166:7): [True: 1.28M, False: 263k]
  ------------------
  167|       |    // This saves up to sizeof(readBuf) extra bytes of data from the
  168|       |    // end of packet i, to be used in packet i+1. It's not clear from
  169|       |    // the JPEG 2000 spec exactly how this should work, but this
  170|       |    // kludge does seem to fix decode of some problematic JPEG 2000
  171|       |    // streams. The buffer may need to larger, but I haven't run into
  172|       |    // that case. (And the buffer was originally just one byte, which
  173|       |    // works for almost all cases.)
  174|  1.28M|    readBufLength = 0;
  175|  5.53G|    while (dataLen > 0) {
  ------------------
  |  Branch (175:12): [True: 5.53G, False: 1.28M]
  ------------------
  176|  5.53G|      if (readBufLength < (int)sizeof(readBuf)) {
  ------------------
  |  Branch (176:11): [True: 6.75M, False: 5.52G]
  ------------------
  177|  6.75M|	readBuf[readBufLength++] = (Guchar)str->getChar();
  178|  6.75M|	++nBytesRead;
  179|  6.75M|      }
  180|  5.53G|      --dataLen;
  181|  5.53G|    }
  182|  1.28M|    readBufNext = 0;
  183|  1.28M|  }
  184|  1.54M|}
_ZN18JArithmeticDecoder9decodeBitEjP23JArithmeticDecoderStats:
  187|   552M|				  JArithmeticDecoderStats *stats) {
  188|   552M|  int bit;
  189|   552M|  Guint qe;
  190|   552M|  int iCX, mpsCX;
  191|       |
  192|   552M|  iCX = stats->cxTab[context] >> 1;
  193|   552M|  mpsCX = stats->cxTab[context] & 1;
  194|   552M|  qe = qeTab[iCX];
  195|   552M|  a -= qe;
  196|   552M|  if (c < a) {
  ------------------
  |  Branch (196:7): [True: 530M, False: 22.2M]
  ------------------
  197|   530M|    if (a & 0x80000000) {
  ------------------
  |  Branch (197:9): [True: 507M, False: 22.7M]
  ------------------
  198|   507M|      bit = mpsCX;
  199|   507M|    } else {
  200|       |      // MPS_EXCHANGE
  201|  22.7M|      if (a < qe) {
  ------------------
  |  Branch (201:11): [True: 3.69M, False: 19.0M]
  ------------------
  202|  3.69M|	bit = 1 - mpsCX;
  203|  3.69M|	if (switchTab[iCX]) {
  ------------------
  |  Branch (203:6): [True: 2.20M, False: 1.48M]
  ------------------
  204|  2.20M|	  stats->cxTab[context] = (Guchar)((nlpsTab[iCX] << 1) | (1 - mpsCX));
  205|  2.20M|	} else {
  206|  1.48M|	  stats->cxTab[context] = (Guchar)((nlpsTab[iCX] << 1) | mpsCX);
  207|  1.48M|	}
  208|  19.0M|      } else {
  209|  19.0M|	bit = mpsCX;
  210|  19.0M|	stats->cxTab[context] = (Guchar)((nmpsTab[iCX] << 1) | mpsCX);
  211|  19.0M|      }
  212|       |      // RENORMD
  213|  24.2M|      do {
  214|  24.2M|	if (ct == 0) {
  ------------------
  |  Branch (214:6): [True: 3.06M, False: 21.1M]
  ------------------
  215|  3.06M|	  byteIn();
  216|  3.06M|	}
  217|  24.2M|	a <<= 1;
  218|  24.2M|	c <<= 1;
  219|  24.2M|	--ct;
  220|  24.2M|      } while (!(a & 0x80000000));
  ------------------
  |  Branch (220:16): [True: 1.52M, False: 22.7M]
  ------------------
  221|  22.7M|    }
  222|   530M|  } else {
  223|  22.2M|    c -= a;
  224|       |    // LPS_EXCHANGE
  225|  22.2M|    if (a < qe) {
  ------------------
  |  Branch (225:9): [True: 4.35M, False: 17.8M]
  ------------------
  226|  4.35M|      bit = mpsCX;
  227|  4.35M|      stats->cxTab[context] = (Guchar)((nmpsTab[iCX] << 1) | mpsCX);
  228|  17.8M|    } else {
  229|  17.8M|      bit = 1 - mpsCX;
  230|  17.8M|      if (switchTab[iCX]) {
  ------------------
  |  Branch (230:11): [True: 4.85M, False: 13.0M]
  ------------------
  231|  4.85M|	stats->cxTab[context] = (Guchar)((nlpsTab[iCX] << 1) | (1 - mpsCX));
  232|  13.0M|      } else {
  233|  13.0M|	stats->cxTab[context] = (Guchar)((nlpsTab[iCX] << 1) | mpsCX);
  234|  13.0M|      }
  235|  17.8M|    }
  236|  22.2M|    a = qe;
  237|       |    // RENORMD
  238|  33.8M|    do {
  239|  33.8M|      if (ct == 0) {
  ------------------
  |  Branch (239:11): [True: 4.30M, False: 29.5M]
  ------------------
  240|  4.30M|	byteIn();
  241|  4.30M|      }
  242|  33.8M|      a <<= 1;
  243|  33.8M|      c <<= 1;
  244|  33.8M|      --ct;
  245|  33.8M|    } while (!(a & 0x80000000));
  ------------------
  |  Branch (245:14): [True: 11.6M, False: 22.2M]
  ------------------
  246|  22.2M|  }
  247|   552M|  return bit;
  248|   552M|}
_ZN18JArithmeticDecoder9decodeIntEPiP23JArithmeticDecoderStats:
  262|  8.26M|GBool JArithmeticDecoder::decodeInt(int *x, JArithmeticDecoderStats *stats) {
  263|  8.26M|  int s;
  264|  8.26M|  Guint v;
  265|  8.26M|  int i;
  266|       |
  267|  8.26M|  prev = 1;
  268|  8.26M|  s = decodeIntBit(stats);
  269|  8.26M|  if (decodeIntBit(stats)) {
  ------------------
  |  Branch (269:7): [True: 5.95M, False: 2.30M]
  ------------------
  270|  5.95M|    if (decodeIntBit(stats)) {
  ------------------
  |  Branch (270:9): [True: 4.82M, False: 1.13M]
  ------------------
  271|  4.82M|      if (decodeIntBit(stats)) {
  ------------------
  |  Branch (271:11): [True: 4.60M, False: 219k]
  ------------------
  272|  4.60M|	if (decodeIntBit(stats)) {
  ------------------
  |  Branch (272:6): [True: 4.59M, False: 7.73k]
  ------------------
  273|  4.59M|	  if (decodeIntBit(stats)) {
  ------------------
  |  Branch (273:8): [True: 4.59M, False: 3.93k]
  ------------------
  274|  4.59M|	    v = 0;
  275|   151M|	    for (i = 0; i < 32; ++i) {
  ------------------
  |  Branch (275:18): [True: 146M, False: 4.59M]
  ------------------
  276|   146M|	      v = (v << 1) | decodeIntBit(stats);
  277|   146M|	    }
  278|  4.59M|	    v += 4436;
  279|  4.59M|	  } else {
  280|  3.93k|	    v = 0;
  281|  51.1k|	    for (i = 0; i < 12; ++i) {
  ------------------
  |  Branch (281:18): [True: 47.1k, False: 3.93k]
  ------------------
  282|  47.1k|	      v = (v << 1) | decodeIntBit(stats);
  283|  47.1k|	    }
  284|  3.93k|	    v += 340;
  285|  3.93k|	  }
  286|  4.59M|	} else {
  287|  7.73k|	  v = 0;
  288|  69.5k|	  for (i = 0; i < 8; ++i) {
  ------------------
  |  Branch (288:16): [True: 61.8k, False: 7.73k]
  ------------------
  289|  61.8k|	    v = (v << 1) | decodeIntBit(stats);
  290|  61.8k|	  }
  291|  7.73k|	  v += 84;
  292|  7.73k|	}
  293|  4.60M|      } else {
  294|   219k|	v = 0;
  295|  1.53M|	for (i = 0; i < 6; ++i) {
  ------------------
  |  Branch (295:14): [True: 1.31M, False: 219k]
  ------------------
  296|  1.31M|	  v = (v << 1) | decodeIntBit(stats);
  297|  1.31M|	}
  298|   219k|	v += 20;
  299|   219k|      }
  300|  4.82M|    } else {
  301|  1.13M|      v = decodeIntBit(stats);
  302|  1.13M|      v = (v << 1) | decodeIntBit(stats);
  303|  1.13M|      v = (v << 1) | decodeIntBit(stats);
  304|  1.13M|      v = (v << 1) | decodeIntBit(stats);
  305|  1.13M|      v += 4;
  306|  1.13M|    }
  307|  5.95M|  } else {
  308|  2.30M|    v = decodeIntBit(stats);
  309|  2.30M|    v = (v << 1) | decodeIntBit(stats);
  310|  2.30M|  }
  311|       |
  312|  8.26M|  if (s) {
  ------------------
  |  Branch (312:7): [True: 5.95M, False: 2.30M]
  ------------------
  313|  5.95M|    if (v == 0) {
  ------------------
  |  Branch (313:9): [True: 1.10M, False: 4.84M]
  ------------------
  314|  1.10M|      return gFalse;
  ------------------
  |  |   18|  1.10M|#define gFalse 0
  ------------------
  315|  1.10M|    }
  316|  4.84M|    *x = -(int)v;
  317|  4.84M|  } else {
  318|  2.30M|    *x = (int)v;
  319|  2.30M|  }
  320|  7.15M|  return gTrue;
  ------------------
  |  |   17|  7.15M|#define gTrue 1
  ------------------
  321|  8.26M|}
_ZN18JArithmeticDecoder12decodeIntBitEP23JArithmeticDecoderStats:
  323|   193M|int JArithmeticDecoder::decodeIntBit(JArithmeticDecoderStats *stats) {
  324|   193M|  int bit;
  325|       |
  326|   193M|  bit = decodeBit(prev, stats);
  327|   193M|  if (prev < 0x100) {
  ------------------
  |  Branch (327:7): [True: 55.7M, False: 138M]
  ------------------
  328|  55.7M|    prev = (prev << 1) | bit;
  329|   138M|  } else {
  330|   138M|    prev = (((prev << 1) | bit) & 0x1ff) | 0x100;
  331|   138M|  }
  332|   193M|  return bit;
  333|   193M|}
_ZN18JArithmeticDecoder10decodeIAIDEjP23JArithmeticDecoderStats:
  336|  4.90M|				     JArithmeticDecoderStats *stats) {
  337|  4.90M|  Guint i;
  338|  4.90M|  int bit;
  339|       |
  340|  4.90M|  prev = 1;
  341|  8.91M|  for (i = 0; i < codeLen; ++i) {
  ------------------
  |  Branch (341:15): [True: 4.01M, False: 4.90M]
  ------------------
  342|  4.01M|    bit = decodeBit(prev, stats);
  343|  4.01M|    prev = (prev << 1) | bit;
  344|  4.01M|  }
  345|  4.90M|  return prev - (1 << codeLen);
  346|  4.90M|}
_ZN18JArithmeticDecoder6byteInEv:
  348|  8.16M|void JArithmeticDecoder::byteIn() {
  349|  8.16M|  if (buf0 == 0xff) {
  ------------------
  |  Branch (349:7): [True: 5.67M, False: 2.48M]
  ------------------
  350|  5.67M|    if (buf1 > 0x8f) {
  ------------------
  |  Branch (350:9): [True: 5.66M, False: 15.8k]
  ------------------
  351|  5.66M|      if (limitStream) {
  ------------------
  |  Branch (351:11): [True: 1.82M, False: 3.83M]
  ------------------
  352|  1.82M|	buf0 = buf1;
  353|  1.82M|	buf1 = readByte();
  354|  1.82M|	c = c + 0xff00 - (buf0 << 8);
  355|  1.82M|      }
  356|  5.66M|      ct = 8;
  357|  5.66M|    } else {
  358|  15.8k|      buf0 = buf1;
  359|  15.8k|      buf1 = readByte();
  360|  15.8k|      c = c + 0xfe00 - (buf0 << 9);
  361|  15.8k|      ct = 7;
  362|  15.8k|    }
  363|  5.67M|  } else {
  364|  2.48M|    buf0 = buf1;
  365|  2.48M|    buf1 = readByte();
  366|  2.48M|    c = c + 0xff00 - (buf0 << 8);
  367|  2.48M|    ct = 8;
  368|  2.48M|  }
  369|  8.16M|}
_ZN18JArithmeticDecoder8readByteEv:
   96|  6.34M|inline Guint JArithmeticDecoder::readByte() {
   97|  6.34M|  if (limitStream) {
  ------------------
  |  Branch (97:7): [True: 5.55M, False: 788k]
  ------------------
   98|  5.55M|    if (readBufNext < readBufLength) {
  ------------------
  |  Branch (98:9): [True: 1.04M, False: 4.51M]
  ------------------
   99|  1.04M|      return readBuf[readBufNext++];
  100|  1.04M|    }
  101|  4.51M|    --dataLen;
  102|  4.51M|    if (dataLen < 0) {
  ------------------
  |  Branch (102:9): [True: 2.30M, False: 2.20M]
  ------------------
  103|  2.30M|      return 0xff;
  104|  2.30M|    }
  105|  4.51M|  }
  106|  2.99M|  ++nBytesRead;
  107|  2.99M|  return (Guint)str->getChar() & 0xff;
  108|  6.34M|}

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

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

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

_ZN5LexerC2EP4XRefP6Stream:
   46|   383k|Lexer::Lexer(XRef *xref, Stream *str) {
   47|   383k|  Object obj;
   48|       |
   49|   383k|  curStr.initStream(str);
   50|   383k|  streams = new Array(xref);
   51|   383k|  streams->add(curStr.copy(&obj));
   52|   383k|  strPtr = 0;
   53|   383k|  freeArray = gTrue;
  ------------------
  |  |   17|   383k|#define gTrue 1
  ------------------
   54|   383k|  curStr.streamReset();
   55|   383k|}
_ZN5LexerD2Ev:
   75|   383k|Lexer::~Lexer() {
   76|   383k|  if (!curStr.isNone()) {
  ------------------
  |  Branch (76:7): [True: 125k, False: 258k]
  ------------------
   77|   125k|    curStr.streamClose();
   78|   125k|    curStr.free();
   79|   125k|  }
   80|   383k|  if (freeArray) {
  ------------------
  |  Branch (80:7): [True: 383k, False: 0]
  ------------------
   81|   383k|    delete streams;
   82|   383k|  }
   83|   383k|}
_ZN5Lexer7getCharEv:
   85|  1.48G|int Lexer::getChar() {
   86|  1.48G|  int c;
   87|       |
   88|  1.48G|  c = EOF;
   89|  1.49G|  while (!curStr.isNone() && (c = curStr.streamGetChar()) == EOF) {
  ------------------
  |  Branch (89:10): [True: 1.33G, False: 152M]
  |  Branch (89:30): [True: 258k, False: 1.33G]
  ------------------
   90|   258k|    curStr.streamClose();
   91|   258k|    curStr.free();
   92|   258k|    ++strPtr;
   93|   258k|    if (strPtr < streams->getLength()) {
  ------------------
  |  Branch (93:9): [True: 0, False: 258k]
  ------------------
   94|      0|      streams->get(strPtr, &curStr);
   95|      0|      curStr.streamReset();
   96|      0|    }
   97|   258k|  }
   98|  1.48G|  return c;
   99|  1.48G|}
_ZN5Lexer8lookCharEv:
  101|   283M|int Lexer::lookChar() {
  102|   283M|  if (curStr.isNone()) {
  ------------------
  |  Branch (102:7): [True: 3.11k, False: 283M]
  ------------------
  103|  3.11k|    return EOF;
  104|  3.11k|  }
  105|   283M|  return curStr.streamLookChar();
  106|   283M|}
_ZN5Lexer6getObjEP6Object:
  108|   198M|Object *Lexer::getObj(Object *obj) {
  109|   198M|  char *p;
  110|   198M|  int c, c2;
  111|   198M|  GBool comment, neg, doubleMinus, done, invalid;
  112|   198M|  int numParen, nErrors;
  113|   198M|  int xi;
  114|   198M|  double xf, scale;
  115|   198M|  GString *s;
  116|   198M|  int n, m;
  117|       |
  118|       |  // skip whitespace and comments
  119|   198M|  comment = gFalse;
  ------------------
  |  |   18|   198M|#define gFalse 0
  ------------------
  120|   905M|  while (1) {
  ------------------
  |  Branch (120:10): [True: 905M, Folded]
  ------------------
  121|   905M|    if ((c = getChar()) == EOF) {
  ------------------
  |  Branch (121:9): [True: 152M, False: 752M]
  ------------------
  122|   152M|      return obj->initEOF();
  123|   152M|    }
  124|   752M|    if (comment) {
  ------------------
  |  Branch (124:9): [True: 36.1M, False: 716M]
  ------------------
  125|  36.1M|      if (c == '\r' || c == '\n')
  ------------------
  |  Branch (125:11): [True: 112k, False: 36.0M]
  |  Branch (125:24): [True: 167k, False: 35.9M]
  ------------------
  126|   280k|	comment = gFalse;
  ------------------
  |  |   18|   280k|#define gFalse 0
  ------------------
  127|   716M|    } else if (c == '%') {
  ------------------
  |  Branch (127:16): [True: 283k, False: 716M]
  ------------------
  128|   283k|      comment = gTrue;
  ------------------
  |  |   17|   283k|#define gTrue 1
  ------------------
  129|   716M|    } else if (specialChars[c] != 1) {
  ------------------
  |  Branch (129:16): [True: 46.1M, False: 670M]
  ------------------
  130|  46.1M|      break;
  131|  46.1M|    }
  132|   752M|  }
  133|       |
  134|       |  // start reading token
  135|  46.1M|  switch (c) {
  136|       |
  137|       |  // number
  138|  5.19M|  case '0': case '1': case '2': case '3': case '4':
  ------------------
  |  Branch (138:3): [True: 2.65M, False: 43.4M]
  |  Branch (138:13): [True: 1.11M, False: 45.0M]
  |  Branch (138:23): [True: 830k, False: 45.2M]
  |  Branch (138:33): [True: 237k, False: 45.8M]
  |  Branch (138:43): [True: 362k, False: 45.7M]
  ------------------
  139|  6.67M|  case '5': case '6': case '7': case '8': case '9':
  ------------------
  |  Branch (139:3): [True: 211k, False: 45.9M]
  |  Branch (139:13): [True: 342k, False: 45.7M]
  |  Branch (139:23): [True: 128k, False: 45.9M]
  |  Branch (139:33): [True: 566k, False: 45.5M]
  |  Branch (139:43): [True: 227k, False: 45.9M]
  ------------------
  140|  7.20M|  case '+': case '-': case '.':
  ------------------
  |  Branch (140:3): [True: 41.3k, False: 46.0M]
  |  Branch (140:13): [True: 274k, False: 45.8M]
  |  Branch (140:23): [True: 214k, False: 45.9M]
  ------------------
  141|       |    // Adobe's number lexer has some "interesting" behavior:
  142|       |    // "--123" is interpreted as 0
  143|       |    // "--123.4" is interpreted as -123.4 [I've seen this in the wild]
  144|       |    // "50-100" is interpreted as 50 [I've seen this in the wild]
  145|       |    // "50--100" is interpreted as 50
  146|       |    // "50-100.0" is an error -- but older versions of Acrobat may
  147|       |    //   have interpreted it as 50100.0 (?)
  148|       |    // "50--100.0" is an error -- but older versions of Acrobat may
  149|       |    //   have interpreted it as 50100.0 (?)
  150|       |    // "50.0-100" is interpreted as 50.0 (or maybe 50.0100?)
  151|       |    // "50.0--100" is interpreted as 50.0 (or maybe 50.0100?)
  152|       |    // "-50-100" is interpreted as -50
  153|       |    // "-" is interpreted as 0
  154|       |    // "-." is interpreted as 0.0
  155|  7.20M|    neg = gFalse;
  ------------------
  |  |   18|  7.20M|#define gFalse 0
  ------------------
  156|  7.20M|    doubleMinus = gFalse;
  ------------------
  |  |   18|  7.20M|#define gFalse 0
  ------------------
  157|  7.20M|    xf = xi = 0;
  158|  7.20M|    if (c == '+') {
  ------------------
  |  Branch (158:9): [True: 41.3k, False: 7.16M]
  ------------------
  159|       |      // just ignore it
  160|  7.16M|    } else if (c == '-') {
  ------------------
  |  Branch (160:16): [True: 274k, False: 6.88M]
  ------------------
  161|   274k|      neg = gTrue;
  ------------------
  |  |   17|   274k|#define gTrue 1
  ------------------
  162|   274k|      if (lookChar() == '-') {
  ------------------
  |  Branch (162:11): [True: 10.5k, False: 263k]
  ------------------
  163|  10.5k|	doubleMinus = gTrue;
  ------------------
  |  |   17|  10.5k|#define gTrue 1
  ------------------
  164|  18.0k|	do {
  165|  18.0k|	  getChar();
  166|  18.0k|	} while (lookChar() == '-');
  ------------------
  |  Branch (166:11): [True: 7.48k, False: 10.5k]
  ------------------
  167|  10.5k|      }
  168|  6.88M|    } else if (c == '.') {
  ------------------
  |  Branch (168:16): [True: 214k, False: 6.67M]
  ------------------
  169|   214k|      goto doReal;
  170|  6.67M|    } else {
  171|  6.67M|      xf = xi = c - '0';
  172|  6.67M|    }
  173|  14.1M|    while (1) {
  ------------------
  |  Branch (173:12): [True: 14.1M, Folded]
  ------------------
  174|  14.1M|      c = lookChar();
  175|  14.1M|      if (isdigit(c)) {
  ------------------
  |  Branch (175:11): [True: 7.18M, False: 6.98M]
  ------------------
  176|  7.18M|	getChar();
  177|  7.18M|	xi = xi * 10 + (c - '0');
  178|  7.18M|	if (xf < 1e20) {
  ------------------
  |  Branch (178:6): [True: 7.05M, False: 129k]
  ------------------
  179|  7.05M|	  xf = xf * 10 + (c - '0');
  180|  7.05M|	}
  181|  7.18M|      } else if (c == '.') {
  ------------------
  |  Branch (181:18): [True: 365k, False: 6.62M]
  ------------------
  182|   365k|	getChar();
  183|   365k|	goto doReal;
  184|  6.62M|      } else {
  185|  6.62M|	break;
  186|  6.62M|      }
  187|  14.1M|    }
  188|  6.63M|    while ((c = lookChar()) == '-' || isdigit(c)) {
  ------------------
  |  Branch (188:12): [True: 4.24k, False: 6.62M]
  |  Branch (188:39): [True: 5.63k, False: 6.62M]
  ------------------
  189|  9.87k|      getChar();
  190|  9.87k|    }
  191|  6.62M|    if (neg) {
  ------------------
  |  Branch (191:9): [True: 268k, False: 6.35M]
  ------------------
  192|   268k|      xi = -xi;
  193|   268k|    }
  194|  6.62M|    if (doubleMinus) {
  ------------------
  |  Branch (194:9): [True: 10.4k, False: 6.61M]
  ------------------
  195|  10.4k|      xi = 0;
  196|  10.4k|    }
  197|  6.62M|    obj->initInt(xi);
  198|  6.62M|    break;
  199|   580k|  doReal:
  200|   580k|    scale = 0.1;
  201|  1.17M|    while (1) {
  ------------------
  |  Branch (201:12): [True: 1.17M, Folded]
  ------------------
  202|  1.17M|      c = lookChar();
  203|  1.17M|      if (c == '-') {
  ------------------
  |  Branch (203:11): [True: 21.6k, False: 1.15M]
  ------------------
  204|  21.6k|	error(errSyntaxWarning, getPos(), "Badly formatted number");
  205|  21.6k|	getChar();
  206|  21.6k|	continue;
  207|  21.6k|      }
  208|  1.15M|      if (!isdigit(c)) {
  ------------------
  |  Branch (208:11): [True: 580k, False: 571k]
  ------------------
  209|   580k|	break;
  210|   580k|      }
  211|   571k|      getChar();
  212|   571k|      xf = xf + scale * (c - '0');
  213|   571k|      scale *= 0.1;
  214|   571k|    }
  215|   580k|    while ((c = lookChar()) == '-' || isdigit(c)) {
  ------------------
  |  Branch (215:12): [True: 0, False: 580k]
  |  Branch (215:39): [True: 0, False: 580k]
  ------------------
  216|      0|      getChar();
  217|      0|    }
  218|   580k|    if (neg) {
  ------------------
  |  Branch (218:9): [True: 5.02k, False: 575k]
  ------------------
  219|  5.02k|      xf = -xf;
  220|  5.02k|    }
  221|   580k|    obj->initReal(xf);
  222|   580k|    break;
  223|       |
  224|       |  // string
  225|   220k|  case '(':
  ------------------
  |  Branch (225:3): [True: 220k, False: 45.9M]
  ------------------
  226|   220k|    p = tokBuf;
  227|   220k|    n = 0;
  228|   220k|    numParen = 1;
  229|   220k|    done = gFalse;
  ------------------
  |  |   18|   220k|#define gFalse 0
  ------------------
  230|   220k|    s = NULL;
  231|   290M|    do {
  232|   290M|      c2 = EOF;
  233|   290M|      switch (c = getChar()) {
  234|       |
  235|  8.43k|      case EOF:
  ------------------
  |  Branch (235:7): [True: 8.43k, False: 290M]
  ------------------
  236|  8.43k|	error(errSyntaxError, getPos(), "Unterminated string");
  237|  8.43k|	done = gTrue;
  ------------------
  |  |   17|  8.43k|#define gTrue 1
  ------------------
  238|  8.43k|	break;
  239|       |
  240|  1.08M|      case '(':
  ------------------
  |  Branch (240:7): [True: 1.08M, False: 288M]
  ------------------
  241|  1.08M|	++numParen;
  242|  1.08M|	c2 = c;
  243|  1.08M|	break;
  244|       |
  245|   643k|      case ')':
  ------------------
  |  Branch (245:7): [True: 643k, False: 289M]
  ------------------
  246|   643k|	if (--numParen == 0) {
  ------------------
  |  Branch (246:6): [True: 211k, False: 431k]
  ------------------
  247|   211k|	  done = gTrue;
  ------------------
  |  |   17|   211k|#define gTrue 1
  ------------------
  248|   431k|	} else {
  249|   431k|	  c2 = c;
  250|   431k|	}
  251|   643k|	break;
  252|       |
  253|  4.64M|      case '\r':
  ------------------
  |  Branch (253:7): [True: 4.64M, False: 285M]
  ------------------
  254|       |	// The PDF spec says that any literal end-of-line sequence
  255|       |	// (LF, CR, CR+LF) is translated to a single LF char.
  256|  4.64M|	c = lookChar();
  257|  4.64M|	if (c == '\n') {
  ------------------
  |  Branch (257:6): [True: 153k, False: 4.49M]
  ------------------
  258|   153k|	  getChar();
  259|   153k|	}
  260|  4.64M|	c2 = '\n';
  261|  4.64M|	break;
  262|       |
  263|   201k|      case '\\':
  ------------------
  |  Branch (263:7): [True: 201k, False: 289M]
  ------------------
  264|   201k|	switch (c = getChar()) {
  265|  2.95k|	case 'n':
  ------------------
  |  Branch (265:2): [True: 2.95k, False: 198k]
  ------------------
  266|  2.95k|	  c2 = '\n';
  267|  2.95k|	  break;
  268|  17.5k|	case 'r':
  ------------------
  |  Branch (268:2): [True: 17.5k, False: 183k]
  ------------------
  269|  17.5k|	  c2 = '\r';
  270|  17.5k|	  break;
  271|  22.5k|	case 't':
  ------------------
  |  Branch (271:2): [True: 22.5k, False: 178k]
  ------------------
  272|  22.5k|	  c2 = '\t';
  273|  22.5k|	  break;
  274|  1.29k|	case 'b':
  ------------------
  |  Branch (274:2): [True: 1.29k, False: 200k]
  ------------------
  275|  1.29k|	  c2 = '\b';
  276|  1.29k|	  break;
  277|    265|	case 'f':
  ------------------
  |  Branch (277:2): [True: 265, False: 201k]
  ------------------
  278|    265|	  c2 = '\f';
  279|    265|	  break;
  280|  1.98k|	case '\\':
  ------------------
  |  Branch (280:2): [True: 1.98k, False: 199k]
  ------------------
  281|  6.95k|	case '(':
  ------------------
  |  Branch (281:2): [True: 4.97k, False: 196k]
  ------------------
  282|  13.0k|	case ')':
  ------------------
  |  Branch (282:2): [True: 6.11k, False: 195k]
  ------------------
  283|  13.0k|	  c2 = c;
  284|  13.0k|	  break;
  285|  11.5k|	case '0': case '1': case '2': case '3':
  ------------------
  |  Branch (285:2): [True: 6.52k, False: 194k]
  |  Branch (285:12): [True: 1.60k, False: 199k]
  |  Branch (285:22): [True: 2.71k, False: 198k]
  |  Branch (285:32): [True: 754, False: 200k]
  ------------------
  286|  35.2k|	case '4': case '5': case '6': case '7':
  ------------------
  |  Branch (286:2): [True: 4.17k, False: 197k]
  |  Branch (286:12): [True: 7.21k, False: 194k]
  |  Branch (286:22): [True: 6.55k, False: 194k]
  |  Branch (286:32): [True: 5.67k, False: 195k]
  ------------------
  287|  35.2k|	  c2 = c - '0';
  288|  35.2k|	  c = lookChar();
  289|  35.2k|	  if (c >= '0' && c <= '7') {
  ------------------
  |  Branch (289:8): [True: 18.5k, False: 16.7k]
  |  Branch (289:20): [True: 8.83k, False: 9.67k]
  ------------------
  290|  8.83k|	    getChar();
  291|  8.83k|	    c2 = (c2 << 3) + (c - '0');
  292|  8.83k|	    c = lookChar();
  293|  8.83k|	    if (c >= '0' && c <= '7') {
  ------------------
  |  Branch (293:10): [True: 4.68k, False: 4.14k]
  |  Branch (293:22): [True: 1.00k, False: 3.68k]
  ------------------
  294|  1.00k|	      getChar();
  295|  1.00k|	      c2 = (c2 << 3) + (c - '0');
  296|  1.00k|	    }
  297|  8.83k|	  }
  298|  35.2k|	  break;
  299|  3.88k|	case '\r':
  ------------------
  |  Branch (299:2): [True: 3.88k, False: 197k]
  ------------------
  300|  3.88k|	  c = lookChar();
  301|  3.88k|	  if (c == '\n') {
  ------------------
  |  Branch (301:8): [True: 1.32k, False: 2.55k]
  ------------------
  302|  1.32k|	    getChar();
  303|  1.32k|	  }
  304|  3.88k|	  break;
  305|  6.80k|	case '\n':
  ------------------
  |  Branch (305:2): [True: 6.80k, False: 194k]
  ------------------
  306|  6.80k|	  break;
  307|    689|	case EOF:
  ------------------
  |  Branch (307:2): [True: 689, False: 200k]
  ------------------
  308|    689|	  error(errSyntaxError, getPos(), "Unterminated string");
  309|    689|	  done = gTrue;
  ------------------
  |  |   17|    689|#define gTrue 1
  ------------------
  310|    689|	  break;
  311|  97.1k|	default:
  ------------------
  |  Branch (311:2): [True: 97.1k, False: 104k]
  ------------------
  312|  97.1k|	  c2 = c;
  313|  97.1k|	  break;
  314|   201k|	}
  315|   201k|	break;
  316|       |
  317|   283M|      default:
  ------------------
  |  Branch (317:7): [True: 283M, False: 6.58M]
  ------------------
  318|   283M|	c2 = c;
  319|   283M|	break;
  320|   290M|      }
  321|       |
  322|   290M|      if (c2 != EOF) {
  ------------------
  |  Branch (322:11): [True: 289M, False: 231k]
  ------------------
  323|   289M|	if (n == tokBufSize) {
  ------------------
  |  |   19|   289M|#define tokBufSize 128		// size of token buffer
  ------------------
  |  Branch (323:6): [True: 2.19M, False: 287M]
  ------------------
  324|  2.19M|	  if (!s)
  ------------------
  |  Branch (324:8): [True: 65.2k, False: 2.12M]
  ------------------
  325|  65.2k|	    s = new GString(tokBuf, tokBufSize);
  ------------------
  |  |   19|  65.2k|#define tokBufSize 128		// size of token buffer
  ------------------
  326|  2.12M|	  else
  327|  2.12M|	    s->append(tokBuf, tokBufSize);
  ------------------
  |  |   19|  2.12M|#define tokBufSize 128		// size of token buffer
  ------------------
  328|  2.19M|	  p = tokBuf;
  329|  2.19M|	  n = 0;
  330|  2.19M|	}
  331|   289M|	*p++ = (char)c2;
  332|   289M|	++n;
  333|   289M|      }
  334|   290M|    } while (!done);
  ------------------
  |  Branch (334:14): [True: 289M, False: 220k]
  ------------------
  335|   220k|    if (!s)
  ------------------
  |  Branch (335:9): [True: 155k, False: 65.2k]
  ------------------
  336|   155k|      s = new GString(tokBuf, n);
  337|  65.2k|    else
  338|  65.2k|      s->append(tokBuf, n);
  339|   220k|    obj->initString(s);
  340|   220k|    break;
  341|       |
  342|       |  // name
  343|  6.95M|  case '/':
  ------------------
  |  Branch (343:3): [True: 6.95M, False: 39.1M]
  ------------------
  344|  6.95M|    p = tokBuf;
  345|  6.95M|    n = 0;
  346|  6.95M|    s = NULL;
  347|  6.95M|    invalid = gFalse;
  ------------------
  |  |   18|  6.95M|#define gFalse 0
  ------------------
  348|  29.0M|    while ((c = lookChar()) != EOF && !specialChars[c]) {
  ------------------
  |  Branch (348:12): [True: 29.0M, False: 3.74k]
  |  Branch (348:39): [True: 22.1M, False: 6.94M]
  ------------------
  349|  22.1M|      getChar();
  350|  22.1M|      if (c == '#') {
  ------------------
  |  Branch (350:11): [True: 834k, False: 21.2M]
  ------------------
  351|   834k|	c2 = lookChar();
  352|   834k|	if (c2 >= '0' && c2 <= '9') {
  ------------------
  |  Branch (352:6): [True: 414k, False: 419k]
  |  Branch (352:19): [True: 4.26k, False: 410k]
  ------------------
  353|  4.26k|	  c = c2 - '0';
  354|   829k|	} else if (c2 >= 'A' && c2 <= 'F') {
  ------------------
  |  Branch (354:13): [True: 410k, False: 419k]
  |  Branch (354:26): [True: 47.0k, False: 363k]
  ------------------
  355|  47.0k|	  c = c2 - 'A' + 10;
  356|   782k|	} else if (c2 >= 'a' && c2 <= 'f') {
  ------------------
  |  Branch (356:13): [True: 362k, False: 420k]
  |  Branch (356:26): [True: 102k, False: 260k]
  ------------------
  357|   102k|	  c = c2 - 'a' + 10;
  358|   680k|	} else {
  359|   680k|	  error(errSyntaxError, getPos(), "Invalid hex escape in name");
  360|   680k|	  goto notEscChar;
  361|   680k|	}
  362|   153k|	getChar();
  363|   153k|	c2 = lookChar();
  364|   153k|	if (c2 >= '0' && c2 <= '9') {
  ------------------
  |  Branch (364:6): [True: 149k, False: 4.45k]
  |  Branch (364:19): [True: 28.8k, False: 120k]
  ------------------
  365|  28.8k|	  c = (c << 4) + (c2 - '0');
  366|   124k|	} else if (c2 >= 'A' && c2 <= 'F') {
  ------------------
  |  Branch (366:13): [True: 97.0k, False: 27.5k]
  |  Branch (366:26): [True: 47.3k, False: 49.7k]
  ------------------
  367|  47.3k|	  c = (c << 4) + (c2 - 'A' + 10);
  368|  77.2k|	} else if (c2 >= 'a' && c2 <= 'f') {
  ------------------
  |  Branch (368:13): [True: 2.52k, False: 74.7k]
  |  Branch (368:26): [True: 595, False: 1.92k]
  ------------------
  369|    595|	  c = (c << 4) + (c2 - 'a' + 10);
  370|  76.6k|	} else {
  371|  76.6k|	  error(errSyntaxError, getPos(), "Invalid hex escape in name");
  372|  76.6k|	  goto notEscChar;
  373|  76.6k|	}
  374|  76.8k|	getChar();
  375|  76.8k|	if (c == 0) {
  ------------------
  |  Branch (375:6): [True: 923, False: 75.8k]
  ------------------
  376|    923|	  invalid = gTrue;
  ------------------
  |  |   17|    923|#define gTrue 1
  ------------------
  377|    923|	}
  378|  76.8k|      }
  379|  22.1M|     notEscChar:
  380|       |      // the PDF spec claims that names are limited to 127 chars, but
  381|       |      // Distiller 8 will produce longer names, and Acrobat 8 will
  382|       |      // accept longer names
  383|  22.1M|      ++n;
  384|  22.1M|      if (n < tokBufSize) {
  ------------------
  |  |   19|  22.1M|#define tokBufSize 128		// size of token buffer
  ------------------
  |  Branch (384:11): [True: 21.6M, False: 430k]
  ------------------
  385|  21.6M|	*p++ = (char)c;
  386|  21.6M|      } else if (n == tokBufSize) {
  ------------------
  |  |   19|   430k|#define tokBufSize 128		// size of token buffer
  ------------------
  |  Branch (386:18): [True: 1.60k, False: 429k]
  ------------------
  387|  1.60k|	*p = (char)c;
  388|  1.60k|	s = new GString(tokBuf, n);
  389|   429k|      } else {
  390|   429k|	s->append((char)c);
  391|   429k|      }
  392|  22.1M|    }
  393|  6.95M|    if (invalid) {
  ------------------
  |  Branch (393:9): [True: 923, False: 6.95M]
  ------------------
  394|    923|      error(errSyntaxError, getPos(), "Null character in name");
  395|    923|      obj->initError();
  396|    923|      if (s) {
  ------------------
  |  Branch (396:11): [True: 310, False: 613]
  ------------------
  397|    310|	delete s;
  398|    310|      }
  399|  6.95M|    } else if (n < tokBufSize) {
  ------------------
  |  |   19|  6.95M|#define tokBufSize 128		// size of token buffer
  ------------------
  |  Branch (399:16): [True: 6.94M, False: 1.29k]
  ------------------
  400|  6.94M|      *p = '\0';
  401|  6.94M|      obj->initName(tokBuf);
  402|  6.94M|    } else {
  403|  1.29k|      obj->initName(s->getCString());
  404|  1.29k|      delete s;
  405|  1.29k|    }
  406|  6.95M|    break;
  407|       |
  408|       |  // array punctuation
  409|  5.18M|  case '[':
  ------------------
  |  Branch (409:3): [True: 5.18M, False: 40.9M]
  ------------------
  410|  5.70M|  case ']':
  ------------------
  |  Branch (410:3): [True: 512k, False: 45.6M]
  ------------------
  411|  5.70M|    tokBuf[0] = (char)c;
  412|  5.70M|    tokBuf[1] = '\0';
  413|  5.70M|    obj->initCmd(tokBuf);
  414|  5.70M|    break;
  415|       |
  416|       |  // hex string or dict punctuation
  417|  3.98M|  case '<':
  ------------------
  |  Branch (417:3): [True: 3.98M, False: 42.1M]
  ------------------
  418|  3.98M|    c = lookChar();
  419|       |
  420|       |    // dict punctuation
  421|  3.98M|    if (c == '<') {
  ------------------
  |  Branch (421:9): [True: 3.21M, False: 772k]
  ------------------
  422|  3.21M|      getChar();
  423|  3.21M|      tokBuf[0] = tokBuf[1] = '<';
  424|  3.21M|      tokBuf[2] = '\0';
  425|  3.21M|      obj->initCmd(tokBuf);
  426|       |
  427|       |    // hex string
  428|  3.21M|    } else {
  429|   772k|      p = tokBuf;
  430|   772k|      m = n = 0;
  431|   772k|      c2 = 0;
  432|   772k|      s = NULL;
  433|   772k|      nErrors = 0;
  434|  53.5M|      while (nErrors < 100) {
  ------------------
  |  Branch (434:14): [True: 53.3M, False: 160k]
  ------------------
  435|  53.3M|	c = getChar();
  436|  53.3M|	if (c == '>') {
  ------------------
  |  Branch (436:6): [True: 608k, False: 52.7M]
  ------------------
  437|   608k|	  break;
  438|  52.7M|	} else if (c == EOF) {
  ------------------
  |  Branch (438:13): [True: 3.60k, False: 52.7M]
  ------------------
  439|  3.60k|	  error(errSyntaxError, getPos(), "Unterminated hex string");
  440|  3.60k|	  break;
  441|  52.7M|	} else if (specialChars[c] != 1) {
  ------------------
  |  Branch (441:13): [True: 46.5M, False: 6.19M]
  ------------------
  442|  46.5M|	  c2 = c2 << 4;
  443|  46.5M|	  if (c >= '0' && c <= '9') {
  ------------------
  |  Branch (443:8): [True: 41.9M, False: 4.66M]
  |  Branch (443:20): [True: 5.92M, False: 35.9M]
  ------------------
  444|  5.92M|	    c2 += c - '0';
  445|  40.6M|	  } else if (c >= 'A' && c <= 'F') {
  ------------------
  |  Branch (445:15): [True: 32.0M, False: 8.55M]
  |  Branch (445:27): [True: 747k, False: 31.3M]
  ------------------
  446|   747k|	    c2 += c - 'A' + 10;
  447|  39.8M|	  } else if (c >= 'a' && c <= 'f') {
  ------------------
  |  Branch (447:15): [True: 28.5M, False: 11.3M]
  |  Branch (447:27): [True: 6.41M, False: 22.1M]
  ------------------
  448|  6.41M|	    c2 += c - 'a' + 10;
  449|  33.4M|	  } else {
  450|  33.4M|	    error(errSyntaxError, getPos(),
  451|  33.4M|		  "Illegal character <{0:02x}> in hex string", c);
  452|  33.4M|	    ++nErrors;
  453|  33.4M|	  }
  454|  46.5M|	  if (++m == 2) {
  ------------------
  |  Branch (454:8): [True: 23.1M, False: 23.4M]
  ------------------
  455|  23.1M|	    if (n == tokBufSize) {
  ------------------
  |  |   19|  23.1M|#define tokBufSize 128		// size of token buffer
  ------------------
  |  Branch (455:10): [True: 3.94k, False: 23.1M]
  ------------------
  456|  3.94k|	      if (!s)
  ------------------
  |  Branch (456:12): [True: 1.74k, False: 2.20k]
  ------------------
  457|  1.74k|		s = new GString(tokBuf, tokBufSize);
  ------------------
  |  |   19|  1.74k|#define tokBufSize 128		// size of token buffer
  ------------------
  458|  2.20k|	      else
  459|  2.20k|		s->append(tokBuf, tokBufSize);
  ------------------
  |  |   19|  2.20k|#define tokBufSize 128		// size of token buffer
  ------------------
  460|  3.94k|	      p = tokBuf;
  461|  3.94k|	      n = 0;
  462|  3.94k|	    }
  463|  23.1M|	    *p++ = (char)c2;
  464|  23.1M|	    ++n;
  465|  23.1M|	    c2 = 0;
  466|  23.1M|	    m = 0;
  467|  23.1M|	  }
  468|  46.5M|	}
  469|  53.3M|      }
  470|   772k|      if (!s)
  ------------------
  |  Branch (470:11): [True: 770k, False: 1.74k]
  ------------------
  471|   770k|	s = new GString(tokBuf, n);
  472|  1.74k|      else
  473|  1.74k|	s->append(tokBuf, n);
  474|   772k|      if (m == 1)
  ------------------
  |  Branch (474:11): [True: 354k, False: 417k]
  ------------------
  475|   354k|	s->append((char)(c2 << 4));
  476|   772k|      obj->initString(s);
  477|   772k|    }
  478|  3.98M|    break;
  479|       |
  480|       |  // dict punctuation
  481|  3.06M|  case '>':
  ------------------
  |  Branch (481:3): [True: 3.06M, False: 43.0M]
  ------------------
  482|  3.06M|    c = lookChar();
  483|  3.06M|    if (c == '>') {
  ------------------
  |  Branch (483:9): [True: 1.93M, False: 1.12M]
  ------------------
  484|  1.93M|      getChar();
  485|  1.93M|      tokBuf[0] = tokBuf[1] = '>';
  486|  1.93M|      tokBuf[2] = '\0';
  487|  1.93M|      obj->initCmd(tokBuf);
  488|  1.93M|    } else {
  489|  1.12M|      error(errSyntaxError, getPos(), "Illegal character '>'");
  490|  1.12M|      obj->initError();
  491|  1.12M|    }
  492|  3.06M|    break;
  493|       |
  494|       |  // error
  495|   830k|  case ')':
  ------------------
  |  Branch (495:3): [True: 830k, False: 45.2M]
  ------------------
  496|  1.11M|  case '{':
  ------------------
  |  Branch (496:3): [True: 283k, False: 45.8M]
  ------------------
  497|  1.22M|  case '}':
  ------------------
  |  Branch (497:3): [True: 107k, False: 46.0M]
  ------------------
  498|  1.22M|    error(errSyntaxError, getPos(), "Illegal character '{0:c}'", c);
  499|  1.22M|    obj->initError();
  500|  1.22M|    break;
  501|       |
  502|       |  // command
  503|  17.7M|  default:
  ------------------
  |  Branch (503:3): [True: 17.7M, False: 28.3M]
  ------------------
  504|  17.7M|    p = tokBuf;
  505|  17.7M|    *p++ = (char)c;
  506|  17.7M|    n = 1;
  507|   219M|    while ((c = lookChar()) != EOF && !specialChars[c]) {
  ------------------
  |  Branch (507:12): [True: 218M, False: 23.9k]
  |  Branch (507:39): [True: 202M, False: 16.8M]
  ------------------
  508|   202M|      getChar();
  509|   202M|      if (++n == tokBufSize) {
  ------------------
  |  |   19|   202M|#define tokBufSize 128		// size of token buffer
  ------------------
  |  Branch (509:11): [True: 955k, False: 201M]
  ------------------
  510|   955k|	error(errSyntaxError, getPos(), "Command token too long");
  511|   955k|	break;
  512|   955k|      }
  513|   201M|      *p++ = (char)c;
  514|   201M|    }
  515|  17.7M|    *p = '\0';
  516|  17.7M|    if (tokBuf[0] == 't' && !strcmp(tokBuf, "true")) {
  ------------------
  |  Branch (516:9): [True: 2.00M, False: 15.7M]
  |  Branch (516:29): [True: 75.6k, False: 1.92M]
  ------------------
  517|  75.6k|      obj->initBool(gTrue);
  ------------------
  |  |   17|  75.6k|#define gTrue 1
  ------------------
  518|  17.7M|    } else if (tokBuf[0] == 'f' && !strcmp(tokBuf, "false")) {
  ------------------
  |  Branch (518:16): [True: 39.8k, False: 17.6M]
  |  Branch (518:36): [True: 879, False: 38.9k]
  ------------------
  519|    879|      obj->initBool(gFalse);
  ------------------
  |  |   18|    879|#define gFalse 0
  ------------------
  520|  17.7M|    } else if (tokBuf[0] == 'n' && !strcmp(tokBuf, "null")) {
  ------------------
  |  Branch (520:16): [True: 95.0k, False: 17.6M]
  |  Branch (520:36): [True: 942, False: 94.0k]
  ------------------
  521|    942|      obj->initNull();
  522|  17.7M|    } else {
  523|  17.7M|      obj->initCmd(tokBuf);
  524|  17.7M|    }
  525|  17.7M|    break;
  526|  46.1M|  }
  527|       |
  528|  46.1M|  return obj;
  529|  46.1M|}
_ZN5Lexer14skipToNextLineEv:
  531|   113k|void Lexer::skipToNextLine() {
  532|   113k|  int c;
  533|       |
  534|   460k|  while (1) {
  ------------------
  |  Branch (534:10): [True: 460k, Folded]
  ------------------
  535|   460k|    c = getChar();
  536|   460k|    if (c == EOF || c == '\n') {
  ------------------
  |  Branch (536:9): [True: 3.18k, False: 457k]
  |  Branch (536:21): [True: 44.1k, False: 413k]
  ------------------
  537|  47.3k|      return;
  538|  47.3k|    }
  539|   413k|    if (c == '\r') {
  ------------------
  |  Branch (539:9): [True: 66.6k, False: 346k]
  ------------------
  540|  66.6k|      if ((c = lookChar()) == '\n') {
  ------------------
  |  Branch (540:11): [True: 55.6k, False: 10.9k]
  ------------------
  541|  55.6k|	getChar();
  542|  55.6k|      }
  543|  66.6k|      return;
  544|  66.6k|    }
  545|   413k|  }
  546|   113k|}
_ZN5Lexer9skipToEOFEv:
  548|  34.5k|void Lexer::skipToEOF() {
  549|  2.31M|  while (getChar() != EOF) ;
  ------------------
  |  Branch (549:10): [True: 2.28M, False: 34.5k]
  ------------------
  550|  34.5k|}
_ZN5Lexer7isSpaceEi:
  552|  46.6M|GBool Lexer::isSpace(int c) {
  553|  46.6M|  return c >= 0 && c <= 0xff && specialChars[c] == 1;
  ------------------
  |  Branch (553:10): [True: 46.6M, False: 9.75k]
  |  Branch (553:20): [True: 46.6M, False: 0]
  |  Branch (553:33): [True: 9.80M, False: 36.8M]
  ------------------
  554|  46.6M|}

_ZN5Lexer8skipCharEv:
   49|   297k|  void skipChar() { getChar(); }
_ZN5Lexer9getStreamEv:
   56|   446k|    { return curStr.isNone() ? (Stream *)NULL : curStr.getStream(); }
  ------------------
  |  Branch (56:14): [True: 3.18k, False: 443k]
  ------------------
_ZN5Lexer6getPosEv:
   60|  51.8M|    { return curStr.isNone() ? -1 : curStr.streamGetPos(); }
  ------------------
  |  Branch (60:14): [True: 461k, False: 51.3M]
  ------------------
_ZN5Lexer6setPosEli:
   64|  93.9k|    { if (!curStr.isNone()) curStr.streamSetPos(pos, dir); }
  ------------------
  |  Branch (64:11): [True: 93.9k, False: 0]
  ------------------

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

_ZN10LinkActionD2Ev:
   41|    755|  virtual ~LinkAction() {}
_ZN8LinkDest4isOkEv:
   85|    409|  GBool isOk() { return ok; }
_ZN8LinkGoTo4isOkEv:
  135|    437|  virtual GBool isOk() { return dest || namedDest; }
  ------------------
  |  Branch (135:33): [True: 257, False: 180]
  |  Branch (135:41): [True: 20, False: 160]
  ------------------
_ZN9LinkGoToR4isOkEv:
  165|    132|  virtual GBool isOk() { return fileName && (dest || namedDest); }
  ------------------
  |  Branch (165:33): [True: 16, False: 116]
  |  Branch (165:46): [True: 7, False: 9]
  |  Branch (165:54): [True: 3, False: 6]
  ------------------
_ZN7LinkURI4isOkEv:
  223|     61|  virtual GBool isOk() { return uri != NULL; }
_ZN9LinkNamed4isOkEv:
  247|     17|  virtual GBool isOk() { return name != NULL; }
_ZN14LinkJavaScript4isOkEv:
  296|     41|  virtual GBool isOk() { return js != NULL; }
_ZN11LinkUnknown4isOkEv:
  373|     67|  virtual GBool isOk() { return action != NULL; }

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

_ZN6Object9initArrayEP4XRef:
   51|   709k|Object *Object::initArray(XRef *xref) {
   52|   709k|  initObj(objArray);
  ------------------
  |  |   77|   709k|#define initObj(t) type = t
  ------------------
   53|   709k|  array = new Array(xref);
   54|   709k|  return this;
   55|   709k|}
_ZN6Object8initDictEP4XRef:
   57|   632k|Object *Object::initDict(XRef *xref) {
   58|   632k|  initObj(objDict);
  ------------------
  |  |   77|   632k|#define initObj(t) type = t
  ------------------
   59|   632k|  dict = new Dict(xref);
   60|   632k|  return this;
   61|   632k|}
_ZN6Object8initDictEP4Dict:
   63|  5.36k|Object *Object::initDict(Dict *dictA) {
   64|  5.36k|  initObj(objDict);
  ------------------
  |  |   77|  5.36k|#define initObj(t) type = t
  ------------------
   65|  5.36k|  dict = dictA;
   66|  5.36k|  dict->incRef();
   67|  5.36k|  return this;
   68|  5.36k|}
_ZN6Object10initStreamEP6Stream:
   70|   489k|Object *Object::initStream(Stream *streamA) {
   71|   489k|  initObj(objStream);
  ------------------
  |  |   77|   489k|#define initObj(t) type = t
  ------------------
   72|   489k|  stream = streamA;
   73|   489k|  return this;
   74|   489k|}
_ZN6Object4copyEPS_:
   76|   203M|Object *Object::copy(Object *obj) {
   77|   203M|  *obj = *this;
   78|   203M|  switch (type) {
   79|   780k|  case objString:
  ------------------
  |  Branch (79:3): [True: 780k, False: 202M]
  ------------------
   80|   780k|    obj->string = string->copy();
   81|   780k|    break;
   82|  6.64M|  case objName:
  ------------------
  |  Branch (82:3): [True: 6.64M, False: 196M]
  ------------------
   83|  6.64M|    obj->name = copyString(name);
   84|  6.64M|    break;
   85|  2.04M|  case objArray:
  ------------------
  |  Branch (85:3): [True: 2.04M, False: 200M]
  ------------------
   86|  2.04M|    array->incRef();
   87|  2.04M|    break;
   88|  2.36M|  case objDict:
  ------------------
  |  Branch (88:3): [True: 2.36M, False: 200M]
  ------------------
   89|  2.36M|    dict->incRef();
   90|  2.36M|    break;
   91|   901k|  case objStream:
  ------------------
  |  Branch (91:3): [True: 901k, False: 202M]
  ------------------
   92|   901k|    obj->stream = stream->copy();
   93|   901k|    break;
   94|  23.7M|  case objCmd:
  ------------------
  |  Branch (94:3): [True: 23.7M, False: 179M]
  ------------------
   95|  23.7M|    obj->cmd = copyString(cmd);
   96|  23.7M|    break;
   97|   166M|  default:
  ------------------
  |  Branch (97:3): [True: 166M, False: 36.4M]
  ------------------
   98|   166M|    break;
   99|   203M|  }
  100|       |#ifdef DEBUG_OBJECT_MEM
  101|       |#if MULTITHREADED
  102|       |  gAtomicIncrement(&numAlloc[type]);
  103|       |#else
  104|       |  ++numAlloc[type];
  105|       |#endif
  106|       |#endif
  107|   203M|  return obj;
  108|   203M|}
_ZN6Object5fetchEP4XRefPS_i:
  110|  10.0M|Object *Object::fetch(XRef *xref, Object *obj, int recursion) {
  111|  10.0M|  return (type == objRef && xref) ?
  ------------------
  |  Branch (111:11): [True: 2.27M, False: 7.74M]
  |  Branch (111:29): [True: 2.27M, False: 1]
  ------------------
  112|  7.74M|         xref->fetch(ref.num, ref.gen, obj, recursion) : copy(obj);
  113|  10.0M|}
_ZN6Object4freeEv:
  115|   449M|void Object::free() {
  116|   449M|  switch (type) {
  117|  1.80M|  case objString:
  ------------------
  |  Branch (117:3): [True: 1.80M, False: 447M]
  ------------------
  118|  1.80M|    delete string;
  119|  1.80M|    break;
  120|  13.5M|  case objName:
  ------------------
  |  Branch (120:3): [True: 13.5M, False: 435M]
  ------------------
  121|  13.5M|    gfree(name);
  122|  13.5M|    break;
  123|  2.75M|  case objArray:
  ------------------
  |  Branch (123:3): [True: 2.75M, False: 446M]
  ------------------
  124|  2.75M|    if (!array->decRef()) {
  ------------------
  |  Branch (124:9): [True: 709k, False: 2.04M]
  ------------------
  125|   709k|      delete array;
  126|   709k|    }
  127|  2.75M|    break;
  128|  3.00M|  case objDict:
  ------------------
  |  Branch (128:3): [True: 3.00M, False: 446M]
  ------------------
  129|  3.00M|    if (!dict->decRef()) {
  ------------------
  |  Branch (129:9): [True: 632k, False: 2.37M]
  ------------------
  130|   632k|      delete dict;
  131|   632k|    }
  132|  3.00M|    break;
  133|  1.39M|  case objStream:
  ------------------
  |  Branch (133:3): [True: 1.39M, False: 448M]
  ------------------
  134|  1.39M|    delete stream;
  135|  1.39M|    break;
  136|  52.3M|  case objCmd:
  ------------------
  |  Branch (136:3): [True: 52.3M, False: 397M]
  ------------------
  137|  52.3M|    gfree(cmd);
  138|  52.3M|    break;
  139|   374M|  default:
  ------------------
  |  Branch (139:3): [True: 374M, False: 74.8M]
  ------------------
  140|   374M|    break;
  141|   449M|  }
  142|       |#ifdef DEBUG_OBJECT_MEM
  143|       |#if MULTITHREADED
  144|       |  gAtomicDecrement(&numAlloc[type]);
  145|       |#else
  146|       |  --numAlloc[type];
  147|       |#endif
  148|       |#endif
  149|   449M|  type = objNone;
  150|   449M|}
_ZN6Object11getTypeNameEv:
  152|   339k|const char *Object::getTypeName() {
  153|   339k|  return objTypeNames[type];
  154|   339k|}

_ZN6ObjectC2Ev:
   85|   359M|    type(objNone) {}
_ZN6Object8initNullEv:
   99|  41.0M|    { initObj(objNull); return this; }
  ------------------
  |  |   77|  41.0M|#define initObj(t) type = t
  ------------------
_ZN6Object8isStreamEv:
  134|  35.1M|  GBool isStream() { return type == objStream; }
_ZN6Object9getStreamEv:
  158|   767k|  Stream *getStream() { return stream; }
_ZN6Object8initBoolEi:
   89|  76.5k|    { initObj(objBool); booln = boolnA; return this; }
  ------------------
  |  |   77|  76.5k|#define initObj(t) type = t
  ------------------
_ZN6Object7initIntEi:
   91|  10.4M|    { initObj(objInt); intg = intgA; return this; }
  ------------------
  |  |   77|  10.4M|#define initObj(t) type = t
  ------------------
_ZN6Object8initRealEd:
   93|   580k|    { initObj(objReal); real = realA; return this; }
  ------------------
  |  |   77|   580k|#define initObj(t) type = t
  ------------------
_ZN6Object10initStringEP7GString:
   95|  1.02M|    { initObj(objString); string = stringA; return this; }
  ------------------
  |  |   77|  1.02M|#define initObj(t) type = t
  ------------------
_ZN6Object8initNameEPKc:
   97|  6.95M|    { initObj(objName); name = copyString(nameA); return this; }
  ------------------
  |  |   77|  6.95M|#define initObj(t) type = t
  ------------------
_ZN6Object7initRefEii:
  105|   771k|    { initObj(objRef); ref.num = numA; ref.gen = genA; return this; }
  ------------------
  |  |   77|   771k|#define initObj(t) type = t
  ------------------
_ZN6Object7initCmdEPc:
  107|  28.5M|    { initObj(objCmd); cmd = copyString(cmdA); return this; }
  ------------------
  |  |   77|  28.5M|#define initObj(t) type = t
  ------------------
_ZN6Object9initErrorEv:
  109|  2.36M|    { initObj(objError); return this; }
  ------------------
  |  |   77|  2.36M|#define initObj(t) type = t
  ------------------
_ZN6Object7initEOFEv:
  111|   152M|    { initObj(objEOF); return this; }
  ------------------
  |  |   77|   152M|#define initObj(t) type = t
  ------------------
_ZN6Object6isBoolEv:
  125|  31.0k|  GBool isBool() { return type == objBool; }
_ZN6Object5isIntEv:
  126|   261M|  GBool isInt() { return type == objInt; }
_ZN6Object5isNumEv:
  128|   212k|  GBool isNum() { return type == objInt || type == objReal; }
  ------------------
  |  Branch (128:26): [True: 4.01k, False: 208k]
  |  Branch (128:44): [True: 7.49k, False: 200k]
  ------------------
_ZN6Object8isStringEv:
  129|   174M|  GBool isString() { return type == objString; }
_ZN6Object6isNameEv:
  130|  16.6M|  GBool isName() { return type == objName; }
_ZN6Object6isNullEv:
  131|   659k|  GBool isNull() { return type == objNull; }
_ZN6Object7isArrayEv:
  132|  7.98M|  GBool isArray() { return type == objArray; }
_ZN6Object6isDictEv:
  133|  2.38M|  GBool isDict() { return type == objDict; }
_ZN6Object5isRefEv:
  135|  17.9M|  GBool isRef() { return type == objRef; }
_ZN6Object7isErrorEv:
  137|  2.77M|  GBool isError() { return type == objError; }
_ZN6Object5isEOFEv:
  138|  41.5M|  GBool isEOF() { return type == objEOF; }
_ZN6Object6isNoneEv:
  139|  1.82G|  GBool isNone() { return type == objNone; }
_ZN6Object6isNameEPKc:
  143|   847k|    { return type == objName && !strcmp(name, nameA); }
  ------------------
  |  Branch (143:14): [True: 725k, False: 121k]
  |  Branch (143:33): [True: 389k, False: 336k]
  ------------------
_ZN6Object5isCmdEPKc:
  147|   260M|    { return type == objCmd && !strcmp(cmd, cmdA); }
  ------------------
  |  Branch (147:14): [True: 63.2M, False: 196M]
  |  Branch (147:32): [True: 3.27M, False: 60.0M]
  ------------------
_ZN6Object7getBoolEv:
  150|  6.04k|  GBool getBool() { return booln; }
_ZN6Object6getIntEv:
  151|  5.99M|  int getInt() { return intg; }
_ZN6Object6getNumEv:
  153|  11.5k|  double getNum() { return type == objInt ? (double)intg : real; }
  ------------------
  |  Branch (153:28): [True: 4.01k, False: 7.55k]
  ------------------
_ZN6Object9getStringEv:
  154|   152k|  GString *getString() { return string; }
_ZN6Object7getNameEv:
  155|  2.86M|  char *getName() { return name; }
_ZN6Object8getArrayEv:
  156|    409|  Array *getArray() { return array; }
_ZN6Object7getDictEv:
  157|  1.18M|  Dict *getDict() { return dict; }
_ZN6Object6getRefEv:
  159|   417k|  Ref getRef() { return ref; }
_ZN6Object9getRefNumEv:
  160|  2.53M|  int getRefNum() { return ref.num; }
_ZN6Object9getRefGenEv:
  161|  1.58M|  int getRefGen() { return ref.gen; }
_ZN6Object14arrayGetLengthEv:
  233|  19.6M|  { return array->getLength(); }
_ZN6Object8arrayAddEPS_:
  236|  20.4M|  { array->add(elem); }
_ZN6Object8arrayGetEiPS_i:
  239|   829k|  { return array->get(i, obj, recursion); }
_ZN6Object10arrayGetNFEiPS_:
  242|  17.7M|  { return array->getNF(i, obj); }
_ZN6Object7dictAddEPcPS_:
  254|  2.73M|  { dict->add(key, val); }
_ZN6Object10dictLookupEPKcPS_i:
  263|  1.20M|  { return dict->lookup(key, obj, recursion); }
_ZN6Object12dictLookupNFEPKcPS_:
  266|  57.2k|  { return dict->lookupNF(key, obj); }
_ZN6Object11streamResetEv:
  290|   397k|  { stream->reset(); }
_ZN6Object11streamCloseEv:
  293|   391k|  { stream->close(); }
_ZN6Object13streamGetCharEv:
  296|  1.33G|  { return stream->getChar(); }
_ZN6Object14streamLookCharEv:
  299|   283M|  { return stream->lookChar(); }
_ZN6Object12streamGetPosEv:
  308|  51.3M|  { return stream->getPos(); }
_ZN6Object12streamSetPosEli:
  311|  93.9k|  { stream->setPos(pos, dir); }
_ZN6Object13streamGetDictEv:
  314|   757k|  { return stream->getDict(); }

_ZN15OptionalContentC2EP6PDFDoc:
   39|  2.97k|OptionalContent::OptionalContent(PDFDoc *doc) {
   40|  2.97k|  Object *ocProps;
   41|  2.97k|  Object ocgList, defView, uad, obj1, obj2, obj3, obj4;
   42|  2.97k|  Ref ref1;
   43|  2.97k|  OptionalContentGroup *ocg;
   44|  2.97k|  int i, j;
   45|       |
   46|  2.97k|  xref = doc->getXRef();
   47|  2.97k|  ocgs = new GList();
   48|  2.97k|  display = NULL;
   49|       |
   50|  2.97k|  if ((ocProps = doc->getCatalog()->getOCProperties())->isDict()) {
  ------------------
  |  Branch (50:7): [True: 573, False: 2.40k]
  ------------------
   51|    573|    if (ocProps->dictLookup("OCGs", &ocgList)->isArray()) {
  ------------------
  |  Branch (51:9): [True: 521, False: 52]
  ------------------
   52|       |
   53|       |      //----- read the OCG list
   54|  22.5k|      for (i = 0; i < ocgList.arrayGetLength(); ++i) {
  ------------------
  |  Branch (54:19): [True: 22.0k, False: 521]
  ------------------
   55|  22.0k|	if (ocgList.arrayGetNF(i, &obj1)->isRef()) {
  ------------------
  |  Branch (55:6): [True: 5.91k, False: 16.1k]
  ------------------
   56|  5.91k|	  ref1 = obj1.getRef();
   57|  5.91k|	  obj1.fetch(xref, &obj2);
   58|  5.91k|	  if ((ocg = OptionalContentGroup::parse(&ref1, &obj2))) {
  ------------------
  |  Branch (58:8): [True: 3.36k, False: 2.55k]
  ------------------
   59|  3.36k|	    ocgs->append(ocg);
   60|  3.36k|	  }
   61|  5.91k|	  obj2.free();
   62|  5.91k|	}
   63|  22.0k|	obj1.free();
   64|  22.0k|      }
   65|       |
   66|       |      //----- read the default viewing OCCD
   67|    521|      if (ocProps->dictLookup("D", &defView)->isDict()) {
  ------------------
  |  Branch (67:11): [True: 330, False: 191]
  ------------------
   68|       |
   69|       |	//----- read the usage app dicts
   70|    330|	if (defView.dictLookup("AS", &obj1)->isArray()) {
  ------------------
  |  Branch (70:6): [True: 46, False: 284]
  ------------------
   71|  2.16k|	  for (i = 0; i < obj1.arrayGetLength(); ++i) {
  ------------------
  |  Branch (71:16): [True: 2.11k, False: 46]
  ------------------
   72|  2.11k|	    if (obj1.arrayGet(i, &uad)->isDict()) {
  ------------------
  |  Branch (72:10): [True: 191, False: 1.92k]
  ------------------
   73|    191|	      if (uad.dictLookup("Event", &obj2)->isName("View")) {
  ------------------
  |  Branch (73:12): [True: 31, False: 160]
  ------------------
   74|     31|		if (uad.dictLookup("OCGs", &obj3)->isArray()) {
  ------------------
  |  Branch (74:7): [True: 27, False: 4]
  ------------------
   75|    313|		  for (j = 0; j < obj3.arrayGetLength(); ++j) {
  ------------------
  |  Branch (75:17): [True: 286, False: 27]
  ------------------
   76|    286|		    if (obj3.arrayGetNF(j, &obj4)->isRef()) {
  ------------------
  |  Branch (76:11): [True: 70, False: 216]
  ------------------
   77|     70|		      ref1 = obj4.getRef();
   78|     70|		      if ((ocg = findOCG(&ref1))) {
  ------------------
  |  Branch (78:13): [True: 29, False: 41]
  ------------------
   79|     29|			ocg->setInViewUsageAppDict();
   80|     29|		      }
   81|     70|		    }
   82|    286|		    obj4.free();
   83|    286|		  }
   84|     27|		}
   85|     31|		obj3.free();
   86|     31|	      }
   87|    191|	      obj2.free();
   88|    191|	    }
   89|  2.11k|	    uad.free();
   90|  2.11k|	  }
   91|     46|	}
   92|    330|	obj1.free();
   93|       |
   94|       |	//----- initial state from OCCD
   95|    330|	if (defView.dictLookup("OFF", &obj1)->isArray()) {
  ------------------
  |  Branch (95:6): [True: 42, False: 288]
  ------------------
   96|  4.77k|	  for (i = 0; i < obj1.arrayGetLength(); ++i) {
  ------------------
  |  Branch (96:16): [True: 4.73k, False: 42]
  ------------------
   97|  4.73k|	    if (obj1.arrayGetNF(i, &obj2)->isRef()) {
  ------------------
  |  Branch (97:10): [True: 2.00k, False: 2.72k]
  ------------------
   98|  2.00k|	      ref1 = obj2.getRef();
   99|  2.00k|	      if ((ocg = findOCG(&ref1))) {
  ------------------
  |  Branch (99:12): [True: 886, False: 1.12k]
  ------------------
  100|    886|		ocg->setState(gFalse);
  ------------------
  |  |   18|    886|#define gFalse 0
  ------------------
  101|  1.12k|	      } else {
  102|  1.12k|		error(errSyntaxError, -1,
  103|  1.12k|		      "Invalid OCG reference in OFF array in default viewing OCCD");
  104|  1.12k|	      }
  105|  2.00k|	    }
  106|  4.73k|	    obj2.free();
  107|  4.73k|	  }
  108|     42|	}
  109|    330|	obj1.free();
  110|       |
  111|       |	//----- initial state from OCG usage dict
  112|  1.18k|	for (i = 0; i < ocgs->getLength(); ++i) {
  ------------------
  |  Branch (112:14): [True: 857, False: 330]
  ------------------
  113|    857|	  ocg = (OptionalContentGroup *)ocgs->get(i);
  114|    857|	  if (ocg->getInViewUsageAppDict() &&
  ------------------
  |  Branch (114:8): [True: 25, False: 832]
  ------------------
  115|     25|	      ocg->getViewState() != ocUsageUnset) {
  ------------------
  |  Branch (115:8): [True: 0, False: 25]
  ------------------
  116|      0|	    ocg->setState(ocg->getViewState() == ocUsageOn);
  117|      0|	  }
  118|    857|	}
  119|       |
  120|       |	//----- display order
  121|    330|	if (defView.dictLookup("Order", &obj1)->isArray()) {
  ------------------
  |  Branch (121:6): [True: 272, False: 58]
  ------------------
  122|    272|	  display = OCDisplayNode::parse(&obj1, this, xref);
  123|    272|	}
  124|    330|	obj1.free();
  125|       |
  126|    330|      } else {
  127|    191|	error(errSyntaxError, -1, "Missing or invalid default viewing OCCD");
  128|    191|      }
  129|    521|      defView.free();
  130|       |
  131|    521|    }
  132|    573|    ocgList.free();
  133|    573|  }
  134|       |
  135|  2.97k|  if (!display) {
  ------------------
  |  Branch (135:7): [True: 2.70k, False: 273]
  ------------------
  136|  2.70k|    display = new OCDisplayNode();
  137|  2.70k|  }
  138|  2.97k|}
_ZN15OptionalContentD2Ev:
  140|  2.97k|OptionalContent::~OptionalContent() {
  141|  2.97k|  deleteGList(ocgs, OptionalContentGroup);
  ------------------
  |  |   94|  2.97k|  do {                                              \
  |  |   95|  2.97k|    GList *_list = (list);                          \
  |  |   96|  2.97k|    {                                               \
  |  |   97|  2.97k|      int _i;                                       \
  |  |   98|  6.33k|      for (_i = 0; _i < _list->getLength(); ++_i) { \
  |  |  ------------------
  |  |  |  Branch (98:20): [True: 3.36k, False: 2.97k]
  |  |  ------------------
  |  |   99|  3.36k|        delete (T*)_list->get(_i);                  \
  |  |  100|  3.36k|      }                                             \
  |  |  101|  2.97k|      delete _list;                                 \
  |  |  102|  2.97k|    }                                               \
  |  |  103|  2.97k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (103:12): [Folded, False: 2.97k]
  |  |  ------------------
  ------------------
  142|  2.97k|  delete display;
  143|  2.97k|}
_ZN15OptionalContent7findOCGEP3Ref:
  153|   394k|OptionalContentGroup *OptionalContent::findOCG(Ref *ref) {
  154|   394k|  OptionalContentGroup *ocg;
  155|   394k|  int i;
  156|       |
  157|   566k|  for (i = 0; i < ocgs->getLength(); ++i) {
  ------------------
  |  Branch (157:15): [True: 179k, False: 386k]
  ------------------
  158|   179k|    ocg = (OptionalContentGroup *)ocgs->get(i);
  159|   179k|    if (ocg->matches(ref)) {
  ------------------
  |  Branch (159:9): [True: 7.53k, False: 171k]
  ------------------
  160|  7.53k|      return ocg;
  161|  7.53k|    }
  162|   179k|  }
  163|   386k|  return NULL;
  164|   394k|}
_ZN20OptionalContentGroup5parseEP3RefP6Object:
  328|  5.91k|OptionalContentGroup *OptionalContentGroup::parse(Ref *refA, Object *obj) {
  329|  5.91k|  TextString *nameA;
  330|  5.91k|  Object obj1, obj2, obj3;
  331|  5.91k|  OCUsageState viewStateA, printStateA;
  332|       |
  333|  5.91k|  if (!obj->isDict()) {
  ------------------
  |  Branch (333:7): [True: 2.06k, False: 3.84k]
  ------------------
  334|  2.06k|    return NULL;
  335|  2.06k|  }
  336|  3.84k|  if (!obj->dictLookup("Name", &obj1)->isString()) {
  ------------------
  |  Branch (336:7): [True: 483, False: 3.36k]
  ------------------
  337|    483|    error(errSyntaxError, -1, "Missing or invalid Name in OCG");
  338|    483|    obj1.free();
  339|    483|    return NULL;
  340|    483|  }
  341|  3.36k|  nameA = new TextString(obj1.getString());
  342|  3.36k|  obj1.free();
  343|       |
  344|  3.36k|  viewStateA = printStateA = ocUsageUnset;
  345|  3.36k|  if (obj->dictLookup("Usage", &obj1)->isDict()) {
  ------------------
  |  Branch (345:7): [True: 46, False: 3.31k]
  ------------------
  346|     46|    if (obj1.dictLookup("View", &obj2)->isDict()) {
  ------------------
  |  Branch (346:9): [True: 33, False: 13]
  ------------------
  347|     33|      if (obj2.dictLookup("ViewState", &obj3)->isName()) {
  ------------------
  |  Branch (347:11): [True: 23, False: 10]
  ------------------
  348|     23|	if (obj3.isName("ON")) {
  ------------------
  |  Branch (348:6): [True: 13, False: 10]
  ------------------
  349|     13|	  viewStateA = ocUsageOn;
  350|     13|	} else {
  351|     10|	  viewStateA = ocUsageOff;
  352|     10|	}
  353|     23|      }
  354|     33|      obj3.free();
  355|     33|    }
  356|     46|    obj2.free();
  357|     46|    if (obj1.dictLookup("Print", &obj2)->isDict()) {
  ------------------
  |  Branch (357:9): [True: 36, False: 10]
  ------------------
  358|     36|      if (obj2.dictLookup("PrintState", &obj3)->isName()) {
  ------------------
  |  Branch (358:11): [True: 26, False: 10]
  ------------------
  359|     26|	if (obj3.isName("ON")) {
  ------------------
  |  Branch (359:6): [True: 13, False: 13]
  ------------------
  360|     13|	  printStateA = ocUsageOn;
  361|     13|	} else {
  362|     13|	  printStateA = ocUsageOff;
  363|     13|	}
  364|     26|      }
  365|     36|      obj3.free();
  366|     36|    }
  367|     46|    obj2.free();
  368|     46|  }
  369|  3.36k|  obj1.free();
  370|       |
  371|  3.36k|  return new OptionalContentGroup(refA, nameA, viewStateA, printStateA);
  372|  3.84k|}
_ZN20OptionalContentGroupC2EP3RefP10TextString12OCUsageStateS4_:
  376|  3.36k|					   OCUsageState printStateA) {
  377|  3.36k|  ref = *refA;
  378|  3.36k|  name = nameA;
  379|  3.36k|  viewState = viewStateA;
  380|  3.36k|  printState = printStateA;
  381|  3.36k|  state = gTrue;
  ------------------
  |  |   17|  3.36k|#define gTrue 1
  ------------------
  382|  3.36k|  inViewUsageAppDict = gFalse;
  ------------------
  |  |   18|  3.36k|#define gFalse 0
  ------------------
  383|  3.36k|}
_ZN20OptionalContentGroupD2Ev:
  385|  3.36k|OptionalContentGroup::~OptionalContentGroup() {
  386|  3.36k|  delete name;
  387|  3.36k|}
_ZN20OptionalContentGroup7matchesEP3Ref:
  389|   179k|GBool OptionalContentGroup::matches(Ref *refA) {
  390|   179k|  return refA->num == ref.num && refA->gen == ref.gen;
  ------------------
  |  Branch (390:10): [True: 13.6k, False: 165k]
  |  Branch (390:34): [True: 7.53k, False: 6.10k]
  ------------------
  391|   179k|}
_ZN13OCDisplayNode5parseEP6ObjectP15OptionalContentP4XRefi:
  404|  7.03M|				    XRef *xref, int recursion) {
  405|  7.03M|  Object obj2, obj3;
  406|  7.03M|  Ref ref;
  407|  7.03M|  OptionalContentGroup *ocgA;
  408|  7.03M|  OCDisplayNode *node, *child;
  409|  7.03M|  int i;
  410|       |
  411|  7.03M|  if (recursion > displayNodeRecursionLimit) {
  ------------------
  |  |   35|  7.03M|#define displayNodeRecursionLimit 50
  ------------------
  |  Branch (411:7): [True: 1.19M, False: 5.83M]
  ------------------
  412|  1.19M|    error(errSyntaxError, -1, "Loop detected in optional content order");
  413|  1.19M|    return NULL;
  414|  1.19M|  }
  415|  5.83M|  if (obj->isRef()) {
  ------------------
  |  Branch (415:7): [True: 392k, False: 5.44M]
  ------------------
  416|   392k|    ref = obj->getRef();
  417|   392k|    if ((ocgA = oc->findOCG(&ref))) {
  ------------------
  |  Branch (417:9): [True: 6.61k, False: 385k]
  ------------------
  418|  6.61k|      return new OCDisplayNode(ocgA);
  419|  6.61k|    }
  420|   392k|  }
  421|  5.82M|  obj->fetch(xref, &obj2);
  422|  5.82M|  if (!obj2.isArray()) {
  ------------------
  |  Branch (422:7): [True: 5.12M, False: 701k]
  ------------------
  423|  5.12M|    obj2.free();
  424|  5.12M|    return NULL;
  425|  5.12M|  }
  426|   701k|  i = 0;
  427|   701k|  if (obj2.arrayGetLength() >= 1) {
  ------------------
  |  Branch (427:7): [True: 700k, False: 1.34k]
  ------------------
  428|   700k|    if (obj2.arrayGet(0, &obj3)->isString()) {
  ------------------
  |  Branch (428:9): [True: 68.3k, False: 632k]
  ------------------
  429|  68.3k|      node = new OCDisplayNode(obj3.getString());
  430|  68.3k|      i = 1;
  431|   632k|    } else {
  432|   632k|      node = new OCDisplayNode();
  433|   632k|    }
  434|   700k|    obj3.free();
  435|   700k|  } else {
  436|  1.34k|    node = new OCDisplayNode();
  437|  1.34k|  }
  438|  7.73M|  for (; i < obj2.arrayGetLength(); ++i) {
  ------------------
  |  Branch (438:10): [True: 7.03M, False: 701k]
  ------------------
  439|  7.03M|    obj2.arrayGetNF(i, &obj3);
  440|  7.03M|    if ((child = OCDisplayNode::parse(&obj3, oc, xref, recursion + 1))) {
  ------------------
  |  Branch (440:9): [True: 708k, False: 6.32M]
  ------------------
  441|   708k|      if (!child->ocg && !child->name && node->getNumChildren() > 0) {
  ------------------
  |  Branch (441:11): [True: 701k, False: 6.61k]
  |  Branch (441:26): [True: 0, False: 701k]
  |  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|   708k|      } else {
  448|   708k|	node->addChild(child);
  449|   708k|      }
  450|   708k|    }
  451|  7.03M|    obj3.free();
  452|  7.03M|  }
  453|   701k|  obj2.free();
  454|   701k|  return node;
  455|  5.82M|}
_ZN13OCDisplayNodeC2Ev:
  457|   636k|OCDisplayNode::OCDisplayNode() {
  458|   636k|  name = new TextString();
  459|   636k|  ocg = NULL;
  460|   636k|  parent = NULL;
  461|       |  children = NULL;
  462|   636k|}
_ZN13OCDisplayNodeC2EP7GString:
  464|  68.3k|OCDisplayNode::OCDisplayNode(GString *nameA) {
  465|  68.3k|  name = new TextString(nameA);
  466|  68.3k|  ocg = NULL;
  467|       |  children = NULL;
  468|  68.3k|}
_ZN13OCDisplayNodeC2EP20OptionalContentGroup:
  470|  6.61k|OCDisplayNode::OCDisplayNode(OptionalContentGroup *ocgA) {
  471|  6.61k|  name = new TextString(ocgA->name);
  472|  6.61k|  ocg = ocgA;
  473|       |  children = NULL;
  474|  6.61k|}
_ZN13OCDisplayNode8addChildEPS_:
  476|   708k|void OCDisplayNode::addChild(OCDisplayNode *child) {
  477|   708k|  if (!children) {
  ------------------
  |  Branch (477:7): [True: 493k, False: 215k]
  ------------------
  478|   493k|    children = new GList();
  479|   493k|  }
  480|   708k|  children->append(child);
  481|   708k|  child->parent = this;
  482|   708k|}
_ZN13OCDisplayNodeD2Ev:
  509|   711k|OCDisplayNode::~OCDisplayNode() {
  510|   711k|  delete name;
  511|   711k|  if (children) {
  ------------------
  |  Branch (511:7): [True: 493k, False: 217k]
  ------------------
  512|   493k|    deleteGList(children, OCDisplayNode);
  ------------------
  |  |   94|   493k|  do {                                              \
  |  |   95|   493k|    GList *_list = (list);                          \
  |  |   96|   493k|    {                                               \
  |  |   97|   493k|      int _i;                                       \
  |  |   98|  1.20M|      for (_i = 0; _i < _list->getLength(); ++_i) { \
  |  |  ------------------
  |  |  |  Branch (98:20): [True: 708k, False: 493k]
  |  |  ------------------
  |  |   99|   708k|        delete (T*)_list->get(_i);                  \
  |  |  100|   708k|      }                                             \
  |  |  101|   493k|      delete _list;                                 \
  |  |  102|   493k|    }                                               \
  |  |  103|   493k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (103:12): [Folded, False: 493k]
  |  |  ------------------
  ------------------
  513|   493k|  }
  514|   711k|}

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

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

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

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

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

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

_ZN6ParserC2EP4XRefP5Lexeri:
   22|   383k|Parser::Parser(XRef *xrefA, Lexer *lexerA, GBool allowStreamsA) {
   23|   383k|  xref = xrefA;
   24|   383k|  lexer = lexerA;
   25|   383k|  inlineImg = 0;
   26|   383k|  allowStreams = allowStreamsA;
   27|   383k|  lexer->getObj(&buf1);
   28|   383k|  lexer->getObj(&buf2);
   29|   383k|}
_ZN6ParserD2Ev:
   31|   383k|Parser::~Parser() {
   32|   383k|  buf1.free();
   33|   383k|  buf2.free();
   34|   383k|  delete lexer;
   35|   383k|}
_ZN6Parser6getObjEP6ObjectiPh14CryptAlgorithmiiii:
   40|   179M|		       int objNum, int objGen, int recursion) {
   41|   179M|  char *key;
   42|   179M|  Stream *str;
   43|   179M|  Object obj2;
   44|   179M|  int num;
   45|   179M|  DecryptStream *decrypt;
   46|   179M|  GString *s, *s2;
   47|   179M|  int c;
   48|       |
   49|       |  // refill buffer after inline image data
   50|   179M|  if (inlineImg == 2) {
  ------------------
  |  Branch (50:7): [True: 59.2k, False: 179M]
  ------------------
   51|  59.2k|    buf1.free();
   52|  59.2k|    buf2.free();
   53|  59.2k|    lexer->getObj(&buf1);
   54|  59.2k|    lexer->getObj(&buf2);
   55|  59.2k|    inlineImg = 0;
   56|  59.2k|  }
   57|       |
   58|       |  // array
   59|   179M|  if (!simpleOnly && recursion < objectRecursionLimit && buf1.isCmd("[")) {
  ------------------
  |  |   20|   202M|#define objectRecursionLimit 500
  ------------------
  |  Branch (59:7): [True: 23.3M, False: 156M]
  |  Branch (59:22): [True: 11.1M, False: 12.2M]
  |  Branch (59:58): [True: 709k, False: 10.4M]
  ------------------
   60|   709k|    shift();
   61|   709k|    obj->initArray(xref);
   62|  21.1M|    while (!buf1.isCmd("]") && !buf1.isEOF())
  ------------------
  |  Branch (62:12): [True: 20.8M, False: 308k]
  |  Branch (62:32): [True: 20.4M, False: 401k]
  ------------------
   63|  20.4M|      obj->arrayAdd(getObj(&obj2, gFalse, fileKey, encAlgorithm, keyLength,
  ------------------
  |  |   18|  20.4M|#define gFalse 0
  ------------------
   64|  20.4M|			   objNum, objGen, recursion + 1));
   65|   709k|    if (buf1.isEOF())
  ------------------
  |  Branch (65:9): [True: 401k, False: 308k]
  ------------------
   66|   401k|      error(errSyntaxError, getPos(), "End of file inside array");
   67|   709k|    shift();
   68|       |
   69|       |  // dictionary or stream
   70|   178M|  } else if (!simpleOnly && recursion < objectRecursionLimit &&
  ------------------
  |  |   20|   201M|#define objectRecursionLimit 500
  ------------------
  |  Branch (70:14): [True: 22.6M, False: 156M]
  |  Branch (70:29): [True: 10.4M, False: 12.2M]
  ------------------
   71|  10.4M|	     buf1.isCmd("<<")) {
  ------------------
  |  Branch (71:7): [True: 630k, False: 9.80M]
  ------------------
   72|   630k|    shift();
   73|   630k|    obj->initDict(xref);
   74|  17.1M|    while (!buf1.isCmd(">>") && !buf1.isEOF()) {
  ------------------
  |  Branch (74:12): [True: 16.5M, False: 545k]
  |  Branch (74:33): [True: 16.5M, False: 41.0k]
  ------------------
   75|  16.5M|      if (!buf1.isName()) {
  ------------------
  |  Branch (75:11): [True: 13.7M, False: 2.77M]
  ------------------
   76|  13.7M|	error(errSyntaxError, getPos(),
   77|  13.7M|	      "Dictionary key must be a name object");
   78|  13.7M|	shift();
   79|  13.7M|      } else {
   80|  2.77M|	key = copyString(buf1.getName());
   81|  2.77M|	shift();
   82|  2.77M|	if (buf1.isEOF() || buf1.isError()) {
  ------------------
  |  Branch (82:6): [True: 2.61k, False: 2.77M]
  |  Branch (82:22): [True: 41.4k, False: 2.73M]
  ------------------
   83|  44.0k|	  gfree(key);
   84|  44.0k|	  break;
   85|  44.0k|	}
   86|  2.73M|	obj->dictAdd(key, getObj(&obj2, gFalse,
  ------------------
  |  |   18|  2.73M|#define gFalse 0
  ------------------
   87|  2.73M|				 fileKey, encAlgorithm, keyLength,
   88|  2.73M|				 objNum, objGen, recursion + 1));
   89|  2.73M|      }
   90|  16.5M|    }
   91|   630k|    if (buf1.isEOF())
  ------------------
  |  Branch (91:9): [True: 43.7k, False: 586k]
  ------------------
   92|  43.7k|      error(errSyntaxError, getPos(), "End of file inside dictionary");
   93|       |    // stream objects are not allowed inside content streams or
   94|       |    // object streams
   95|   630k|    if (allowStreams && buf2.isCmd("stream")) {
  ------------------
  |  Branch (95:9): [True: 383k, False: 247k]
  |  Branch (95:25): [True: 113k, False: 269k]
  ------------------
   96|   113k|      if ((str = makeStream(obj, fileKey, encAlgorithm, keyLength,
  ------------------
  |  Branch (96:11): [True: 105k, False: 8.63k]
  ------------------
   97|   113k|			    objNum, objGen, recursion + 1))) {
   98|   105k|	obj->initStream(str);
   99|   105k|      } else {
  100|  8.63k|	obj->free();
  101|  8.63k|	obj->initError();
  102|  8.63k|      }
  103|   516k|    } else {
  104|   516k|      shift();
  105|   516k|    }
  106|       |
  107|       |  // indirect reference or integer
  108|   178M|  } else if (buf1.isInt()) {
  ------------------
  |  Branch (108:14): [True: 4.44M, False: 173M]
  ------------------
  109|  4.44M|    num = buf1.getInt();
  110|  4.44M|    shift();
  111|  4.44M|    if (buf1.isInt() && buf2.isCmd("R")) {
  ------------------
  |  Branch (111:9): [True: 1.83M, False: 2.60M]
  |  Branch (111:25): [True: 573k, False: 1.26M]
  ------------------
  112|   573k|      int gen = buf1.getInt();
  113|   573k|      if (num >= 0 && gen >= 0) {
  ------------------
  |  Branch (113:11): [True: 570k, False: 3.10k]
  |  Branch (113:23): [True: 569k, False: 1.69k]
  ------------------
  114|   569k|	obj->initRef(num, gen);
  115|   569k|      } else {
  116|  4.79k|	error(errSyntaxError, getPos(),
  117|  4.79k|	      "Negative number or generation in indirect reference");
  118|  4.79k|	obj->initError();
  119|  4.79k|      }
  120|   573k|      shift();
  121|   573k|      shift();
  122|  3.87M|    } else {
  123|  3.87M|      obj->initInt(num);
  124|  3.87M|    }
  125|       |
  126|       |  // string
  127|   173M|  } else if (buf1.isString() && fileKey) {
  ------------------
  |  Branch (127:14): [True: 534k, False: 173M]
  |  Branch (127:33): [True: 32.3k, False: 502k]
  ------------------
  128|  32.3k|    s = buf1.getString();
  129|  32.3k|    s2 = new GString();
  130|  32.3k|    obj2.initNull();
  131|  32.3k|    decrypt = new DecryptStream(new MemStream(s->getCString(), 0,
  132|  32.3k|					      s->getLength(), &obj2),
  133|  32.3k|				fileKey, encAlgorithm, keyLength,
  134|  32.3k|				objNum, objGen);
  135|  32.3k|    decrypt->reset();
  136|  1.22M|    while ((c = decrypt->getChar()) != EOF) {
  ------------------
  |  Branch (136:12): [True: 1.19M, False: 32.3k]
  ------------------
  137|  1.19M|      s2->append((char)c);
  138|  1.19M|    }
  139|  32.3k|    delete decrypt;
  140|  32.3k|    obj->initString(s2);
  141|  32.3k|    shift();
  142|       |
  143|       |  // simple object
  144|   173M|  } else {
  145|   173M|    buf1.copy(obj);
  146|   173M|    shift();
  147|   173M|  }
  148|       |
  149|   179M|  return obj;
  150|   179M|}
_ZN6Parser10makeStreamEP6ObjectPh14CryptAlgorithmiiii:
  154|   113k|			   int objNum, int objGen, int recursion) {
  155|       |  // get stream start position
  156|   113k|  lexer->skipToNextLine();
  157|   113k|  Stream *curStr = lexer->getStream();
  158|   113k|  if (!curStr) {
  ------------------
  |  Branch (158:7): [True: 3.18k, False: 110k]
  ------------------
  159|  3.18k|    return NULL;
  160|  3.18k|  }
  161|   110k|  GFileOffset pos = curStr->getPos();
  162|       |
  163|   110k|  GBool haveLength = gFalse;
  ------------------
  |  |   18|   110k|#define gFalse 0
  ------------------
  164|   110k|  GFileOffset length = 0;
  165|   110k|  GFileOffset endPos;
  166|       |
  167|       |  // check for length in damaged file
  168|   110k|  if (xref && xref->getStreamEnd(pos, &endPos)) {
  ------------------
  |  Branch (168:7): [True: 109k, False: 967]
  |  Branch (168:15): [True: 52.0k, False: 57.7k]
  ------------------
  169|  52.0k|    length = endPos - pos;
  170|  52.0k|    haveLength = gTrue;
  ------------------
  |  |   17|  52.0k|#define gTrue 1
  ------------------
  171|       |
  172|       |  // get length from the stream object
  173|  58.7k|  } else {
  174|  58.7k|    Object obj;
  175|  58.7k|    dict->dictLookup("Length", &obj, recursion);
  176|  58.7k|    if (obj.isInt()) {
  ------------------
  |  Branch (176:9): [True: 41.8k, False: 16.8k]
  ------------------
  177|  41.8k|      length = (GFileOffset)(Guint)obj.getInt();
  178|  41.8k|      haveLength = gTrue;
  ------------------
  |  |   17|  41.8k|#define gTrue 1
  ------------------
  179|  41.8k|    } else {
  180|  16.8k|      error(errSyntaxError, getPos(),
  181|  16.8k|	    "Missing or invalid 'Length' attribute in stream");
  182|  16.8k|    }
  183|  58.7k|    obj.free();
  184|  58.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|   110k|  if (!lexer->getStream()) {
  ------------------
  |  Branch (188:7): [True: 0, False: 110k]
  ------------------
  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|   110k|  BaseStream *baseStr =
  195|   110k|      (BaseStream *)lexer->getStream()->getBaseStream()->copy();
  196|       |
  197|       |  // 'Length' attribute is missing -- search for 'endstream'
  198|   110k|  if (!haveLength) {
  ------------------
  |  Branch (198:7): [True: 16.8k, False: 93.9k]
  ------------------
  199|  16.8k|    GBool foundEndstream = gFalse;
  ------------------
  |  |   18|  16.8k|#define gFalse 0
  ------------------
  200|  16.8k|    char endstreamBuf[8];
  201|  16.8k|    if ((curStr = lexer->getStream())) {
  ------------------
  |  Branch (201:9): [True: 16.8k, False: 0]
  ------------------
  202|  16.8k|      int c;
  203|  7.05M|      while ((c = curStr->getChar()) != EOF) {
  ------------------
  |  Branch (203:14): [True: 7.04M, False: 5.44k]
  ------------------
  204|  7.04M|	if (c == 'e' &&
  ------------------
  |  Branch (204:6): [True: 285k, False: 6.75M]
  ------------------
  205|   285k|	    curStr->getBlock(endstreamBuf, 8) == 8 &&
  ------------------
  |  Branch (205:6): [True: 283k, False: 1.77k]
  ------------------
  206|   283k|	    !memcmp(endstreamBuf, "ndstream", 8)) {
  ------------------
  |  Branch (206:6): [True: 11.3k, False: 272k]
  ------------------
  207|  11.3k|	  length = curStr->getPos() - 9 - pos;
  208|  11.3k|	  foundEndstream = gTrue;
  ------------------
  |  |   17|  11.3k|#define gTrue 1
  ------------------
  209|  11.3k|	  break;
  210|  11.3k|	}
  211|  7.04M|      }
  212|  16.8k|    }
  213|  16.8k|    if (!foundEndstream) {
  ------------------
  |  Branch (213:9): [True: 5.44k, False: 11.3k]
  ------------------
  214|  5.44k|      error(errSyntaxError, getPos(), "Couldn't find 'endstream' for stream");
  215|  5.44k|      delete baseStr;
  216|  5.44k|      return NULL;
  217|  5.44k|    }
  218|  16.8k|  }
  219|       |
  220|       |  // make new base stream
  221|   105k|  Stream *str = baseStr->makeSubStream(pos, gTrue, length, dict);
  ------------------
  |  |   17|   105k|#define gTrue 1
  ------------------
  222|       |
  223|       |  // look for the 'endstream' marker
  224|   105k|  if (haveLength) {
  ------------------
  |  Branch (224:7): [True: 93.9k, False: 11.3k]
  ------------------
  225|       |    // skip over stream data
  226|  93.9k|    lexer->setPos(pos + length);
  227|       |
  228|       |    // check for 'endstream'
  229|       |    // NB: we never reuse the Parser object to parse objects after a
  230|       |    // stream, and we could (if the PDF file is damaged) be in the
  231|       |    // middle of binary data at this point, so we check the stream
  232|       |    // data directly for 'endstream', rather than calling shift() to
  233|       |    // parse objects
  234|  93.9k|    GBool foundEndstream = gFalse;
  ------------------
  |  |   18|  93.9k|#define gFalse 0
  ------------------
  235|  93.9k|    char endstreamBuf[8];
  236|  93.9k|    if ((curStr = lexer->getStream())) {
  ------------------
  |  Branch (236:9): [True: 93.9k, False: 0]
  ------------------
  237|       |      // skip up to 100 whitespace chars
  238|  93.9k|      int c;
  239|   209k|      for (int i = 0; i < 100; ++i) {
  ------------------
  |  Branch (239:23): [True: 208k, False: 1.06k]
  ------------------
  240|   208k|	c = curStr->getChar();
  241|   208k|	if (!Lexer::isSpace(c)) {
  ------------------
  |  Branch (241:6): [True: 92.9k, False: 115k]
  ------------------
  242|  92.9k|	  break;
  243|  92.9k|	}
  244|   208k|      }
  245|  93.9k|      if (c == 'e') {
  ------------------
  |  Branch (245:11): [True: 56.1k, False: 37.8k]
  ------------------
  246|  56.1k|	if (curStr->getBlock(endstreamBuf, 8) == 8 &&
  ------------------
  |  Branch (246:6): [True: 55.8k, False: 243]
  ------------------
  247|  55.8k|	    !memcmp(endstreamBuf, "ndstream", 8)) {
  ------------------
  |  Branch (247:6): [True: 52.2k, False: 3.64k]
  ------------------
  248|  52.2k|	  foundEndstream = gTrue;
  ------------------
  |  |   17|  52.2k|#define gTrue 1
  ------------------
  249|  52.2k|	}
  250|  56.1k|      }
  251|  93.9k|    }
  252|  93.9k|    if (!foundEndstream) {
  ------------------
  |  Branch (252:9): [True: 41.7k, False: 52.2k]
  ------------------
  253|  41.7k|      error(errSyntaxError, getPos(), "Missing 'endstream'");
  254|       |      // kludge for broken PDF files: just add 5k to the length, and
  255|       |      // hope it's enough
  256|       |      // (dict is now owned by str, so we need to copy it before deleting str)
  257|  41.7k|      Object obj;
  258|  41.7k|      dict->copy(&obj);
  259|  41.7k|      delete str;
  260|  41.7k|      length += 5000;
  261|  41.7k|      str = baseStr->makeSubStream(pos, gTrue, length, &obj);
  ------------------
  |  |   17|  41.7k|#define gTrue 1
  ------------------
  262|  41.7k|    }
  263|  93.9k|  }
  264|       |
  265|       |  // free the copied base stream
  266|   105k|  delete baseStr;
  267|       |
  268|       |  // handle decryption
  269|   105k|  if (fileKey) {
  ------------------
  |  Branch (269:7): [True: 7.17k, False: 98.1k]
  ------------------
  270|       |    // the 'Crypt' filter is used to mark unencrypted metadata streams
  271|       |    //~ this should also check for an empty DecodeParams entry
  272|  7.17k|    GBool encrypted = gTrue;
  ------------------
  |  |   17|  7.17k|#define gTrue 1
  ------------------
  273|  7.17k|    Object obj;
  274|  7.17k|    dict->dictLookup("Filter", &obj, recursion);
  275|  7.17k|    if (obj.isName("Crypt")) {
  ------------------
  |  Branch (275:9): [True: 79, False: 7.09k]
  ------------------
  276|     79|      encrypted = gFalse;
  ------------------
  |  |   18|     79|#define gFalse 0
  ------------------
  277|  7.09k|    } else if (obj.isArray() && obj.arrayGetLength() >= 1) {
  ------------------
  |  Branch (277:16): [True: 1.91k, False: 5.18k]
  |  Branch (277:33): [True: 955, False: 957]
  ------------------
  278|    955|      Object obj2;
  279|    955|      if (obj.arrayGet(0, &obj2)->isName("Crypt")) {
  ------------------
  |  Branch (279:11): [True: 0, False: 955]
  ------------------
  280|      0|	encrypted = gFalse;
  ------------------
  |  |   18|      0|#define gFalse 0
  ------------------
  281|      0|      }
  282|    955|      obj2.free();
  283|    955|    }
  284|  7.17k|    obj.free();
  285|  7.17k|    if (encrypted) {
  ------------------
  |  Branch (285:9): [True: 7.09k, False: 79]
  ------------------
  286|  7.09k|      str = new DecryptStream(str, fileKey, encAlgorithm, keyLength,
  287|  7.09k|			      objNum, objGen);
  288|  7.09k|    }
  289|  7.17k|  }
  290|       |
  291|       |  // get filters
  292|   105k|  str = str->addFilters(dict, recursion);
  293|       |
  294|   105k|  return str;
  295|   110k|}
_ZN6Parser5shiftEv:
  297|   198M|void Parser::shift() {
  298|   198M|  if (inlineImg > 0) {
  ------------------
  |  Branch (298:7): [True: 534k, False: 197M]
  ------------------
  299|   534k|    if (inlineImg < 2) {
  ------------------
  |  Branch (299:9): [True: 296k, False: 237k]
  ------------------
  300|   296k|      ++inlineImg;
  301|   296k|    } else {
  302|       |      // in a damaged content stream, if 'ID' shows up in the middle
  303|       |      // of a dictionary, we need to reset
  304|   237k|      inlineImg = 0;
  305|   237k|    }
  306|   197M|  } else if (buf2.isCmd("ID")) {
  ------------------
  |  Branch (306:14): [True: 297k, False: 197M]
  ------------------
  307|   297k|    lexer->skipChar();		// skip char after 'ID' command
  308|   297k|    inlineImg = 1;
  309|   297k|  }
  310|   198M|  buf1.free();
  311|   198M|  buf1 = buf2;
  312|   198M|  if (inlineImg > 0)		// don't buffer inline image data
  ------------------
  |  Branch (312:7): [True: 594k, False: 197M]
  ------------------
  313|   594k|    buf2.initNull();
  314|   197M|  else
  315|   197M|    lexer->getObj(&buf2);
  316|   198M|}

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

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

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

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

_ZN10BaseStream13getBaseStreamEv:
  178|   110k|  virtual BaseStream *getBaseStream() { return this; }
_ZN10BaseStream7getDictEv:
  180|   757k|  virtual Dict *getDict() { return dict.getDict(); }
_ZN10BaseStream11getFileNameEv:
  181|  8.50k|  virtual GString *getFileName() { return NULL; }
_ZN12FilterStream6getPosEv:
  206|  15.1M|  virtual GFileOffset getPos() { return str->getPos(); }
_ZN12FilterStream7getDictEv:
  210|   509k|  virtual Dict *getDict() { return str->getDict(); }
_ZN15StreamPredictor4isOkEv:
  277|  13.7k|  GBool isOk() { return ok; }
_ZN15StreamPredictor12getPredictorEv:
  285|  8.12k|  int getPredictor() { return predictor; }
_ZN15StreamPredictor8getWidthEv:
  286|  8.12k|  int getWidth() { return width; }
_ZN15StreamPredictor9getNCompsEv:
  287|  8.12k|  int getNComps() { return nComps; }
_ZN15StreamPredictor8getNBitsEv:
  288|  8.12k|  int getNBits() { return nBits; }
_ZN9MemStream7getCharEv:
  366|   681M|    { return (bufPtr < bufEnd) ? (*bufPtr++ & 0xff) : EOF; }
  ------------------
  |  Branch (366:14): [True: 675M, False: 5.51M]
  ------------------
_ZN9MemStream8lookCharEv:
  368|   151M|    { return (bufPtr < bufEnd) ? (*bufPtr & 0xff) : EOF; }
  ------------------
  |  Branch (368:14): [True: 151M, False: 12.3k]
  ------------------
_ZN9MemStream6getPosEv:
  370|  60.4M|  virtual GFileOffset getPos() { return (GFileOffset)(bufPtr - buf); }
_ZN9MemStream8getStartEv:
  372|  16.9k|  virtual GFileOffset getStart() { return start; }
_ZN11EmbedStream5resetEv:
  405|  38.4k|  virtual void reset() {}
_ZN11EmbedStream6getPosEv:
  409|  41.1k|  virtual GFileOffset getPos() { return str->getPos(); }
_ZN14ASCIIHexStream7getCharEv:
  434|  85.0k|    { int c = lookChar(); buf = EOF; return c; }
_ZN13ASCII85Stream7getCharEv:
  459|  4.44M|    { int ch = lookChar(); ++index; return ch; }
_ZN15RunLengthStream7getCharEv:
  538|  17.2M|    { return (bufPtr >= bufEnd && !fillBuf()) ? EOF : (*bufPtr++ & 0xff); }
  ------------------
  |  Branch (538:15): [True: 905k, False: 16.3M]
  |  Branch (538:35): [True: 436k, False: 468k]
  ------------------
_ZN15RunLengthStream8lookCharEv:
  540|   455k|    { return (bufPtr >= bufEnd && !fillBuf()) ? EOF : (*bufPtr & 0xff); }
  ------------------
  |  Branch (540:15): [True: 8.11k, False: 447k]
  |  Branch (540:35): [True: 667, False: 7.44k]
  ------------------
_ZN14CCITTFaxStream7eatBitsEi:
  609|   124M|  void eatBits(int n) { if ((inputBits -= n) < 0) inputBits = 0; }
  ------------------
  |  Branch (609:29): [True: 6.06k, False: 124M]
  ------------------
_ZN9EOFStream5resetEv:
  873|  2.02k|  virtual void reset() {}
_ZN9EOFStream7getCharEv:
  874|  1.09k|  virtual int getChar() { return EOF; }
_ZN9EOFStream8getBlockEPci:
  876|    220|  virtual int getBlock(char *blk, int size) { return 0; }

_ZN10TextStringC2Ev:
   21|   638k|TextString::TextString() {
   22|       |  u = NULL;
   23|   638k|  len = size = 0;
   24|   638k|}
_ZN10TextStringC2EP7GString:
   26|  77.4k|TextString::TextString(GString *s) {
   27|       |  u = NULL;
   28|  77.4k|  len = size = 0;
   29|  77.4k|  append(s);
   30|  77.4k|}
_ZN10TextStringC2EPS_:
   32|  6.61k|TextString::TextString(TextString *s) {
   33|  6.61k|  len = size = s->len;
   34|  6.61k|  if (len) {
  ------------------
  |  Branch (34:7): [True: 5.11k, False: 1.50k]
  ------------------
   35|  5.11k|    u = (Unicode *)gmallocn(size, sizeof(Unicode));
   36|  5.11k|    memcpy(u, s->u, len * sizeof(Unicode));
   37|  5.11k|  } else {
   38|       |    u = NULL;
   39|  1.50k|  }
   40|  6.61k|}
_ZN10TextStringD2Ev:
   42|   722k|TextString::~TextString() {
   43|   722k|  gfree(u);
   44|   722k|}
_ZN10TextString6appendEP7GString:
   53|  77.4k|TextString *TextString::append(GString *s) {
   54|  77.4k|  return insert(len, s);
   55|  77.4k|}
_ZN10TextString6insertEij:
   57|  40.3k|TextString *TextString::insert(int idx, Unicode c) {
   58|  40.3k|  if (idx >= 0 && idx <= len) {
  ------------------
  |  Branch (58:7): [True: 40.3k, False: 0]
  |  Branch (58:19): [True: 40.3k, False: 0]
  ------------------
   59|  40.3k|    expand(1);
   60|  40.3k|    if (idx < len) {
  ------------------
  |  Branch (60:9): [True: 40.3k, False: 0]
  ------------------
   61|  40.3k|      memmove(u + idx + 1, u + idx, (len - idx) * sizeof(Unicode));
   62|  40.3k|    }
   63|  40.3k|    u[idx] = c;
   64|  40.3k|    ++len;
   65|  40.3k|  }
   66|  40.3k|  return this;
   67|  40.3k|}
_ZN10TextString6insertEiPji:
   69|   435k|TextString *TextString::insert(int idx, Unicode *u2, int n) {
   70|   435k|  if (idx >= 0 && idx <= len) {
  ------------------
  |  Branch (70:7): [True: 435k, False: 0]
  |  Branch (70:19): [True: 435k, False: 0]
  ------------------
   71|   435k|    expand(n);
   72|   435k|    if (idx < len) {
  ------------------
  |  Branch (72:9): [True: 137k, False: 298k]
  ------------------
   73|   137k|      memmove(u + idx + n, u + idx, (len - idx) * sizeof(Unicode));
   74|   137k|    }
   75|   435k|    memcpy(u + idx, u2, n * sizeof(Unicode));
   76|   435k|    len += n;
   77|   435k|  }
   78|   435k|  return this;
   79|   435k|}
_ZN10TextString6insertEiP7GString:
   81|   118k|TextString *TextString::insert(int idx, GString *s) {
   82|   118k|  Unicode uBuf[100];
   83|   118k|  int n, i;
   84|       |
   85|   118k|  if (idx >= 0 && idx <= len) {
  ------------------
  |  Branch (85:7): [True: 118k, False: 0]
  |  Branch (85:19): [True: 118k, False: 0]
  ------------------
   86|       |    // look for a UTF-16BE BOM
   87|   118k|    if ((s->getChar(0) & 0xff) == 0xfe &&
  ------------------
  |  Branch (87:9): [True: 32.0k, False: 86.3k]
  ------------------
   88|  32.0k|	(s->getChar(1) & 0xff) == 0xff) {
  ------------------
  |  Branch (88:2): [True: 31.0k, False: 1.04k]
  ------------------
   89|  31.0k|      i = 2;
   90|  31.0k|      n = 0;
   91|  4.07M|      while (getUTF16BE(s, &i, uBuf + n)) {
  ------------------
  |  Branch (91:14): [True: 4.04M, False: 31.0k]
  ------------------
   92|  4.04M|	++n;
   93|  4.04M|	if (n == sizeof(uBuf) / sizeof(Unicode)) {
  ------------------
  |  Branch (93:6): [True: 33.4k, False: 4.00M]
  ------------------
   94|  33.4k|	  insert(idx, uBuf, n);
   95|  33.4k|	  idx += n;
   96|  33.4k|	  n = 0;
   97|  33.4k|	}
   98|  4.04M|      }
   99|  31.0k|      if (n > 0) {
  ------------------
  |  Branch (99:11): [True: 30.6k, False: 341]
  ------------------
  100|  30.6k|	insert(idx, uBuf, n);
  101|  30.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|  87.3k|    } else if ((s->getChar(0) & 0xff) == 0xff &&
  ------------------
  |  Branch (106:16): [True: 58.6k, False: 28.7k]
  ------------------
  107|  58.6k|	       (s->getChar(1) & 0xff) == 0xfe) {
  ------------------
  |  Branch (107:9): [True: 58.3k, False: 273]
  ------------------
  108|  58.3k|      i = 2;
  109|  58.3k|      n = 0;
  110|  15.1M|      while (getUTF16LE(s, &i, uBuf + n)) {
  ------------------
  |  Branch (110:14): [True: 15.1M, False: 58.3k]
  ------------------
  111|  15.1M|	++n;
  112|  15.1M|	if (n == sizeof(uBuf) / sizeof(Unicode)) {
  ------------------
  |  Branch (112:6): [True: 145k, False: 14.9M]
  ------------------
  113|   145k|	  insert(idx, uBuf, n);
  114|   145k|	  idx += n;
  115|   145k|	  n = 0;
  116|   145k|	}
  117|  15.1M|      }
  118|  58.3k|      if (n > 0) {
  ------------------
  |  Branch (118:11): [True: 9.96k, False: 48.3k]
  ------------------
  119|  9.96k|	insert(idx, uBuf, n);
  120|  9.96k|      }
  121|       |
  122|       |    // look for a UTF-8 BOM
  123|  58.3k|    } else if ((s->getChar(0) & 0xff) == 0xef &&
  ------------------
  |  Branch (123:16): [True: 2.52k, False: 26.4k]
  ------------------
  124|  2.52k|	       (s->getChar(1) & 0xff) == 0xbb &&
  ------------------
  |  Branch (124:9): [True: 2.23k, False: 287]
  ------------------
  125|  2.23k|	       (s->getChar(2) & 0xff) == 0xbf) {
  ------------------
  |  Branch (125:9): [True: 1.96k, False: 266]
  ------------------
  126|  1.96k|      i = 3;
  127|  1.96k|      n = 0;
  128|  21.5M|      while (getUTF8(s, &i, uBuf + n)) {
  ------------------
  |  Branch (128:14): [True: 21.5M, False: 1.96k]
  ------------------
  129|  21.5M|	++n;
  130|  21.5M|	if (n == sizeof(uBuf) / sizeof(Unicode)) {
  ------------------
  |  Branch (130:6): [True: 214k, False: 21.2M]
  ------------------
  131|   214k|	  insert(idx, uBuf, n);
  132|   214k|	  idx += n;
  133|   214k|	  n = 0;
  134|   214k|	}
  135|  21.5M|      }
  136|  1.96k|      if (n > 0) {
  ------------------
  |  Branch (136:11): [True: 1.63k, False: 333]
  ------------------
  137|  1.63k|	insert(idx, uBuf, n);
  138|  1.63k|      }
  139|       |
  140|       |    // otherwise, use PDFDocEncoding
  141|  27.0k|    } else {
  142|  27.0k|      n = s->getLength();
  143|  27.0k|      expand(n);
  144|  27.0k|      if (idx < len) {
  ------------------
  |  Branch (144:11): [True: 12.4k, False: 14.5k]
  ------------------
  145|  12.4k|	memmove(u + idx + n, u + idx, (len - idx) * sizeof(Unicode));
  146|  12.4k|      }
  147|  32.7M|      for (i = 0; i < n; ++i) {
  ------------------
  |  Branch (147:19): [True: 32.7M, False: 27.0k]
  ------------------
  148|  32.7M|	u[idx + i] = pdfDocEncoding[s->getChar(i) & 0xff];
  149|  32.7M|      }
  150|  27.0k|      len += n;
  151|  27.0k|    }
  152|   118k|  }
  153|   118k|  return this;
  154|   118k|}
_ZN10TextString6expandEi:
  156|   502k|void TextString::expand(int delta) {
  157|   502k|  int newLen;
  158|       |
  159|   502k|  newLen = len + delta;
  160|   502k|  if (delta > INT_MAX - len) {
  ------------------
  |  Branch (160:7): [True: 0, False: 502k]
  ------------------
  161|       |    // trigger an out-of-memory error
  162|      0|    size = -1;
  163|   502k|  } else if (newLen <= size) {
  ------------------
  |  Branch (163:14): [True: 431k, False: 70.5k]
  ------------------
  164|   431k|    return;
  165|   431k|  } else if (size > 0 && size <= INT_MAX / 2 && size*2 >= newLen) {
  ------------------
  |  Branch (165:14): [True: 42.8k, False: 27.6k]
  |  Branch (165:26): [True: 42.8k, False: 0]
  |  Branch (165:49): [True: 41.9k, False: 965]
  ------------------
  166|  41.9k|    size *= 2;
  167|  41.9k|  } else {
  168|  28.6k|    size = newLen;
  169|  28.6k|  }
  170|  70.5k|  u = (Unicode *)greallocn(u, size, sizeof(Unicode));
  171|  70.5k|}
_ZN10TextString6toUTF8Ev:
  201|    138|GString *TextString::toUTF8() {
  202|    138|  GString *s = new GString();
  203|  51.0k|  for (int i = 0; i < len; ++i) {
  ------------------
  |  Branch (203:19): [True: 50.8k, False: 138]
  ------------------
  204|  50.8k|    char buf[8];
  205|  50.8k|    int n = mapUTF8(u[i], buf, sizeof(buf));
  206|  50.8k|    s->append(buf, n);
  207|  50.8k|  }
  208|    138|  return s;
  209|    138|}

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

_Z7mapUTF8jPci:
   12|  50.8k|int mapUTF8(Unicode u, char *buf, int bufSize) {
   13|  50.8k|  if        (u <= 0x0000007f) {
  ------------------
  |  Branch (13:14): [True: 46.7k, False: 4.07k]
  ------------------
   14|  46.7k|    if (bufSize < 1) {
  ------------------
  |  Branch (14:9): [True: 0, False: 46.7k]
  ------------------
   15|      0|      return 0;
   16|      0|    }
   17|  46.7k|    buf[0] = (char)u;
   18|  46.7k|    return 1;
   19|  46.7k|  } else if (u <= 0x000007ff) {
  ------------------
  |  Branch (19:14): [True: 1.00k, False: 3.07k]
  ------------------
   20|  1.00k|    if (bufSize < 2) {
  ------------------
  |  Branch (20:9): [True: 0, False: 1.00k]
  ------------------
   21|      0|      return 0;
   22|      0|    }
   23|  1.00k|    buf[0] = (char)(0xc0 + (u >> 6));
   24|  1.00k|    buf[1] = (char)(0x80 + (u & 0x3f));
   25|  1.00k|    return 2;
   26|  3.07k|  } else if (u <= 0x0000ffff) {
  ------------------
  |  Branch (26:14): [True: 2.76k, False: 309]
  ------------------
   27|  2.76k|    if (bufSize < 3) {
  ------------------
  |  Branch (27:9): [True: 0, False: 2.76k]
  ------------------
   28|      0|      return 0;
   29|      0|    }
   30|  2.76k|    buf[0] = (char)(0xe0 + (u >> 12));
   31|  2.76k|    buf[1] = (char)(0x80 + ((u >> 6) & 0x3f));
   32|  2.76k|    buf[2] = (char)(0x80 + (u & 0x3f));
   33|  2.76k|    return 3;
   34|  2.76k|  } else if (u <= 0x0010ffff) {
  ------------------
  |  Branch (34:14): [True: 121, False: 188]
  ------------------
   35|    121|    if (bufSize < 4) {
  ------------------
  |  Branch (35:9): [True: 0, False: 121]
  ------------------
   36|      0|      return 0;
   37|      0|    }
   38|    121|    buf[0] = (char)(0xf0 + (u >> 18));
   39|    121|    buf[1] = (char)(0x80 + ((u >> 12) & 0x3f));
   40|    121|    buf[2] = (char)(0x80 + ((u >> 6) & 0x3f));
   41|    121|    buf[3] = (char)(0x80 + (u & 0x3f));
   42|    121|    return 4;
   43|    188|  } else {
   44|    188|    return 0;
   45|    188|  }
   46|  50.8k|}
_Z7getUTF8P7GStringPiPj:
   61|  21.5M|GBool getUTF8(GString *s, int *i, Unicode *u) {
   62|  21.5M|  Guchar c0, c1, c2, c3, c4, c5;
   63|       |
   64|  21.5M|  if (*i >= s->getLength()) {
  ------------------
  |  Branch (64:7): [True: 1.96k, False: 21.5M]
  ------------------
   65|  1.96k|    return gFalse;
  ------------------
  |  |   18|  1.96k|#define gFalse 0
  ------------------
   66|  1.96k|  }
   67|  21.5M|  c0 = (Guchar)s->getChar((*i)++);
   68|  21.5M|  if (c0 < 0x80) {
  ------------------
  |  Branch (68:7): [True: 17.5M, False: 3.96M]
  ------------------
   69|  17.5M|    *u = (Unicode)c0;
   70|  17.5M|  } else if (c0 < 0xe0) {
  ------------------
  |  Branch (70:14): [True: 2.16M, False: 1.79M]
  ------------------
   71|  2.16M|    if (*i < s->getLength() &&
  ------------------
  |  Branch (71:9): [True: 2.16M, False: 730]
  ------------------
   72|  2.16M|	((c1 = (Guchar)s->getChar(*i)) & 0xc0) == 0x80) {
  ------------------
  |  Branch (72:2): [True: 595k, False: 1.57M]
  ------------------
   73|   595k|      *i += 1;
   74|   595k|      *u = (Unicode)(((c0 & 0x1f) << 6) |
   75|   595k|		     (c1 & 0x3f));
   76|  1.57M|    } else {
   77|  1.57M|      *u =  (Unicode)c0;
   78|  1.57M|    }
   79|  2.16M|  } else if (c0 < 0xf0) {
  ------------------
  |  Branch (79:14): [True: 514k, False: 1.27M]
  ------------------
   80|   514k|    if (*i < s->getLength() - 1 &&
  ------------------
  |  Branch (80:9): [True: 514k, False: 523]
  ------------------
   81|   514k|	((c1 = (Guchar)s->getChar(*i)) & 0xc0) == 0x80 &&
  ------------------
  |  Branch (81:2): [True: 65.0k, False: 449k]
  ------------------
   82|  65.0k|	((c2 = (Guchar)s->getChar(*i + 1)) & 0xc0) == 0x80) {
  ------------------
  |  Branch (82:2): [True: 10.1k, False: 54.8k]
  ------------------
   83|  10.1k|      *i += 2;
   84|  10.1k|      *u = (Unicode)(((c0 & 0x0f) << 12) |
   85|  10.1k|		     ((c1 & 0x3f) << 6) |
   86|  10.1k|		     (c2 & 0x3f));
   87|   504k|    } else {
   88|   504k|      *u = (Unicode)c0;
   89|   504k|    }
   90|  1.27M|  } else if (c0 < 0xf8) {
  ------------------
  |  Branch (90:14): [True: 176k, False: 1.10M]
  ------------------
   91|   176k|    if (*i < s->getLength() - 2 &&
  ------------------
  |  Branch (91:9): [True: 176k, False: 408]
  ------------------
   92|   176k|	((c1 = (Guchar)s->getChar(*i)) & 0xc0) == 0x80 &&
  ------------------
  |  Branch (92:2): [True: 70.5k, False: 106k]
  ------------------
   93|  70.5k|	((c2 = (Guchar)s->getChar(*i + 1)) & 0xc0) == 0x80 &&
  ------------------
  |  Branch (93:2): [True: 15.7k, False: 54.7k]
  ------------------
   94|  15.7k|	((c3 = (Guchar)s->getChar(*i + 2)) & 0xc0) == 0x80) {
  ------------------
  |  Branch (94:2): [True: 13.7k, False: 1.98k]
  ------------------
   95|  13.7k|      *i += 3;
   96|  13.7k|      *u = (Unicode)(((c0 & 0x07) << 18) |
   97|  13.7k|		     ((c1 & 0x3f) << 12) |
   98|  13.7k|		     ((c2 & 0x3f) << 6) |
   99|  13.7k|		     (c3 & 0x3f));
  100|   163k|    } else {
  101|   163k|      *u = (Unicode)c0;
  102|   163k|    }
  103|  1.10M|  } else if (c0 < 0xfc) {
  ------------------
  |  Branch (103:14): [True: 23.1k, False: 1.07M]
  ------------------
  104|  23.1k|    if (*i < s->getLength() - 3 &&
  ------------------
  |  Branch (104:9): [True: 22.8k, False: 261]
  ------------------
  105|  22.8k|	((c1 = (Guchar)s->getChar(*i)) & 0xc0) == 0x80 &&
  ------------------
  |  Branch (105:2): [True: 9.12k, False: 13.7k]
  ------------------
  106|  9.12k|	((c2 = (Guchar)s->getChar(*i + 1)) & 0xc0) == 0x80 &&
  ------------------
  |  Branch (106:2): [True: 8.25k, False: 877]
  ------------------
  107|  8.25k|	((c3 = (Guchar)s->getChar(*i + 2)) & 0xc0) == 0x80 &&
  ------------------
  |  Branch (107:2): [True: 2.93k, False: 5.31k]
  ------------------
  108|  2.93k|	((c4 = (Guchar)s->getChar(*i + 3)) & 0xc0) == 0x80) {
  ------------------
  |  Branch (108:2): [True: 1.13k, False: 1.80k]
  ------------------
  109|  1.13k|      *i += 4;
  110|  1.13k|      *u = (Unicode)(((c0 & 0x03) << 24) |
  111|  1.13k|		     ((c1 & 0x3f) << 18) |
  112|  1.13k|		     ((c2 & 0x3f) << 12) |
  113|  1.13k|		     ((c3 & 0x3f) << 6) |
  114|  1.13k|		     (c4 & 0x3f));
  115|  21.9k|    } else {
  116|  21.9k|      *u = (Unicode)c0;
  117|  21.9k|    }
  118|  1.07M|  } else if (c0 < 0xfe) {
  ------------------
  |  Branch (118:14): [True: 187k, False: 890k]
  ------------------
  119|   187k|    if (*i < s->getLength() - 4 &&
  ------------------
  |  Branch (119:9): [True: 186k, False: 1.46k]
  ------------------
  120|   186k|	((c1 = (Guchar)s->getChar(*i)) & 0xc0) == 0x80 &&
  ------------------
  |  Branch (120:2): [True: 4.11k, False: 182k]
  ------------------
  121|  4.11k|	((c2 = (Guchar)s->getChar(*i + 1)) & 0xc0) == 0x80 &&
  ------------------
  |  Branch (121:2): [True: 1.81k, False: 2.29k]
  ------------------
  122|  1.81k|	((c3 = (Guchar)s->getChar(*i + 2)) & 0xc0) == 0x80 &&
  ------------------
  |  Branch (122:2): [True: 1.62k, False: 194]
  ------------------
  123|  1.62k|	((c4 = (Guchar)s->getChar(*i + 3)) & 0xc0) == 0x80 &&
  ------------------
  |  Branch (123:2): [True: 1.54k, False: 74]
  ------------------
  124|  1.54k|	((c5 = (Guchar)s->getChar(*i + 4)) & 0xc0) == 0x80) {
  ------------------
  |  Branch (124:2): [True: 859, False: 687]
  ------------------
  125|    859|      *i += 5;
  126|    859|      *u = (Unicode)(((c0 & 0x01) << 30) |
  127|    859|		     ((c1 & 0x3f) << 24) |
  128|    859|		     ((c2 & 0x3f) << 18) |
  129|    859|		     ((c3 & 0x3f) << 12) |
  130|    859|		     ((c4 & 0x3f) << 6) |
  131|    859|		     (c5 & 0x3f));
  132|   187k|    } else {
  133|   187k|      *u = (Unicode)c0;
  134|   187k|    }
  135|   890k|  } else {
  136|   890k|    *u = (Unicode)c0;
  137|   890k|  }
  138|  21.5M|  return gTrue;
  ------------------
  |  |   17|  21.5M|#define gTrue 1
  ------------------
  139|  21.5M|}
_Z10getUTF16BEP7GStringPiPj:
  141|  4.07M|GBool getUTF16BE(GString *s, int *i, Unicode *u) {
  142|  4.07M|  int w0, w1;
  143|       |
  144|  4.07M|  if (*i >= s->getLength() - 1) {
  ------------------
  |  Branch (144:7): [True: 31.0k, False: 4.04M]
  ------------------
  145|  31.0k|    return gFalse;
  ------------------
  |  |   18|  31.0k|#define gFalse 0
  ------------------
  146|  31.0k|  }
  147|  4.04M|  w0 = ((s->getChar(*i) & 0xff) << 8) | (s->getChar(*i + 1) & 0xff);
  148|  4.04M|  *i += 2;
  149|  4.04M|  if (w0 < 0xd800 || w0 >= 0xe000) {
  ------------------
  |  Branch (149:7): [True: 3.82M, False: 220k]
  |  Branch (149:22): [True: 129k, False: 90.7k]
  ------------------
  150|  3.95M|    *u = (Unicode)w0;
  151|  3.95M|  } else {
  152|  90.7k|    if (*i < s->getLength() - 1) {
  ------------------
  |  Branch (152:9): [True: 90.2k, False: 513]
  ------------------
  153|  90.2k|      w1 = ((s->getChar(*i) & 0xff) << 8) | (s->getChar(*i + 1) & 0xff);
  154|  90.2k|      *i += 2;
  155|  90.2k|      *u = 0x10000 + ((w0 - 0xd800) << 10) + (w1 - 0xdc00);
  156|  90.2k|    } else {
  157|    513|      *u = (Unicode)w0;
  158|    513|    }
  159|  90.7k|  }
  160|  4.04M|  return gTrue;
  ------------------
  |  |   17|  4.04M|#define gTrue 1
  ------------------
  161|  4.07M|}
_Z10getUTF16LEP7GStringPiPj:
  163|  15.1M|GBool getUTF16LE(GString *s, int *i, Unicode *u) {
  164|  15.1M|  int w0, w1;
  165|       |
  166|  15.1M|  if (*i >= s->getLength() - 1) {
  ------------------
  |  Branch (166:7): [True: 58.3k, False: 15.1M]
  ------------------
  167|  58.3k|    return gFalse;
  ------------------
  |  |   18|  58.3k|#define gFalse 0
  ------------------
  168|  58.3k|  }
  169|  15.1M|  w0 = (s->getChar(*i) & 0xff) | ((s->getChar(*i + 1) & 0xff) << 8);
  170|  15.1M|  *i += 2;
  171|  15.1M|  if (w0 < 0xd800 || w0 >= 0xe000) {
  ------------------
  |  Branch (171:7): [True: 14.8M, False: 277k]
  |  Branch (171:22): [True: 240k, False: 37.2k]
  ------------------
  172|  15.0M|    *u = (Unicode)w0;
  173|  15.0M|  } else {
  174|  37.2k|    if (*i < s->getLength() - 1) {
  ------------------
  |  Branch (174:9): [True: 35.3k, False: 1.90k]
  ------------------
  175|  35.3k|      w1 = (s->getChar(*i) & 0xff) | ((s->getChar(*i + 1) & 0xff) << 8);
  176|  35.3k|      *i += 2;
  177|  35.3k|      *u = 0x10000 + ((w0 - 0xd800) << 10) + (w1 - 0xdc00);
  178|  35.3k|    } else {
  179|  1.90k|      *u = (Unicode)w0;
  180|  1.90k|    }
  181|  37.2k|  }
  182|  15.1M|  return gTrue;
  ------------------
  |  |   17|  15.1M|#define gTrue 1
  ------------------
  183|  15.1M|}

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

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

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

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

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

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

_ZN6ZxNodeC2Ev:
   64|  2.58M|ZxNode::ZxNode() {
   65|  2.58M|  next = NULL;
   66|  2.58M|  parent = NULL;
   67|       |  firstChild = lastChild = NULL;
   68|  2.58M|}
_ZN6ZxNodeD2Ev:
   70|  2.58M|ZxNode::~ZxNode() {
   71|  2.58M|  ZxNode *child;
   72|       |
   73|  5.16M|  while (firstChild) {
  ------------------
  |  Branch (73:10): [True: 2.58M, False: 2.58M]
  ------------------
   74|  2.58M|    child = firstChild;
   75|  2.58M|    firstChild = firstChild->next;
   76|  2.58M|    delete child;
   77|  2.58M|  }
   78|  2.58M|}
_ZN6ZxNode21findFirstChildElementEPKc:
  143|   235k|ZxElement *ZxNode::findFirstChildElement(const char *type) {
  144|   235k|  ZxNode *child;
  145|       |
  146|   834k|  for (child = firstChild; child; child = child->next) {
  ------------------
  |  Branch (146:28): [True: 610k, False: 224k]
  ------------------
  147|   610k|    if (child->isElement(type)) {
  ------------------
  |  Branch (147:9): [True: 11.2k, False: 598k]
  ------------------
  148|  11.2k|      return (ZxElement *)child;
  149|  11.2k|    }
  150|   610k|  }
  151|   224k|  return NULL;
  152|   235k|}
_ZN6ZxNode8addChildEPS_:
  186|  2.58M|void ZxNode::addChild(ZxNode *child) {
  187|  2.58M|  if (lastChild) {
  ------------------
  |  Branch (187:7): [True: 2.18M, False: 396k]
  ------------------
  188|  2.18M|    lastChild->next = child;
  189|  2.18M|    lastChild = child;
  190|  2.18M|  } else {
  191|   396k|    firstChild = lastChild = child;
  192|   396k|  }
  193|  2.58M|  child->parent = this;
  194|       |  child->next = NULL;
  195|  2.58M|}
_ZN5ZxDocC2Ev:
  199|  1.23k|ZxDoc::ZxDoc() {
  200|  1.23k|  xmlDecl = NULL;
  201|  1.23k|  docTypeDecl = NULL;
  202|       |  root = NULL;
  203|  1.23k|}
_ZN5ZxDoc7loadMemEPKcj:
  205|  1.23k|ZxDoc *ZxDoc::loadMem(const char *data, Guint dataLen) {
  206|  1.23k|  ZxDoc *doc;
  207|       |
  208|  1.23k|  doc = new ZxDoc();
  209|  1.23k|  if (!doc->parse(data, dataLen)) {
  ------------------
  |  Branch (209:7): [True: 426, False: 810]
  ------------------
  210|    426|    delete doc;
  211|    426|    return NULL;
  212|    426|  }
  213|    810|  return doc;
  214|  1.23k|}
_ZN5ZxDoc8addChildEP6ZxNode:
  262|  2.07k|void ZxDoc::addChild(ZxNode *node) {
  263|  2.07k|  if (node->isXMLDecl() && !xmlDecl) {
  ------------------
  |  Branch (263:7): [True: 500, False: 1.57k]
  |  Branch (263:28): [True: 500, False: 0]
  ------------------
  264|    500|    xmlDecl = (ZxXMLDecl *)node;
  265|  1.57k|  } else if (node->isDocTypeDecl() && !docTypeDecl) {
  ------------------
  |  Branch (265:14): [True: 102, False: 1.47k]
  |  Branch (265:39): [True: 102, False: 0]
  ------------------
  266|    102|    docTypeDecl = (ZxDocTypeDecl *)node;
  267|  1.47k|  } else if (node->isElement() && !root) {
  ------------------
  |  Branch (267:14): [True: 810, False: 664]
  |  Branch (267:35): [True: 810, False: 0]
  ------------------
  268|    810|    root = (ZxElement *)node;
  269|    810|  }
  270|  2.07k|  ZxNode::addChild(node);
  271|  2.07k|}
_ZN5ZxDoc5parseEPKcj:
  273|  1.23k|bool ZxDoc::parse(const char *data, Guint dataLen) {
  274|  1.23k|  parsePtr = data;
  275|  1.23k|  parseEnd = data + dataLen;
  276|       |  
  277|  1.23k|  parseSpace();
  278|  1.23k|  parseBOM();
  279|  1.23k|  parseSpace();
  280|  1.23k|  parseXMLDecl(this);
  281|  1.23k|  parseMisc(this);
  282|  1.23k|  parseDocTypeDecl(this);
  283|  1.23k|  parseMisc(this);
  284|  1.23k|  if (match("<")) {
  ------------------
  |  Branch (284:7): [True: 810, False: 426]
  ------------------
  285|    810|    parseElement(this);
  286|    810|  }
  287|  1.23k|  parseMisc(this);
  288|       |  return root != NULL;
  289|  1.23k|}
_ZN5ZxDoc12parseXMLDeclEP6ZxNode:
  291|  1.23k|void ZxDoc::parseXMLDecl(ZxNode *par) {
  292|  1.23k|  GString *version, *encoding, *s;
  293|  1.23k|  bool standalone;
  294|       |
  295|  1.23k|  if (!match("<?xml")) {
  ------------------
  |  Branch (295:7): [True: 736, False: 500]
  ------------------
  296|    736|    return;
  297|    736|  }
  298|    500|  parsePtr += 5;
  299|    500|  parseSpace();
  300|       |
  301|       |  // version
  302|    500|  version = NULL;
  303|    500|  if (match("version")) {
  ------------------
  |  Branch (303:7): [True: 481, False: 19]
  ------------------
  304|    481|    parsePtr += 7;
  305|    481|    parseSpace();
  306|    481|    if (match("=")) {
  ------------------
  |  Branch (306:9): [True: 457, False: 24]
  ------------------
  307|    457|      ++parsePtr;
  308|    457|      parseSpace();
  309|    457|      version = parseQuotedString();
  310|    457|    }
  311|    481|  }
  312|    500|  if (!version) {
  ------------------
  |  Branch (312:7): [True: 43, False: 457]
  ------------------
  313|     43|    version = new GString("1.0");
  314|     43|  }
  315|    500|  parseSpace();
  316|       |	
  317|       |  // encoding
  318|    500|  encoding = NULL;
  319|    500|  if (match("encoding")) {
  ------------------
  |  Branch (319:7): [True: 342, False: 158]
  ------------------
  320|    342|    parsePtr += 8;
  321|    342|    parseSpace();
  322|    342|    if (match("=")) {
  ------------------
  |  Branch (322:9): [True: 325, False: 17]
  ------------------
  323|    325|      ++parsePtr;
  324|    325|      parseSpace();
  325|    325|      encoding = parseQuotedString();
  326|    325|    }
  327|    342|  }
  328|    500|  parseSpace();
  329|       |
  330|       |  // standalone
  331|    500|  standalone = false;
  332|    500|  if (match("standalone")) {
  ------------------
  |  Branch (332:7): [True: 69, False: 431]
  ------------------
  333|     69|    parsePtr += 10;
  334|     69|    parseSpace();
  335|     69|    if (match("=")) {
  ------------------
  |  Branch (335:9): [True: 47, False: 22]
  ------------------
  336|     47|      ++parsePtr;
  337|     47|      parseSpace();
  338|     47|      s = parseQuotedString();
  339|     47|      standalone = !s->cmp("yes");
  340|     47|      delete s;
  341|     47|    }
  342|     69|  }
  343|    500|  parseSpace();
  344|       |
  345|    500|  if (match("?>")) {
  ------------------
  |  Branch (345:7): [True: 277, False: 223]
  ------------------
  346|    277|    parsePtr += 2;
  347|    277|  }
  348|       |
  349|    500|  par->addChild(new ZxXMLDecl(version, encoding, standalone));
  350|    500|}
_ZN5ZxDoc16parseDocTypeDeclEP6ZxNode:
  353|  1.23k|void ZxDoc::parseDocTypeDecl(ZxNode *par) {
  354|  1.23k|  GString *name;
  355|  1.23k|  int state;
  356|  1.23k|  char c, quote;
  357|       |
  358|  1.23k|  if (!match("<!DOCTYPE")) {
  ------------------
  |  Branch (358:7): [True: 1.13k, False: 102]
  ------------------
  359|  1.13k|    return;
  360|  1.13k|  }
  361|    102|  parsePtr += 9;
  362|    102|  parseSpace();
  363|       |
  364|    102|  name = parseName();
  365|    102|  parseSpace();
  366|       |
  367|    102|  state = 0;
  368|    102|  quote = '\0';
  369|   124k|  while (parsePtr < parseEnd && state < 4) {
  ------------------
  |  Branch (369:10): [True: 124k, False: 48]
  |  Branch (369:33): [True: 124k, False: 54]
  ------------------
  370|   124k|    c = *parsePtr++;
  371|   124k|    switch (state) {
  ------------------
  |  Branch (371:13): [True: 124k, False: 0]
  ------------------
  372|  21.8k|    case 0: // not in square brackets; not in quotes
  ------------------
  |  Branch (372:5): [True: 21.8k, False: 102k]
  ------------------
  373|  21.8k|      if (c == '>') {
  ------------------
  |  Branch (373:11): [True: 54, False: 21.7k]
  ------------------
  374|     54|	state = 4;
  375|  21.7k|      } else if (c == '"' || c == '\'') {
  ------------------
  |  Branch (375:18): [True: 83, False: 21.6k]
  |  Branch (375:30): [True: 134, False: 21.5k]
  ------------------
  376|    217|	state = 1;
  377|  21.5k|      } else if (c == '[') {
  ------------------
  |  Branch (377:18): [True: 309, False: 21.2k]
  ------------------
  378|    309|	state = 2;
  379|    309|      }
  380|  21.8k|      break;
  381|  11.8k|    case 1: // not in square brackets; in quotes
  ------------------
  |  Branch (381:5): [True: 11.8k, False: 112k]
  ------------------
  382|  11.8k|      if (c == quote) {
  ------------------
  |  Branch (382:11): [True: 206, False: 11.6k]
  ------------------
  383|    206|	state = 0;
  384|    206|      }
  385|  11.8k|      break;
  386|  77.4k|    case 2: // in square brackets; not in quotes
  ------------------
  |  Branch (386:5): [True: 77.4k, False: 46.9k]
  ------------------
  387|  77.4k|      if (c == ']') {
  ------------------
  |  Branch (387:11): [True: 280, False: 77.2k]
  ------------------
  388|    280|	state = 0;
  389|  77.2k|      } else if (c == '"' || c == '\'') {
  ------------------
  |  Branch (389:18): [True: 203, False: 77.0k]
  |  Branch (389:30): [True: 116, False: 76.8k]
  ------------------
  390|    319|	state = 3;
  391|    319|      }
  392|  77.4k|      break;
  393|  13.3k|    case 3: // in square brackets; in quotes
  ------------------
  |  Branch (393:5): [True: 13.3k, False: 111k]
  ------------------
  394|  13.3k|      if (c == quote) {
  ------------------
  |  Branch (394:11): [True: 312, False: 13.0k]
  ------------------
  395|    312|	state = 2;
  396|    312|      }
  397|  13.3k|      break;
  398|   124k|    }
  399|   124k|  }
  400|       |
  401|    102|  par->addChild(new ZxDocTypeDecl(name));
  402|    102|}
_ZN5ZxDoc12parseElementEP6ZxNode:
  405|  1.50M|void ZxDoc::parseElement(ZxNode *par) {
  406|  1.50M|  GString *type;
  407|  1.50M|  ZxElement *elem;
  408|  1.50M|  ZxAttr *attr;
  409|       |
  410|  1.50M|  ++parsePtr;
  411|  1.50M|  type = parseName();
  412|  1.50M|  elem = new ZxElement(type);
  413|  1.50M|  parseSpace();
  414|  1.64M|  while ((attr = parseAttr())) {
  ------------------
  |  Branch (414:10): [True: 143k, False: 1.50M]
  ------------------
  415|   143k|    elem->addAttr(attr);
  416|   143k|    parseSpace();
  417|   143k|  }
  418|  1.50M|  if (match("/>")) {
  ------------------
  |  Branch (418:7): [True: 35.3k, False: 1.46M]
  ------------------
  419|  35.3k|    parsePtr += 2;
  420|  1.46M|  } else if (match(">")) {
  ------------------
  |  Branch (420:14): [True: 395k, False: 1.07M]
  ------------------
  421|   395k|    ++parsePtr;
  422|   395k|    parseContent(elem);
  423|   395k|  }
  424|  1.50M|  par->addChild(elem);
  425|  1.50M|}
_ZN5ZxDoc9parseAttrEv:
  427|  1.64M|ZxAttr *ZxDoc::parseAttr() {
  428|  1.64M|  GString *name, *value;
  429|  1.64M|  const char *start;
  430|  1.64M|  char quote, c;
  431|  1.64M|  unsigned int x;
  432|  1.64M|  int n;
  433|       |
  434|  1.64M|  name = parseName();
  435|  1.64M|  parseSpace();
  436|  1.64M|  if (!match("=")) {
  ------------------
  |  Branch (436:7): [True: 1.48M, False: 164k]
  ------------------
  437|  1.48M|    delete name;
  438|  1.48M|    return NULL;
  439|  1.48M|  }
  440|   164k|  ++parsePtr;
  441|   164k|  parseSpace();
  442|   164k|  if (!(parsePtr < parseEnd && (*parsePtr == '"' || *parsePtr == '\''))) {
  ------------------
  |  Branch (442:9): [True: 164k, False: 3]
  |  Branch (442:33): [True: 142k, False: 21.3k]
  |  Branch (442:53): [True: 936, False: 20.3k]
  ------------------
  443|  20.3k|    delete name;
  444|  20.3k|    return NULL;
  445|  20.3k|  }
  446|   143k|  quote = *parsePtr++;
  447|   143k|  value = new GString();
  448|   341k|  while (parsePtr < parseEnd && *parsePtr != quote) {
  ------------------
  |  Branch (448:10): [True: 341k, False: 84]
  |  Branch (448:33): [True: 198k, False: 143k]
  ------------------
  449|   198k|    if (*parsePtr == '&') {
  ------------------
  |  Branch (449:9): [True: 35.5k, False: 162k]
  ------------------
  450|  35.5k|      ++parsePtr;
  451|  35.5k|      if (parsePtr < parseEnd && *parsePtr == '#') {
  ------------------
  |  Branch (451:11): [True: 35.5k, False: 3]
  |  Branch (451:34): [True: 19.5k, False: 16.0k]
  ------------------
  452|  19.5k|	++parsePtr;
  453|  19.5k|	if (parsePtr < parseEnd && *parsePtr == 'x') {
  ------------------
  |  Branch (453:6): [True: 19.5k, False: 2]
  |  Branch (453:29): [True: 8.39k, False: 11.1k]
  ------------------
  454|  8.39k|	  ++parsePtr;
  455|  8.39k|	  x = 0;
  456|  17.9k|	  while (parsePtr < parseEnd) {
  ------------------
  |  Branch (456:11): [True: 17.9k, False: 2]
  ------------------
  457|  17.9k|	    c = *parsePtr;
  458|  17.9k|	    if (c >= '0' && c <= '9') {
  ------------------
  |  Branch (458:10): [True: 15.1k, False: 2.80k]
  |  Branch (458:22): [True: 1.05k, False: 14.0k]
  ------------------
  459|  1.05k|	      x = (x << 4) + (c - '0');
  460|  16.8k|	    } else if (c >= 'a' && c <= 'f') {
  ------------------
  |  Branch (460:17): [True: 5.47k, False: 11.4k]
  |  Branch (460:29): [True: 2.13k, False: 3.33k]
  ------------------
  461|  2.13k|	      x = (x << 4) + (10 + c - 'a');
  462|  14.7k|	    } else if (c >= 'A' && c <= 'F') {
  ------------------
  |  Branch (462:17): [True: 10.7k, False: 3.97k]
  |  Branch (462:29): [True: 6.35k, False: 4.41k]
  ------------------
  463|  6.35k|	      x = (x << 4) + (10 + c - 'A');
  464|  8.38k|	    } else {
  465|  8.38k|	      break;
  466|  8.38k|	    }
  467|  9.54k|	    ++parsePtr;
  468|  9.54k|	  }
  469|  8.39k|	  if (parsePtr < parseEnd && *parsePtr == ';') {
  ------------------
  |  Branch (469:8): [True: 8.38k, False: 2]
  |  Branch (469:31): [True: 290, False: 8.09k]
  ------------------
  470|    290|	    ++parsePtr;
  471|    290|	  }
  472|  8.39k|	  appendUTF8(value, x);
  473|  11.1k|	} else {
  474|  11.1k|	  x = 0;
  475|  11.8k|	  while (parsePtr < parseEnd) {
  ------------------
  |  Branch (475:11): [True: 11.7k, False: 3]
  ------------------
  476|  11.7k|	    c = *parsePtr;
  477|  11.7k|	    if (c >= '0' && c <= '9') {
  ------------------
  |  Branch (477:10): [True: 6.69k, False: 5.10k]
  |  Branch (477:22): [True: 676, False: 6.02k]
  ------------------
  478|    676|	      x = x * 10 + (c - '0');
  479|  11.1k|	    } else {
  480|  11.1k|	      break;
  481|  11.1k|	    }
  482|    676|	    ++parsePtr;
  483|    676|	  }
  484|  11.1k|	  if (parsePtr < parseEnd && *parsePtr == ';') {
  ------------------
  |  Branch (484:8): [True: 11.1k, False: 3]
  |  Branch (484:31): [True: 324, False: 10.7k]
  ------------------
  485|    324|	    ++parsePtr;
  486|    324|	  }
  487|  11.1k|	  appendUTF8(value, x);
  488|  11.1k|	}
  489|  19.5k|      } else {
  490|  16.0k|	start = parsePtr;
  491|  16.0k|	for (++parsePtr;
  492|  1.40M|	     parsePtr < parseEnd && *parsePtr != ';' &&
  ------------------
  |  Branch (492:7): [True: 1.40M, False: 19]
  |  Branch (492:30): [True: 1.40M, False: 319]
  ------------------
  493|  1.40M|	       *parsePtr != quote && *parsePtr != '&';
  ------------------
  |  Branch (493:9): [True: 1.39M, False: 3.45k]
  |  Branch (493:31): [True: 1.38M, False: 12.2k]
  ------------------
  494|  1.38M|	     ++parsePtr) ;
  495|  16.0k|	n = (int)(parsePtr - start);
  496|  16.0k|	if (parsePtr < parseEnd && *parsePtr == ';') {
  ------------------
  |  Branch (496:6): [True: 16.0k, False: 19]
  |  Branch (496:29): [True: 319, False: 15.6k]
  ------------------
  497|    319|	  ++parsePtr;
  498|    319|	}
  499|  16.0k|	if (n == 2 && !strncmp(start, "lt", 2)) {
  ------------------
  |  Branch (499:6): [True: 1.04k, False: 14.9k]
  |  Branch (499:16): [True: 230, False: 810]
  ------------------
  500|    230|	  value->append('<');
  501|  15.8k|	} else if (n == 2 && !strncmp(start, "gt", 2)) {
  ------------------
  |  Branch (501:13): [True: 810, False: 14.9k]
  |  Branch (501:23): [True: 280, False: 530]
  ------------------
  502|    280|	  value->append('>');
  503|  15.5k|	} else if (n == 3 && !strncmp(start, "amp", 3)) {
  ------------------
  |  Branch (503:13): [True: 415, False: 15.1k]
  |  Branch (503:23): [True: 35, False: 380]
  ------------------
  504|     35|	  value->append('&');
  505|  15.4k|	} else if (n == 4 && !strncmp(start, "apos", 4)) {
  ------------------
  |  Branch (505:13): [True: 424, False: 15.0k]
  |  Branch (505:23): [True: 0, False: 424]
  ------------------
  506|      0|	  value->append('\'');
  507|  15.4k|	} else if (n == 4 && !strncmp(start, "quot", 4)) {
  ------------------
  |  Branch (507:13): [True: 424, False: 15.0k]
  |  Branch (507:23): [True: 0, False: 424]
  ------------------
  508|      0|	  value->append('"');
  509|  15.4k|	} else {
  510|  15.4k|	  value->append(start - 1, (int)(parsePtr - start) + 1);
  511|  15.4k|	}
  512|  16.0k|      }
  513|   162k|    } else {
  514|   162k|      start = parsePtr;
  515|   162k|      for (++parsePtr;
  516|  12.3M|	   parsePtr < parseEnd && *parsePtr != quote && *parsePtr != '&';
  ------------------
  |  Branch (516:5): [True: 12.3M, False: 58]
  |  Branch (516:28): [True: 12.2M, False: 139k]
  |  Branch (516:50): [True: 12.2M, False: 23.0k]
  ------------------
  517|  12.2M|	   ++parsePtr) ;
  518|   162k|      value->append(start, (int)(parsePtr - start));
  519|   162k|    }
  520|   198k|  }
  521|   143k|  if (parsePtr < parseEnd && *parsePtr == quote) {
  ------------------
  |  Branch (521:7): [True: 143k, False: 84]
  |  Branch (521:30): [True: 143k, False: 0]
  ------------------
  522|   143k|    ++parsePtr;
  523|   143k|  }
  524|   143k|  return new ZxAttr(name, value);
  525|   164k|}
_ZN5ZxDoc12parseContentEP9ZxElement:
  528|   395k|void ZxDoc::parseContent(ZxElement *par) {
  529|   395k|  GString *endType;
  530|       |
  531|   395k|  endType = (new GString("</"))->append(par->getType());
  532|       |
  533|  2.97M|  while (parsePtr < parseEnd) {
  ------------------
  |  Branch (533:10): [True: 2.66M, False: 313k]
  ------------------
  534|  2.66M|    if (match(endType->getCString())) {
  ------------------
  |  Branch (534:9): [True: 81.5k, False: 2.58M]
  ------------------
  535|  81.5k|      parsePtr += endType->getLength();
  536|  81.5k|      parseSpace();
  537|  81.5k|      if (match(">")) {
  ------------------
  |  Branch (537:11): [True: 48.9k, False: 32.6k]
  ------------------
  538|  48.9k|	++parsePtr;
  539|  48.9k|      }
  540|  81.5k|      break;
  541|  2.58M|    } else if (match("<?")) {
  ------------------
  |  Branch (541:16): [True: 21.2k, False: 2.56M]
  ------------------
  542|  21.2k|      parsePI(par);
  543|  2.56M|    } else if (match("<![CDATA[")) {
  ------------------
  |  Branch (543:16): [True: 55, False: 2.56M]
  ------------------
  544|     55|      parseCDSect(par);
  545|  2.56M|    } else if (match("<!--")) {
  ------------------
  |  Branch (545:16): [True: 2.00k, False: 2.55M]
  ------------------
  546|  2.00k|      parseComment(par);
  547|  2.55M|    } else if (match("<")) {
  ------------------
  |  Branch (547:16): [True: 1.50M, False: 1.05M]
  ------------------
  548|  1.50M|      parseElement(par);
  549|  1.50M|    } else {
  550|  1.05M|      parseCharData(par);
  551|  1.05M|    }
  552|  2.66M|  }
  553|       |
  554|   395k|  delete endType;
  555|   395k|}
_ZN5ZxDoc13parseCharDataEP9ZxElement:
  557|  1.05M|void ZxDoc::parseCharData(ZxElement *par) {
  558|  1.05M|  GString *data;
  559|  1.05M|  const char *start;
  560|  1.05M|  char c;
  561|  1.05M|  unsigned int x;
  562|  1.05M|  int n;
  563|       |
  564|  1.05M|  data = new GString();
  565|  2.26M|  while (parsePtr < parseEnd && *parsePtr != '<') {
  ------------------
  |  Branch (565:10): [True: 2.26M, False: 475]
  |  Branch (565:33): [True: 1.20M, False: 1.05M]
  ------------------
  566|  1.20M|    if (*parsePtr == '&') {
  ------------------
  |  Branch (566:9): [True: 132k, False: 1.07M]
  ------------------
  567|   132k|      ++parsePtr;
  568|   132k|      if (parsePtr < parseEnd && *parsePtr == '#') {
  ------------------
  |  Branch (568:11): [True: 132k, False: 4]
  |  Branch (568:34): [True: 31.5k, False: 100k]
  ------------------
  569|  31.5k|	++parsePtr;
  570|  31.5k|	if (parsePtr < parseEnd && *parsePtr == 'x') {
  ------------------
  |  Branch (570:6): [True: 31.5k, False: 9]
  |  Branch (570:29): [True: 9.47k, False: 22.1k]
  ------------------
  571|  9.47k|	  ++parsePtr;
  572|  9.47k|	  x = 0;
  573|  23.2k|	  while (parsePtr < parseEnd) {
  ------------------
  |  Branch (573:11): [True: 23.2k, False: 8]
  ------------------
  574|  23.2k|	    c = *parsePtr;
  575|  23.2k|	    if (c >= '0' && c <= '9') {
  ------------------
  |  Branch (575:10): [True: 19.0k, False: 4.14k]
  |  Branch (575:22): [True: 1.56k, False: 17.5k]
  ------------------
  576|  1.56k|	      x = (x << 4) + (c - '0');
  577|  21.6k|	    } else if (c >= 'a' && c <= 'f') {
  ------------------
  |  Branch (577:17): [True: 5.62k, False: 16.0k]
  |  Branch (577:29): [True: 2.67k, False: 2.94k]
  ------------------
  578|  2.67k|	      x = (x << 4) + (10 + c - 'a');
  579|  18.9k|	    } else if (c >= 'A' && c <= 'F') {
  ------------------
  |  Branch (579:17): [True: 13.7k, False: 5.26k]
  |  Branch (579:29): [True: 9.52k, False: 4.20k]
  ------------------
  580|  9.52k|	      x = (x << 4) + (10 + c - 'A');
  581|  9.52k|	    } else {
  582|  9.46k|	      break;
  583|  9.46k|	    }
  584|  13.7k|	    ++parsePtr;
  585|  13.7k|	  }
  586|  9.47k|	  if (parsePtr < parseEnd && *parsePtr == ';') {
  ------------------
  |  Branch (586:8): [True: 9.46k, False: 8]
  |  Branch (586:31): [True: 293, False: 9.17k]
  ------------------
  587|    293|	    ++parsePtr;
  588|    293|	  }
  589|  9.47k|	  appendUTF8(data, x);
  590|  22.1k|	} else {
  591|  22.1k|	  x = 0;
  592|  31.0k|	  while (parsePtr < parseEnd) {
  ------------------
  |  Branch (592:11): [True: 31.0k, False: 12]
  ------------------
  593|  31.0k|	    c = *parsePtr;
  594|  31.0k|	    if (c >= '0' && c <= '9') {
  ------------------
  |  Branch (594:10): [True: 20.8k, False: 10.1k]
  |  Branch (594:22): [True: 8.95k, False: 11.9k]
  ------------------
  595|  8.95k|	      x = x * 10 + (c - '0');
  596|  22.0k|	    } else {
  597|  22.0k|	      break;
  598|  22.0k|	    }
  599|  8.95k|	    ++parsePtr;
  600|  8.95k|	  }
  601|  22.1k|	  if (parsePtr < parseEnd && *parsePtr == ';') {
  ------------------
  |  Branch (601:8): [True: 22.0k, False: 12]
  |  Branch (601:31): [True: 483, False: 21.6k]
  ------------------
  602|    483|	    ++parsePtr;
  603|    483|	  }
  604|  22.1k|	  appendUTF8(data, x);
  605|  22.1k|	}
  606|   100k|      } else {
  607|   100k|	start = parsePtr;
  608|   100k|	for (++parsePtr;
  609|  11.6M|	     parsePtr < parseEnd && *parsePtr != ';' &&
  ------------------
  |  Branch (609:7): [True: 11.6M, False: 53]
  |  Branch (609:30): [True: 11.6M, False: 922]
  ------------------
  610|  11.6M|	       *parsePtr != '<' && *parsePtr != '&';
  ------------------
  |  Branch (610:9): [True: 11.5M, False: 47.5k]
  |  Branch (610:29): [True: 11.5M, False: 51.9k]
  ------------------
  611|  11.5M|	     ++parsePtr) ;
  612|   100k|	n = (int)(parsePtr - start);
  613|   100k|	if (parsePtr < parseEnd && *parsePtr == ';') {
  ------------------
  |  Branch (613:6): [True: 100k, False: 53]
  |  Branch (613:29): [True: 922, False: 99.4k]
  ------------------
  614|    922|	  ++parsePtr;
  615|    922|	}
  616|   100k|	if (n == 2 && !strncmp(start, "lt", 2)) {
  ------------------
  |  Branch (616:6): [True: 4.77k, False: 95.6k]
  |  Branch (616:16): [True: 572, False: 4.19k]
  ------------------
  617|    572|	  data->append('<');
  618|  99.8k|	} else if (n == 2 && !strncmp(start, "gt", 2)) {
  ------------------
  |  Branch (618:13): [True: 4.19k, False: 95.6k]
  |  Branch (618:23): [True: 290, False: 3.90k]
  ------------------
  619|    290|	  data->append('>');
  620|  99.5k|	} else if (n == 3 && !strncmp(start, "amp", 3)) {
  ------------------
  |  Branch (620:13): [True: 1.64k, False: 97.9k]
  |  Branch (620:23): [True: 114, False: 1.52k]
  ------------------
  621|    114|	  data->append('&');
  622|  99.4k|	} else if (n == 4 && !strncmp(start, "apos", 4)) {
  ------------------
  |  Branch (622:13): [True: 2.73k, False: 96.7k]
  |  Branch (622:23): [True: 0, False: 2.73k]
  ------------------
  623|      0|	  data->append('\'');
  624|  99.4k|	} else if (n == 4 && !strncmp(start, "quot", 4)) {
  ------------------
  |  Branch (624:13): [True: 2.73k, False: 96.7k]
  |  Branch (624:23): [True: 0, False: 2.73k]
  ------------------
  625|      0|	  data->append('"');
  626|  99.4k|	} else {
  627|  99.4k|	  data->append(start - 1, (int)(parsePtr - start) + 1);
  628|  99.4k|	}
  629|   100k|      }
  630|  1.07M|    } else {
  631|  1.07M|      start = parsePtr;
  632|  1.07M|      for (++parsePtr;
  633|  30.2M|	   parsePtr < parseEnd && *parsePtr != '<' && *parsePtr != '&';
  ------------------
  |  Branch (633:5): [True: 30.2M, False: 400]
  |  Branch (633:28): [True: 29.2M, False: 1.00M]
  |  Branch (633:48): [True: 29.2M, False: 69.7k]
  ------------------
  634|  29.2M|	   ++parsePtr) ;
  635|  1.07M|      data->append(start, (int)(parsePtr - start));
  636|  1.07M|    }
  637|  1.20M|  }
  638|  1.05M|  par->addChild(new ZxCharData(data, true));
  639|  1.05M|}
_ZN5ZxDoc10appendUTF8EP7GStringj:
  641|  51.1k|void ZxDoc::appendUTF8(GString *s, unsigned int c) {
  642|  51.1k|  if (c <= 0x7f) {
  ------------------
  |  Branch (642:7): [True: 44.9k, False: 6.12k]
  ------------------
  643|  44.9k|    s->append((char)c);
  644|  44.9k|  } else if (c <= 0x7ff) {
  ------------------
  |  Branch (644:14): [True: 1.39k, False: 4.73k]
  ------------------
  645|  1.39k|    s->append((char)(0xc0 + (c >> 6)));
  646|  1.39k|    s->append((char)(0x80 + (c & 0x3f)));
  647|  4.73k|  } else if (c <= 0xffff) {
  ------------------
  |  Branch (647:14): [True: 2.37k, False: 2.36k]
  ------------------
  648|  2.37k|    s->append((char)(0xe0 + (c >> 12)));
  649|  2.37k|    s->append((char)(0x80 + ((c >> 6) & 0x3f)));
  650|  2.37k|    s->append((char)(0x80 + (c & 0x3f)));
  651|  2.37k|  } else if (c <= 0x1fffff) {
  ------------------
  |  Branch (651:14): [True: 1.03k, False: 1.33k]
  ------------------
  652|  1.03k|    s->append((char)(0xf0 + (c >> 18)));
  653|  1.03k|    s->append((char)(0x80 + ((c >> 12) & 0x3f)));
  654|  1.03k|    s->append((char)(0x80 + ((c >> 6) & 0x3f)));
  655|  1.03k|    s->append((char)(0x80 + (c & 0x3f)));
  656|  1.33k|  } else if (c <= 0x3ffffff) {
  ------------------
  |  Branch (656:14): [True: 370, False: 961]
  ------------------
  657|    370|    s->append((char)(0xf8 + (c >> 24)));
  658|    370|    s->append((char)(0x80 + ((c >> 18) & 0x3f)));
  659|    370|    s->append((char)(0x80 + ((c >> 12) & 0x3f)));
  660|    370|    s->append((char)(0x80 + ((c >> 6) & 0x3f)));
  661|    370|    s->append((char)(0x80 + (c & 0x3f)));
  662|    961|  } else if (c <= 0x7fffffff) {
  ------------------
  |  Branch (662:14): [True: 504, False: 457]
  ------------------
  663|    504|    s->append((char)(0xfc + (c >> 30)));
  664|    504|    s->append((char)(0x80 + ((c >> 24) & 0x3f)));
  665|    504|    s->append((char)(0x80 + ((c >> 18) & 0x3f)));
  666|    504|    s->append((char)(0x80 + ((c >> 12) & 0x3f)));
  667|    504|    s->append((char)(0x80 + ((c >> 6) & 0x3f)));
  668|    504|    s->append((char)(0x80 + (c & 0x3f)));
  669|    504|  }
  670|  51.1k|}
_ZN5ZxDoc11parseCDSectEP6ZxNode:
  673|     55|void ZxDoc::parseCDSect(ZxNode *par) {
  674|     55|  const char *start;
  675|       |
  676|     55|  parsePtr += 9;
  677|     55|  start = parsePtr;
  678|  82.0k|  while (parsePtr < parseEnd - 3) {
  ------------------
  |  Branch (678:10): [True: 82.0k, False: 9]
  ------------------
  679|  82.0k|    if (!strncmp(parsePtr, "]]>", 3)) {
  ------------------
  |  Branch (679:9): [True: 46, False: 82.0k]
  ------------------
  680|     46|      par->addChild(new ZxCharData(new GString(start, (int)(parsePtr - start)),
  681|     46|				   false));
  682|     46|      parsePtr += 3;
  683|     46|      return;
  684|     46|    }
  685|  82.0k|    ++parsePtr;
  686|  82.0k|  }
  687|      9|  parsePtr = parseEnd;
  688|      9|  par->addChild(new ZxCharData(new GString(start, (int)(parsePtr - start)),
  689|      9|			       false));
  690|      9|}
_ZN5ZxDoc9parseMiscEP6ZxNode:
  692|  3.70k|void ZxDoc::parseMisc(ZxNode *par) {
  693|  12.7k|  while (1) {
  ------------------
  |  Branch (693:10): [True: 12.7k, Folded]
  ------------------
  694|  12.7k|    if (match("<!--")) {
  ------------------
  |  Branch (694:9): [True: 233, False: 12.5k]
  ------------------
  695|    233|      parseComment(par);
  696|  12.5k|    } else if (match("<?")) {
  ------------------
  |  Branch (696:16): [True: 445, False: 12.0k]
  ------------------
  697|    445|      parsePI(par);
  698|  12.0k|    } else if (parsePtr < parseEnd && (*parsePtr == '\x20' ||
  ------------------
  |  Branch (698:16): [True: 11.1k, False: 974]
  |  Branch (698:40): [True: 2.99k, False: 8.12k]
  ------------------
  699|  8.12k|				       *parsePtr == '\x09' ||
  ------------------
  |  Branch (699:12): [True: 2.49k, False: 5.62k]
  ------------------
  700|  5.62k|				       *parsePtr == '\x0d' ||
  ------------------
  |  Branch (700:12): [True: 1.19k, False: 4.43k]
  ------------------
  701|  8.38k|				       *parsePtr == '\x0a')) {
  ------------------
  |  Branch (701:12): [True: 1.69k, False: 2.73k]
  ------------------
  702|  8.38k|      ++parsePtr;
  703|  8.38k|    } else {
  704|  3.70k|      break;
  705|  3.70k|    }
  706|  12.7k|  }
  707|  3.70k|}
_ZN5ZxDoc12parseCommentEP6ZxNode:
  710|  2.23k|void ZxDoc::parseComment(ZxNode *par) {
  711|  2.23k|  const char *start;
  712|       |
  713|  2.23k|  parsePtr += 4;
  714|  2.23k|  start = parsePtr;
  715|   422k|  while (parsePtr <= parseEnd - 3) {
  ------------------
  |  Branch (715:10): [True: 422k, False: 30]
  ------------------
  716|   422k|    if (!strncmp(parsePtr, "-->", 3)) {
  ------------------
  |  Branch (716:9): [True: 2.20k, False: 420k]
  ------------------
  717|  2.20k|      par->addChild(new ZxComment(new GString(start, (int)(parsePtr - start))));
  718|  2.20k|      parsePtr += 3;
  719|  2.20k|      return;
  720|  2.20k|    }
  721|   420k|    ++parsePtr;
  722|   420k|  }
  723|     30|  parsePtr = parseEnd;
  724|     30|}
_ZN5ZxDoc7parsePIEP6ZxNode:
  727|  21.7k|void ZxDoc::parsePI(ZxNode *par) {
  728|  21.7k|  GString *target;
  729|  21.7k|  const char *start;
  730|       |
  731|  21.7k|  parsePtr += 2;
  732|  21.7k|  target = parseName();
  733|  21.7k|  parseSpace();
  734|  21.7k|  start = parsePtr;
  735|  1.73M|  while (parsePtr <= parseEnd - 2) {
  ------------------
  |  Branch (735:10): [True: 1.73M, False: 84]
  ------------------
  736|  1.73M|    if (!strncmp(parsePtr, "?>", 2)) {
  ------------------
  |  Branch (736:9): [True: 21.6k, False: 1.71M]
  ------------------
  737|  21.6k|      par->addChild(new ZxPI(target, new GString(start,
  738|  21.6k|						 (int)(parsePtr - start))));
  739|  21.6k|      parsePtr += 2;
  740|  21.6k|      return;
  741|  21.6k|    }
  742|  1.71M|    ++parsePtr;
  743|  1.71M|  }
  744|     84|  parsePtr = parseEnd;
  745|     84|  par->addChild(new ZxPI(target, new GString(start, (int)(parsePtr - start))));
  746|     84|}
_ZN5ZxDoc9parseNameEv:
  750|  3.17M|GString *ZxDoc::parseName() {
  751|  3.17M|  GString *name;
  752|       |
  753|  3.17M|  name = new GString();
  754|  3.17M|  if (parsePtr < parseEnd && nameStartChar[*parsePtr & 0xff]) {
  ------------------
  |  Branch (754:7): [True: 3.17M, False: 139]
  |  Branch (754:30): [True: 1.51M, False: 1.65M]
  ------------------
  755|  1.51M|    name->append(*parsePtr++);
  756|  5.55M|    while (parsePtr < parseEnd && nameChar[*parsePtr & 0xff]) {
  ------------------
  |  Branch (756:12): [True: 5.55M, False: 29]
  |  Branch (756:35): [True: 4.04M, False: 1.51M]
  ------------------
  757|  4.04M|      name->append(*parsePtr++);
  758|  4.04M|    }
  759|  1.51M|  }
  760|  3.17M|  return name;
  761|  3.17M|}
_ZN5ZxDoc17parseQuotedStringEv:
  763|    829|GString *ZxDoc::parseQuotedString() {
  764|    829|  GString *s;
  765|    829|  const char *start;
  766|    829|  char quote;
  767|       |
  768|    829|  if (parsePtr < parseEnd && (*parsePtr == '"' || *parsePtr == '\'')) {
  ------------------
  |  Branch (768:7): [True: 824, False: 5]
  |  Branch (768:31): [True: 710, False: 114]
  |  Branch (768:51): [True: 57, False: 57]
  ------------------
  769|    767|    quote = *parsePtr++;
  770|    767|    start = parsePtr;
  771|  39.9k|    while (parsePtr < parseEnd && *parsePtr != quote) {
  ------------------
  |  Branch (771:12): [True: 39.9k, False: 1]
  |  Branch (771:35): [True: 39.1k, False: 766]
  ------------------
  772|  39.1k|      ++parsePtr;
  773|  39.1k|    }
  774|    767|    s = new GString(start, (int)(parsePtr - start));
  775|    767|    if (parsePtr < parseEnd && *parsePtr == quote) {
  ------------------
  |  Branch (775:9): [True: 766, False: 1]
  |  Branch (775:32): [True: 766, False: 0]
  ------------------
  776|    766|      ++parsePtr;
  777|    766|    }
  778|    767|  } else {
  779|     62|    s = new GString();
  780|     62|  }
  781|    829|  return s;
  782|    829|}
_ZN5ZxDoc8parseBOMEv:
  784|  1.23k|void ZxDoc::parseBOM() {
  785|  1.23k|  if (match("\xef\xbb\xbf")) {
  ------------------
  |  Branch (785:7): [True: 22, False: 1.21k]
  ------------------
  786|     22|    parsePtr += 3;
  787|     22|  }
  788|  1.23k|}
_ZN5ZxDoc10parseSpaceEv:
  790|  3.56M|void ZxDoc::parseSpace() {
  791|  5.14M|  while (parsePtr < parseEnd && (*parsePtr == '\x20' ||
  ------------------
  |  Branch (791:10): [True: 5.14M, False: 357]
  |  Branch (791:34): [True: 1.26M, False: 3.87M]
  ------------------
  792|  3.87M|				 *parsePtr == '\x09' ||
  ------------------
  |  Branch (792:6): [True: 18.0k, False: 3.85M]
  ------------------
  793|  3.85M|				 *parsePtr == '\x0d' ||
  ------------------
  |  Branch (793:6): [True: 67.9k, False: 3.78M]
  ------------------
  794|  3.78M|				 *parsePtr == '\x0a')) {
  ------------------
  |  Branch (794:6): [True: 221k, False: 3.56M]
  ------------------
  795|  1.57M|    ++parsePtr;
  796|  1.57M|  }
  797|  3.56M|}
_ZN5ZxDoc5matchEPKc:
  799|  17.6M|bool ZxDoc::match(const char *s) {
  800|  17.6M|  int n;
  801|       |
  802|  17.6M|  n = (int)strlen(s);
  803|  17.6M|  return parseEnd - parsePtr >= n && !strncmp(parsePtr, s, n);
  ------------------
  |  Branch (803:10): [True: 17.6M, False: 3.50k]
  |  Branch (803:38): [True: 2.25M, False: 15.3M]
  ------------------
  804|  17.6M|}
_ZN9ZxXMLDeclC2EP7GStringS1_b:
  822|    500|ZxXMLDecl::ZxXMLDecl(GString *versionA, GString *encodingA, bool standaloneA) {
  823|    500|  version = versionA;
  824|    500|  encoding = encodingA;
  825|    500|  standalone = standaloneA;
  826|    500|}
_ZN9ZxXMLDeclD2Ev:
  828|    500|ZxXMLDecl::~ZxXMLDecl() {
  829|    500|  delete version;
  830|    500|  if (encoding) {
  ------------------
  |  Branch (830:7): [True: 325, False: 175]
  ------------------
  831|    325|    delete encoding;
  832|    325|  }
  833|    500|}
_ZN13ZxDocTypeDeclC2EP7GString:
  858|    102|ZxDocTypeDecl::ZxDocTypeDecl(GString *nameA) {
  859|    102|  name = nameA;
  860|    102|}
_ZN13ZxDocTypeDeclD2Ev:
  862|    102|ZxDocTypeDecl::~ZxDocTypeDecl() {
  863|    102|  delete name;
  864|    102|}
_ZN9ZxCommentC2EP7GString:
  880|  2.20k|ZxComment::ZxComment(GString *textA) {
  881|  2.20k|  text = textA;
  882|  2.20k|}
_ZN9ZxCommentD2Ev:
  884|  2.20k|ZxComment::~ZxComment() {
  885|  2.20k|  delete text;
  886|  2.20k|}
_ZN4ZxPIC2EP7GStringS1_:
  902|  21.7k|ZxPI::ZxPI(GString *targetA, GString *textA) {
  903|  21.7k|  target = targetA;
  904|  21.7k|  text = textA;
  905|  21.7k|}
_ZN4ZxPID2Ev:
  907|  21.7k|ZxPI::~ZxPI() {
  908|  21.7k|  delete target;
  909|  21.7k|  delete text;
  910|  21.7k|}
_ZN9ZxElementC2EP7GString:
  928|  1.50M|ZxElement::ZxElement(GString *typeA) {
  929|  1.50M|  type = typeA;
  930|  1.50M|  attrs = new GHash();
  931|       |  firstAttr = lastAttr = NULL;
  932|  1.50M|}
_ZN9ZxElementD2Ev:
  934|  1.50M|ZxElement::~ZxElement() {
  935|  1.50M|  delete type;
  936|  1.50M|  deleteGHash(attrs, ZxAttr);
  ------------------
  |  |   60|  1.50M|  do {                                             \
  |  |   61|  1.50M|    GHash *_hash = (hash);                         \
  |  |   62|  1.50M|    {                                              \
  |  |   63|  1.50M|      GHashIter *_iter;                            \
  |  |   64|  1.50M|      GString *_key;                               \
  |  |   65|  1.50M|      void *_p;                                    \
  |  |   66|  1.50M|      _hash->startIter(&_iter);                    \
  |  |   67|  1.64M|      while (_hash->getNext(&_iter, &_key, &_p)) { \
  |  |  ------------------
  |  |  |  Branch (67:14): [True: 143k, False: 1.50M]
  |  |  ------------------
  |  |   68|   143k|        delete (T*)_p;                             \
  |  |   69|   143k|      }                                            \
  |  |   70|  1.50M|      delete _hash;                                \
  |  |   71|  1.50M|    }                                              \
  |  |   72|  1.50M|  } while(0)
  |  |  ------------------
  |  |  |  Branch (72:11): [Folded, False: 1.50M]
  |  |  ------------------
  ------------------
  937|  1.50M|}
_ZN9ZxElement9isElementEPKc:
  939|  1.91M|bool ZxElement::isElement(const char *typeA) {
  940|  1.91M|  return !type->cmp(typeA);
  941|  1.91M|}
_ZN9ZxElement8findAttrEPKc:
  943|   403k|ZxAttr *ZxElement::findAttr(const char *attrName) {
  944|   403k|  return (ZxAttr *)attrs->lookup(attrName);
  945|   403k|}
_ZN9ZxElement7addAttrEP6ZxAttr:
  947|   143k|void ZxElement::addAttr(ZxAttr *attr) {
  948|   143k|  attrs->add(attr->getName(), attr);
  949|   143k|  if (lastAttr) {
  ------------------
  |  Branch (949:7): [True: 48.5k, False: 95.1k]
  ------------------
  950|  48.5k|    lastAttr->next = attr;
  951|  48.5k|    lastAttr= attr;
  952|  95.1k|  } else {
  953|  95.1k|    firstAttr = lastAttr = attr;
  954|  95.1k|  }
  955|   143k|  attr->parent = this;
  956|       |  attr->next = NULL;
  957|   143k|}
_ZN6ZxAttrC2EP7GStringS1_:
 1025|   143k|ZxAttr::ZxAttr(GString *nameA, GString *valueA) {
 1026|   143k|  name = nameA;
 1027|   143k|  value = valueA;
 1028|   143k|  parent = NULL;
 1029|       |  next = NULL;
 1030|   143k|}
_ZN6ZxAttrD2Ev:
 1032|   143k|ZxAttr::~ZxAttr() {
 1033|   143k|  delete name;
 1034|   143k|  delete value;
 1035|   143k|}
_ZN10ZxCharDataC2EP7GStringb:
 1039|  1.05M|ZxCharData::ZxCharData(GString *dataA, bool parsedA) {
 1040|  1.05M|  data = dataA;
 1041|  1.05M|  parsed = parsedA;
 1042|  1.05M|}
_ZN10ZxCharDataD2Ev:
 1044|  1.05M|ZxCharData::~ZxCharData() {
 1045|  1.05M|  delete data;
 1046|  1.05M|}

_ZN5ZxDoc7getRootEv:
   88|  3.24k|  ZxElement *getRoot() { return root; }
_ZN10ZxCharData7getDataEv:
  257|  1.78k|  GString *getData() { return data; }
_ZN6ZxAttr8getValueEv:
  234|  38.8k|  GString *getValue() { return value; }
_ZN9ZxElement7getTypeEv:
  209|   426k|  GString *getType() { return type; }
_ZN6ZxNode9isXMLDeclEv:
   36|  1.57k|  virtual bool isXMLDecl()  { return false; }
_ZN6ZxNode13isDocTypeDeclEv:
   37|  1.47k|  virtual bool isDocTypeDecl() { return false; }
_ZN6ZxNode9isElementEv:
   40|   186k|  virtual bool isElement() { return false; }
_ZN6ZxNode9isElementEPKc:
   41|   281k|  virtual bool isElement(const char *type) { return false; }
_ZN6ZxNode10isCharDataEv:
   42|  1.06k|  virtual bool isCharData() { return false; }
_ZN6ZxNode13getFirstChildEv:
   43|   203k|  virtual ZxNode *getFirstChild() { return firstChild; }
_ZN6ZxNode12getNextChildEv:
   44|   429k|  virtual ZxNode *getNextChild() { return next; }
_ZN9ZxXMLDecl9isXMLDeclEv:
  129|    500|  virtual bool isXMLDecl() { return true; }
_ZN13ZxDocTypeDecl13isDocTypeDeclEv:
  151|    102|  virtual bool isDocTypeDecl() { return true; }
_ZN9ZxElement9isElementEv:
  207|   247k|  virtual bool isElement() { return true; }
_ZN6ZxAttr7getNameEv:
  233|   143k|  GString *getName() { return name; }
_ZN10ZxCharData10isCharDataEv:
  256|  1.78k|  virtual bool isCharData() { return true; }

