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

_ZN5GHashC2Ei:
   34|  2.08M|GHash::GHash(GBool deleteKeysA) {
   35|  2.08M|  int h;
   36|       |
   37|  2.08M|  deleteKeys = deleteKeysA;
   38|  2.08M|  size = 7;
   39|  2.08M|  tab = (GHashBucket **)gmallocn(size, sizeof(GHashBucket *));
   40|  16.6M|  for (h = 0; h < size; ++h) {
  ------------------
  |  Branch (40:15): [True: 14.5M, False: 2.08M]
  ------------------
   41|       |    tab[h] = NULL;
   42|  14.5M|  }
   43|  2.08M|  len = 0;
   44|  2.08M|}
_ZN5GHashD2Ev:
   46|  2.08M|GHash::~GHash() {
   47|  2.08M|  GHashBucket *p;
   48|  2.08M|  int h;
   49|       |
   50|  16.7M|  for (h = 0; h < size; ++h) {
  ------------------
  |  Branch (50:15): [True: 14.6M, False: 2.08M]
  ------------------
   51|  14.9M|    while (tab[h]) {
  ------------------
  |  Branch (51:12): [True: 352k, False: 14.6M]
  ------------------
   52|   352k|      p = tab[h];
   53|   352k|      tab[h] = p->next;
   54|   352k|      if (deleteKeys) {
  ------------------
  |  Branch (54:11): [True: 16.5k, False: 335k]
  ------------------
   55|  16.5k|	delete p->key;
   56|  16.5k|      }
   57|   352k|      delete p;
   58|   352k|    }
   59|  14.6M|  }
   60|  2.08M|  gfree(tab);
   61|  2.08M|}
_ZN5GHash3addEP7GStringPv:
   63|   306k|void GHash::add(GString *key, void *val) {
   64|   306k|  GHashBucket *p;
   65|   306k|  int h;
   66|       |
   67|       |  // expand the table if necessary
   68|   306k|  if (len >= size) {
  ------------------
  |  Branch (68:7): [True: 1.07k, False: 305k]
  ------------------
   69|  1.07k|    expand();
   70|  1.07k|  }
   71|       |
   72|       |  // add the new symbol
   73|   306k|  p = new GHashBucket;
   74|   306k|  p->key = key;
   75|   306k|  p->val.p = val;
   76|   306k|  h = hash(key);
   77|   306k|  p->next = tab[h];
   78|   306k|  tab[h] = p;
   79|   306k|  ++len;
   80|   306k|}
_ZN5GHash3addEP7GStringi:
   82|  46.1k|void GHash::add(GString *key, int val) {
   83|  46.1k|  GHashBucket *p;
   84|  46.1k|  int h;
   85|       |
   86|       |  // expand the table if necessary
   87|  46.1k|  if (len >= size) {
  ------------------
  |  Branch (87:7): [True: 638, False: 45.5k]
  ------------------
   88|    638|    expand();
   89|    638|  }
   90|       |
   91|       |  // add the new symbol
   92|  46.1k|  p = new GHashBucket;
   93|  46.1k|  p->key = key;
   94|  46.1k|  p->val.i = val;
   95|  46.1k|  h = hash(key);
   96|  46.1k|  p->next = tab[h];
   97|  46.1k|  tab[h] = p;
   98|  46.1k|  ++len;
   99|  46.1k|}
_ZN5GHash7replaceEP7GStringi:
  115|  62.5k|void GHash::replace(GString *key, int val) {
  116|  62.5k|  GHashBucket *p;
  117|  62.5k|  int h;
  118|       |
  119|  62.5k|  if ((p = find(key, &h))) {
  ------------------
  |  Branch (119:7): [True: 16.4k, False: 46.1k]
  ------------------
  120|  16.4k|    p->val.i = val;
  121|  16.4k|    if (deleteKeys) {
  ------------------
  |  Branch (121:9): [True: 0, False: 16.4k]
  ------------------
  122|      0|      delete key;
  123|      0|    }
  124|  46.1k|  } else {
  125|  46.1k|    add(key, val);
  126|  46.1k|  }
  127|  62.5k|}
_ZN5GHash6lookupEP7GString:
  129|  7.76k|void *GHash::lookup(GString *key) {
  130|  7.76k|  GHashBucket *p;
  131|  7.76k|  int h;
  132|       |
  133|  7.76k|  if (!(p = find(key, &h))) {
  ------------------
  |  Branch (133:7): [True: 7.75k, False: 12]
  ------------------
  134|  7.75k|    return NULL;
  135|  7.75k|  }
  136|     12|  return p->val.p;
  137|  7.76k|}
_ZN5GHash9lookupIntEP7GString:
  139|  62.5k|int GHash::lookupInt(GString *key) {
  140|  62.5k|  GHashBucket *p;
  141|  62.5k|  int h;
  142|       |
  143|  62.5k|  if (!(p = find(key, &h))) {
  ------------------
  |  Branch (143:7): [True: 46.1k, False: 16.4k]
  ------------------
  144|  46.1k|    return 0;
  145|  46.1k|  }
  146|  16.4k|  return p->val.i;
  147|  62.5k|}
_ZN5GHash6lookupEPKc:
  149|  1.50M|void *GHash::lookup(const char *key) {
  150|  1.50M|  GHashBucket *p;
  151|  1.50M|  int h;
  152|       |
  153|  1.50M|  if (!(p = find(key, &h))) {
  ------------------
  |  Branch (153:7): [True: 1.43M, False: 64.0k]
  ------------------
  154|  1.43M|    return NULL;
  155|  1.43M|  }
  156|  64.0k|  return p->val.p;
  157|  1.50M|}
_ZN5GHash9startIterEPP9GHashIter:
  261|  2.00M|void GHash::startIter(GHashIter **iter) {
  262|  2.00M|  *iter = new GHashIter;
  263|  2.00M|  (*iter)->h = -1;
  264|       |  (*iter)->p = NULL;
  265|  2.00M|}
_ZN5GHash7getNextEPP9GHashIterPP7GStringPPv:
  267|  2.31M|GBool GHash::getNext(GHashIter **iter, GString **key, void **val) {
  268|  2.31M|  if (!*iter) {
  ------------------
  |  Branch (268:7): [True: 0, False: 2.31M]
  ------------------
  269|      0|    return gFalse;
  ------------------
  |  |   18|      0|#define gFalse 0
  ------------------
  270|      0|  }
  271|  2.31M|  if ((*iter)->p) {
  ------------------
  |  Branch (271:7): [True: 306k, False: 2.00M]
  ------------------
  272|   306k|    (*iter)->p = (*iter)->p->next;
  273|   306k|  }
  274|  16.3M|  while (!(*iter)->p) {
  ------------------
  |  Branch (274:10): [True: 16.0M, False: 306k]
  ------------------
  275|  16.0M|    if (++(*iter)->h == size) {
  ------------------
  |  Branch (275:9): [True: 2.00M, False: 14.0M]
  ------------------
  276|  2.00M|      delete *iter;
  277|  2.00M|      *iter = NULL;
  278|  2.00M|      return gFalse;
  ------------------
  |  |   18|  2.00M|#define gFalse 0
  ------------------
  279|  2.00M|    }
  280|  14.0M|    (*iter)->p = tab[(*iter)->h];
  281|  14.0M|  }
  282|   306k|  *key = (*iter)->p->key;
  283|   306k|  *val = (*iter)->p->val.p;
  284|   306k|  return gTrue;
  ------------------
  |  |   17|   306k|#define gTrue 1
  ------------------
  285|  2.31M|}
_ZN5GHash6expandEv:
  312|  1.71k|void GHash::expand() {
  313|  1.71k|  GHashBucket **oldTab;
  314|  1.71k|  GHashBucket *p;
  315|  1.71k|  int oldSize, h, i;
  316|       |
  317|  1.71k|  oldSize = size;
  318|  1.71k|  oldTab = tab;
  319|  1.71k|  size = 2*size + 1;
  320|  1.71k|  tab = (GHashBucket **)gmallocn(size, sizeof(GHashBucket *));
  321|  54.0k|  for (h = 0; h < size; ++h) {
  ------------------
  |  Branch (321:15): [True: 52.3k, False: 1.71k]
  ------------------
  322|  52.3k|    tab[h] = NULL;
  323|  52.3k|  }
  324|  27.0k|  for (i = 0; i < oldSize; ++i) {
  ------------------
  |  Branch (324:15): [True: 25.2k, False: 1.71k]
  ------------------
  325|  50.5k|    while (oldTab[i]) {
  ------------------
  |  Branch (325:12): [True: 25.2k, False: 25.2k]
  ------------------
  326|  25.2k|      p = oldTab[i];
  327|  25.2k|      oldTab[i] = oldTab[i]->next;
  328|  25.2k|      h = hash(p->key);
  329|  25.2k|      p->next = tab[h];
  330|  25.2k|      tab[h] = p;
  331|  25.2k|    }
  332|  25.2k|  }
  333|  1.71k|  gfree(oldTab);
  334|  1.71k|}
_ZN5GHash4findEP7GStringPi:
  336|   132k|GHashBucket *GHash::find(GString *key, int *h) {
  337|   132k|  GHashBucket *p;
  338|       |
  339|   132k|  *h = hash(key);
  340|   152k|  for (p = tab[*h]; p; p = p->next) {
  ------------------
  |  Branch (340:21): [True: 52.4k, False: 100k]
  ------------------
  341|  52.4k|    if (!p->key->cmp(key)) {
  ------------------
  |  Branch (341:9): [True: 32.8k, False: 19.5k]
  ------------------
  342|  32.8k|      return p;
  343|  32.8k|    }
  344|  52.4k|  }
  345|   100k|  return NULL;
  346|   132k|}
_ZN5GHash4findEPKcPi:
  348|  1.50M|GHashBucket *GHash::find(const char *key, int *h) {
  349|  1.50M|  GHashBucket *p;
  350|       |
  351|  1.50M|  *h = hash(key);
  352|  1.51M|  for (p = tab[*h]; p; p = p->next) {
  ------------------
  |  Branch (352:21): [True: 80.5k, False: 1.43M]
  ------------------
  353|  80.5k|    if (!p->key->cmp(key)) {
  ------------------
  |  Branch (353:9): [True: 64.0k, False: 16.4k]
  ------------------
  354|  64.0k|      return p;
  355|  64.0k|    }
  356|  80.5k|  }
  357|  1.43M|  return NULL;
  358|  1.50M|}
_ZN5GHash4hashEP7GString:
  360|   510k|int GHash::hash(GString *key) {
  361|   510k|  const char *p;
  362|   510k|  unsigned int h;
  363|   510k|  int i;
  364|       |
  365|   510k|  h = 0;
  366|   197M|  for (p = key->getCString(), i = 0; i < key->getLength(); ++p, ++i) {
  ------------------
  |  Branch (366:38): [True: 196M, False: 510k]
  ------------------
  367|   196M|    h = 17 * h + (int)(*p & 0xff);
  368|   196M|  }
  369|   510k|  return (int)(h % size);
  370|   510k|}
_ZN5GHash4hashEPKc:
  372|  1.50M|int GHash::hash(const char *key) {
  373|  1.50M|  const char *p;
  374|  1.50M|  unsigned int h;
  375|       |
  376|  1.50M|  h = 0;
  377|  14.0M|  for (p = key; *p; ++p) {
  ------------------
  |  Branch (377:17): [True: 12.5M, False: 1.50M]
  ------------------
  378|  12.5M|    h = 17 * h + (int)(*p & 0xff);
  379|  12.5M|  }
  380|  1.50M|  return (int)(h % size);
  381|  1.50M|}

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

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

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

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

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

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

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

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

_ZN8AcroForm4loadEP6PDFDocP7CatalogP6Object:
  337|  3.71k|AcroForm *AcroForm::load(PDFDoc *docA, Catalog *catalog, Object *acroFormObjA) {
  338|  3.71k|  Object acroFormObj2;
  339|  3.71k|  AcroForm *acroForm;
  340|  3.71k|  AcroFormField *field;
  341|  3.71k|  Object xfaObj, fieldsObj, annotsObj, annotRef, annotObj, obj1, obj2;
  342|  3.71k|  char *touchedObjs;
  343|  3.71k|  int pageNum, i, j;
  344|       |
  345|  3.71k|  touchedObjs = (char *)gmalloc(docA->getXRef()->getNumObjects());
  346|  3.71k|  memset(touchedObjs, 0, docA->getXRef()->getNumObjects());
  347|       |
  348|       |  // this is the normal case: acroFormObj is a dictionary, as expected
  349|  3.71k|  if (acroFormObjA->isDict()) {
  ------------------
  |  Branch (349:7): [True: 1.86k, False: 1.85k]
  ------------------
  350|  1.86k|    acroForm = new AcroForm(docA, acroFormObjA);
  351|       |
  352|  1.86k|    if (globalParams->getEnableXFA()) {
  ------------------
  |  Branch (352:9): [True: 1.86k, False: 0]
  ------------------
  353|  1.86k|      if (!acroFormObjA->dictLookup("XFA", &xfaObj)->isNull()) {
  ------------------
  |  Branch (353:11): [True: 1.55k, False: 308]
  ------------------
  354|  1.55k|	acroForm->xfaScanner = XFAScanner::load(&xfaObj);
  355|  1.55k|	if (!catalog->getNeedsRendering()) {
  ------------------
  |  Branch (355:6): [True: 1.54k, False: 8]
  ------------------
  356|  1.54k|	  acroForm->isStaticXFA = gTrue;
  ------------------
  |  |   17|  1.54k|#define gTrue 1
  ------------------
  357|  1.54k|	}
  358|  1.55k|      }
  359|  1.86k|      xfaObj.free();
  360|  1.86k|    }
  361|       |
  362|  1.86k|    if (acroFormObjA->dictLookup("NeedAppearances", &obj1)->isBool()) {
  ------------------
  |  Branch (362:9): [True: 50, False: 1.81k]
  ------------------
  363|     50|      acroForm->needAppearances = obj1.getBool();
  364|     50|    }
  365|  1.86k|    obj1.free();
  366|       |
  367|  1.86k|    acroForm->buildAnnotPageList(catalog);
  368|       |
  369|  1.86k|    if (!acroFormObjA->dictLookup("Fields", &obj1)->isArray()) {
  ------------------
  |  Branch (369:9): [True: 12, False: 1.85k]
  ------------------
  370|     12|      if (!obj1.isNull()) {
  ------------------
  |  Branch (370:11): [True: 1, False: 11]
  ------------------
  371|      1|	error(errSyntaxError, -1, "AcroForm Fields entry is wrong type");
  372|      1|      }
  373|     12|      obj1.free();
  374|     12|      delete acroForm;
  375|     12|      gfree(touchedObjs);
  376|     12|      return NULL;
  377|     12|    }
  378|  44.1k|    for (i = 0; i < obj1.arrayGetLength(); ++i) {
  ------------------
  |  Branch (378:17): [True: 42.3k, False: 1.85k]
  ------------------
  379|  42.3k|      obj1.arrayGetNF(i, &obj2);
  380|  42.3k|      acroForm->scanField(&obj2, touchedObjs);
  381|  42.3k|      obj2.free();
  382|  42.3k|    }
  383|  1.85k|    obj1.free();
  384|       |
  385|       |    // scan the annotations, looking for Widget-type annots that are
  386|       |    // not attached to the AcroForm object
  387|   135k|    for (pageNum = 1; pageNum <= catalog->getNumPages(); ++pageNum) {
  ------------------
  |  Branch (387:23): [True: 133k, False: 1.85k]
  ------------------
  388|   133k|      if (catalog->getPage(pageNum)->getAnnots(&annotsObj)->isArray()) {
  ------------------
  |  Branch (388:11): [True: 106k, False: 26.7k]
  ------------------
  389|  3.41M|	for (i = 0; i < annotsObj.arrayGetLength(); ++i) {
  ------------------
  |  Branch (389:14): [True: 3.30M, False: 106k]
  ------------------
  390|  3.30M|	  if (annotsObj.arrayGetNF(i, &annotRef)->isRef()) {
  ------------------
  |  Branch (390:8): [True: 840k, False: 2.46M]
  ------------------
  391|  1.05M|	    for (j = 0; j < acroForm->fields->getLength(); ++j) {
  ------------------
  |  Branch (391:18): [True: 308k, False: 749k]
  ------------------
  392|   308k|	      field = (AcroFormField *)acroForm->fields->get(j);
  393|   308k|	      if (field->fieldRef.isRef()) {
  ------------------
  |  Branch (393:12): [True: 256k, False: 52.0k]
  ------------------
  394|   256k|		if (field->fieldRef.getRefNum() == annotRef.getRefNum() &&
  ------------------
  |  Branch (394:7): [True: 121k, False: 135k]
  ------------------
  395|   121k|		    field->fieldRef.getRefGen() == annotRef.getRefGen()) {
  ------------------
  |  Branch (395:7): [True: 90.7k, False: 30.2k]
  ------------------
  396|  90.7k|		  break;
  397|  90.7k|		}
  398|   256k|	      }
  399|   308k|	    }
  400|   840k|	    if (j == acroForm->fields->getLength()) {
  ------------------
  |  Branch (400:10): [True: 749k, False: 90.7k]
  ------------------
  401|   749k|	      annotRef.fetch(acroForm->doc->getXRef(), &annotObj);
  402|   749k|	      if (annotObj.isDict()) {
  ------------------
  |  Branch (402:12): [True: 158k, False: 591k]
  ------------------
  403|   158k|		if (annotObj.dictLookup("Subtype", &obj1)->isName("Widget")) {
  ------------------
  |  Branch (403:7): [True: 57.8k, False: 100k]
  ------------------
  404|  57.8k|		  acroForm->scanField(&annotRef, touchedObjs);
  405|  57.8k|		}
  406|   158k|		obj1.free();
  407|   158k|	      }
  408|   749k|	      annotObj.free();
  409|   749k|	    }
  410|   840k|	  }
  411|  3.30M|	  annotRef.free();
  412|  3.30M|	}
  413|   106k|      }
  414|   133k|      annotsObj.free();
  415|   133k|    }
  416|       |
  417|       |  // if acroFormObjA is a null object, but there are Widget-type
  418|       |  // annots, we still create an AcroForm
  419|  1.85k|  } else {
  420|       |    // create an empty dict for acroFormObj
  421|  1.85k|    acroFormObj2.initDict(docA->getXRef());
  422|  1.85k|    acroForm = new AcroForm(docA, &acroFormObj2);
  423|  1.85k|    acroFormObj2.free();
  424|       |
  425|  1.85k|    acroForm->buildAnnotPageList(catalog);
  426|       |
  427|       |    // scan the annotations, looking for any Widget-type annots
  428|   189k|    for (pageNum = 1; pageNum <= catalog->getNumPages(); ++pageNum) {
  ------------------
  |  Branch (428:23): [True: 187k, False: 1.85k]
  ------------------
  429|   187k|      if (catalog->getPage(pageNum)->getAnnots(&annotsObj)->isArray()) {
  ------------------
  |  Branch (429:11): [True: 13.1k, False: 174k]
  ------------------
  430|   342k|	for (i = 0; i < annotsObj.arrayGetLength(); ++i) {
  ------------------
  |  Branch (430:14): [True: 329k, False: 13.1k]
  ------------------
  431|   329k|	  if (annotsObj.arrayGetNF(i, &annotRef)->isRef()) {
  ------------------
  |  Branch (431:8): [True: 71.9k, False: 257k]
  ------------------
  432|  71.9k|	    annotRef.fetch(acroForm->doc->getXRef(), &annotObj);
  433|  71.9k|	    if (annotObj.isDict()) {
  ------------------
  |  Branch (433:10): [True: 35.0k, False: 36.9k]
  ------------------
  434|  35.0k|	      if (annotObj.dictLookup("Subtype", &obj1)->isName("Widget")) {
  ------------------
  |  Branch (434:12): [True: 22.3k, False: 12.7k]
  ------------------
  435|  22.3k|		acroForm->scanField(&annotRef, touchedObjs);
  436|  22.3k|	      }
  437|  35.0k|	      obj1.free();
  438|  35.0k|	    }
  439|  71.9k|	    annotObj.free();
  440|  71.9k|	  }
  441|   329k|	  annotRef.free();
  442|   329k|	}
  443|  13.1k|      }
  444|   187k|      annotsObj.free();
  445|   187k|    }
  446|       |
  447|  1.85k|    if (acroForm->fields->getLength() == 0) {
  ------------------
  |  Branch (447:9): [True: 1.83k, False: 21]
  ------------------
  448|  1.83k|      delete acroForm;
  449|  1.83k|      acroForm = NULL;
  450|  1.83k|    }
  451|  1.85k|  }
  452|       |
  453|  3.70k|  gfree(touchedObjs);
  454|       |
  455|  3.70k|  return acroForm;
  456|  3.71k|}
_ZN8AcroFormC2EP6PDFDocP6Object:
  458|  3.71k|AcroForm::AcroForm(PDFDoc *docA, Object *acroFormObjA) {
  459|  3.71k|  doc = docA;
  460|  3.71k|  acroFormObjA->copy(&acroFormObj);
  461|  3.71k|  needAppearances = gFalse;
  ------------------
  |  |   18|  3.71k|#define gFalse 0
  ------------------
  462|  3.71k|  annotPages = new GList();
  463|  3.71k|  fields = new GList();
  464|  3.71k|  xfaScanner = NULL;
  465|  3.71k|  isStaticXFA = gFalse;
  ------------------
  |  |   18|  3.71k|#define gFalse 0
  ------------------
  466|  3.71k|}
_ZN8AcroFormD2Ev:
  468|  3.71k|AcroForm::~AcroForm() {
  469|  3.71k|  acroFormObj.free();
  470|  3.71k|  deleteGList(annotPages, AcroFormAnnotPage);
  ------------------
  |  |   94|  3.71k|  do {                                              \
  |  |   95|  3.71k|    GList *_list = (list);                          \
  |  |   96|  3.71k|    {                                               \
  |  |   97|  3.71k|      int _i;                                       \
  |  |   98|   916k|      for (_i = 0; _i < _list->getLength(); ++_i) { \
  |  |  ------------------
  |  |  |  Branch (98:20): [True: 912k, False: 3.71k]
  |  |  ------------------
  |  |   99|   912k|        delete (T*)_list->get(_i);                  \
  |  |  100|   912k|      }                                             \
  |  |  101|  3.71k|      delete _list;                                 \
  |  |  102|  3.71k|    }                                               \
  |  |  103|  3.71k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (103:12): [Folded, False: 3.71k]
  |  |  ------------------
  ------------------
  471|  3.71k|  deleteGList(fields, AcroFormField);
  ------------------
  |  |   94|  3.71k|  do {                                              \
  |  |   95|  3.71k|    GList *_list = (list);                          \
  |  |   96|  3.71k|    {                                               \
  |  |   97|  3.71k|      int _i;                                       \
  |  |   98|  6.53k|      for (_i = 0; _i < _list->getLength(); ++_i) { \
  |  |  ------------------
  |  |  |  Branch (98:20): [True: 2.82k, False: 3.71k]
  |  |  ------------------
  |  |   99|  2.82k|        delete (T*)_list->get(_i);                  \
  |  |  100|  2.82k|      }                                             \
  |  |  101|  3.71k|      delete _list;                                 \
  |  |  102|  3.71k|    }                                               \
  |  |  103|  3.71k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (103:12): [Folded, False: 3.71k]
  |  |  ------------------
  ------------------
  472|  3.71k|  delete xfaScanner;
  473|  3.71k|}
_ZN8AcroForm18buildAnnotPageListEP7Catalog:
  479|  3.71k|void AcroForm::buildAnnotPageList(Catalog *catalog) {
  480|  3.71k|  Object annotsObj, annotObj;
  481|  3.71k|  int pageNum, i;
  482|       |
  483|   324k|  for (pageNum = 1; pageNum <= catalog->getNumPages(); ++pageNum) {
  ------------------
  |  Branch (483:21): [True: 321k, False: 3.71k]
  ------------------
  484|   321k|    if (catalog->getPage(pageNum)->getAnnots(&annotsObj)->isArray()) {
  ------------------
  |  Branch (484:9): [True: 119k, False: 201k]
  ------------------
  485|  3.75M|      for (i = 0; i < annotsObj.arrayGetLength(); ++i) {
  ------------------
  |  Branch (485:19): [True: 3.63M, False: 119k]
  ------------------
  486|  3.63M|	if (annotsObj.arrayGetNF(i, &annotObj)->isRef()) {
  ------------------
  |  Branch (486:6): [True: 912k, False: 2.72M]
  ------------------
  487|   912k|	  annotPages->append(new AcroFormAnnotPage(annotObj.getRefNum(),
  488|   912k|						   annotObj.getRefGen(),
  489|   912k|						   pageNum));
  490|   912k|	}
  491|  3.63M|	annotObj.free();
  492|  3.63M|      }
  493|   119k|    }
  494|   321k|    annotsObj.free();
  495|   321k|  }
  496|       |  //~ sort the list
  497|  3.71k|}
_ZN8AcroForm9scanFieldEP6ObjectPc:
  518|   126k|void AcroForm::scanField(Object *fieldRef, char *touchedObjs) {
  519|   126k|  AcroFormField *field;
  520|   126k|  Object fieldObj, kidsRef, kidsObj, kidRef, kidObj, subtypeObj;
  521|   126k|  GBool isTerminal;
  522|   126k|  int i;
  523|       |
  524|       |  // check for an object loop
  525|   126k|  if (fieldRef->isRef()) {
  ------------------
  |  Branch (525:7): [True: 87.7k, False: 38.6k]
  ------------------
  526|  87.7k|    if (fieldRef->getRefNum() < 0 ||
  ------------------
  |  Branch (526:9): [True: 0, False: 87.7k]
  ------------------
  527|  87.7k|	fieldRef->getRefNum() >= doc->getXRef()->getNumObjects() ||
  ------------------
  |  Branch (527:2): [True: 684, False: 87.0k]
  ------------------
  528|  87.0k|	touchedObjs[fieldRef->getRefNum()]) {
  ------------------
  |  Branch (528:2): [True: 80.9k, False: 6.05k]
  ------------------
  529|  81.6k|      return;
  530|  81.6k|    }
  531|  6.05k|    touchedObjs[fieldRef->getRefNum()] = 1;
  532|  6.05k|  }
  533|       |
  534|  44.6k|  fieldRef->fetch(doc->getXRef(), &fieldObj);
  535|  44.6k|  if (!fieldObj.isDict()) {
  ------------------
  |  Branch (535:7): [True: 39.5k, False: 5.16k]
  ------------------
  536|  39.5k|    error(errSyntaxError, -1, "AcroForm field object is wrong type");
  537|  39.5k|    fieldObj.free();
  538|  39.5k|    return;
  539|  39.5k|  }
  540|       |
  541|       |  // look for a Kids entry, and check for an object loop there
  542|  5.16k|  if (fieldObj.dictLookupNF("Kids", &kidsRef)->isRef()) {
  ------------------
  |  Branch (542:7): [True: 183, False: 4.97k]
  ------------------
  543|    183|    if (kidsRef.getRefNum() < 0 ||
  ------------------
  |  Branch (543:9): [True: 0, False: 183]
  ------------------
  544|    183|	kidsRef.getRefNum() >= doc->getXRef()->getNumObjects() ||
  ------------------
  |  Branch (544:2): [True: 95, False: 88]
  ------------------
  545|    168|	touchedObjs[kidsRef.getRefNum()]) {
  ------------------
  |  Branch (545:2): [True: 73, False: 15]
  ------------------
  546|    168|      kidsRef.free();
  547|    168|      fieldObj.free();
  548|    168|      return;
  549|    168|    }
  550|     15|    touchedObjs[kidsRef.getRefNum()] = 1;
  551|     15|    kidsRef.fetch(doc->getXRef(), &kidsObj);
  552|  4.97k|  } else {
  553|  4.97k|    kidsRef.copy(&kidsObj);
  554|  4.97k|  }
  555|  4.99k|  kidsRef.free();
  556|       |
  557|       |  // if this field has a Kids array, and all of the kids have a Parent
  558|       |  // reference (i.e., they're all form fields, not widget
  559|       |  // annotations), then this is a non-terminal field, and we need to
  560|       |  // scan the kids
  561|  4.99k|  isTerminal = gTrue;
  ------------------
  |  |   17|  4.99k|#define gTrue 1
  ------------------
  562|  4.99k|  if (kidsObj.isArray()) {
  ------------------
  |  Branch (562:7): [True: 422, False: 4.57k]
  ------------------
  563|    422|    isTerminal = gFalse;
  ------------------
  |  |   18|    422|#define gFalse 0
  ------------------
  564|  7.40k|    for (i = 0; !isTerminal && i < kidsObj.arrayGetLength(); ++i) {
  ------------------
  |  Branch (564:17): [True: 7.28k, False: 119]
  |  Branch (564:32): [True: 6.98k, False: 303]
  ------------------
  565|  6.98k|      kidsObj.arrayGet(i, &kidObj);
  566|  6.98k|      if (kidObj.isDict()) {
  ------------------
  |  Branch (566:11): [True: 936, False: 6.04k]
  ------------------
  567|    936|	if (kidObj.dictLookup("Parent", &subtypeObj)->isNull()) {
  ------------------
  |  Branch (567:6): [True: 119, False: 817]
  ------------------
  568|    119|	  isTerminal = gTrue;
  ------------------
  |  |   17|    119|#define gTrue 1
  ------------------
  569|    119|	}
  570|    936|	subtypeObj.free();
  571|    936|      }
  572|  6.98k|      kidObj.free();
  573|  6.98k|    }
  574|    422|    if (!isTerminal) {
  ------------------
  |  Branch (574:9): [True: 303, False: 119]
  ------------------
  575|  4.12k|      for (i = 0; !isTerminal && i < kidsObj.arrayGetLength(); ++i) {
  ------------------
  |  Branch (575:19): [True: 4.12k, False: 0]
  |  Branch (575:34): [True: 3.82k, False: 303]
  ------------------
  576|  3.82k|	kidsObj.arrayGetNF(i, &kidRef);
  577|  3.82k|	scanField(&kidRef, touchedObjs);
  578|  3.82k|	kidRef.free();
  579|  3.82k|      }
  580|    303|    }
  581|    422|  }
  582|  4.99k|  kidsObj.free();
  583|       |
  584|  4.99k|  if (isTerminal) {
  ------------------
  |  Branch (584:7): [True: 4.69k, False: 303]
  ------------------
  585|  4.69k|    if ((field = AcroFormField::load(this, fieldRef))) {
  ------------------
  |  Branch (585:9): [True: 2.82k, False: 1.87k]
  ------------------
  586|  2.82k|      fields->append(field);
  587|  2.82k|    }
  588|  4.69k|  }
  589|       |
  590|  4.99k|  fieldObj.free();
  591|  4.99k|}
_ZN13AcroFormField4loadEP8AcroFormP6Object:
  647|  4.69k|AcroFormField *AcroFormField::load(AcroForm *acroFormA, Object *fieldRefA) {
  648|  4.69k|  GString *typeStr;
  649|  4.69k|  TextString *nameA;
  650|  4.69k|  GString *xfaName;
  651|  4.69k|  Guint flagsA;
  652|  4.69k|  GBool haveFlags, typeFromParentA;
  653|  4.69k|  Object fieldObjA, parentObj, parentObj2, obj1, obj2;
  654|  4.69k|  AcroFormFieldType typeA;
  655|  4.69k|  XFAField *xfaFieldA;
  656|  4.69k|  AcroFormField *field;
  657|  4.69k|  int depth, i0, i1;
  658|       |
  659|  4.69k|  fieldRefA->fetch(acroFormA->doc->getXRef(), &fieldObjA);
  660|       |
  661|       |  //----- get field info
  662|       |
  663|  4.69k|  if (fieldObjA.dictLookup("T", &obj1)->isString()) {
  ------------------
  |  Branch (663:7): [True: 2.79k, False: 1.89k]
  ------------------
  664|  2.79k|    nameA = new TextString(obj1.getString());
  665|  2.79k|  } else {
  666|  1.89k|    nameA = new TextString();
  667|  1.89k|  }
  668|  4.69k|  obj1.free();
  669|       |
  670|  4.69k|  if (fieldObjA.dictLookup("FT", &obj1)->isName()) {
  ------------------
  |  Branch (670:7): [True: 2.63k, False: 2.05k]
  ------------------
  671|  2.63k|    typeStr = new GString(obj1.getName());
  672|  2.63k|    typeFromParentA = gFalse;
  ------------------
  |  |   18|  2.63k|#define gFalse 0
  ------------------
  673|  2.63k|  } else {
  674|  2.05k|    typeStr = NULL;
  675|  2.05k|    typeFromParentA = gTrue;
  ------------------
  |  |   17|  2.05k|#define gTrue 1
  ------------------
  676|  2.05k|  }
  677|  4.69k|  obj1.free();
  678|       |
  679|  4.69k|  if (fieldObjA.dictLookup("Ff", &obj1)->isInt()) {
  ------------------
  |  Branch (679:7): [True: 1.90k, False: 2.78k]
  ------------------
  680|  1.90k|    flagsA = (Guint)obj1.getInt();
  681|  1.90k|    haveFlags = gTrue;
  ------------------
  |  |   17|  1.90k|#define gTrue 1
  ------------------
  682|  2.78k|  } else {
  683|  2.78k|    flagsA = 0;
  684|  2.78k|    haveFlags = gFalse;
  ------------------
  |  |   18|  2.78k|#define gFalse 0
  ------------------
  685|  2.78k|  }
  686|  4.69k|  obj1.free();
  687|       |
  688|       |  //----- get info from parent non-terminal fields
  689|       |
  690|  4.69k|  fieldObjA.dictLookup("Parent", &parentObj);
  691|  4.69k|  depth = 0;
  692|  47.9k|  while (parentObj.isDict() && depth < maxFieldObjectDepth) {
  ------------------
  |  |   72|  44.0k|#define maxFieldObjectDepth 50
  ------------------
  |  Branch (692:10): [True: 44.0k, False: 3.86k]
  |  Branch (692:32): [True: 43.2k, False: 828]
  ------------------
  693|       |
  694|  43.2k|    if (parentObj.dictLookup("T", &obj1)->isString()) {
  ------------------
  |  Branch (694:9): [True: 42.3k, False: 812]
  ------------------
  695|  42.3k|      if (nameA->getLength()) {
  ------------------
  |  Branch (695:11): [True: 41.8k, False: 560]
  ------------------
  696|  41.8k|	nameA->insert(0, (Unicode)'.');
  697|  41.8k|      }
  698|  42.3k|      nameA->insert(0, obj1.getString());
  699|  42.3k|    }
  700|  43.2k|    obj1.free();
  701|       |
  702|  43.2k|    if (!typeStr) {
  ------------------
  |  Branch (702:9): [True: 6.38k, False: 36.8k]
  ------------------
  703|  6.38k|      if (parentObj.dictLookup("FT", &obj1)->isName()) {
  ------------------
  |  Branch (703:11): [True: 298, False: 6.08k]
  ------------------
  704|    298|	typeStr = new GString(obj1.getName());
  705|    298|      }
  706|  6.38k|      obj1.free();
  707|  6.38k|    }
  708|       |
  709|  43.2k|    if (!haveFlags) {
  ------------------
  |  Branch (709:9): [True: 8.90k, False: 34.3k]
  ------------------
  710|  8.90k|      if (parentObj.dictLookup("Ff", &obj1)->isInt()) {
  ------------------
  |  Branch (710:11): [True: 412, False: 8.49k]
  ------------------
  711|    412|	flagsA = (Guint)obj1.getInt();
  712|    412|	haveFlags = gTrue;
  ------------------
  |  |   17|    412|#define gTrue 1
  ------------------
  713|    412|      }
  714|  8.90k|      obj1.free();
  715|  8.90k|    }
  716|       |
  717|  43.2k|    parentObj.dictLookup("Parent", &parentObj2);
  718|  43.2k|    parentObj.free();
  719|  43.2k|    parentObj = parentObj2;
  720|       |
  721|  43.2k|    ++depth;
  722|  43.2k|  }
  723|  4.69k|  parentObj.free();
  724|       |
  725|  4.69k|  if (!typeStr) {
  ------------------
  |  Branch (725:7): [True: 1.75k, False: 2.93k]
  ------------------
  726|  1.75k|    error(errSyntaxError, -1, "Missing type in AcroForm field");
  727|  1.75k|    goto err1;
  728|  1.75k|  }
  729|       |
  730|       |  //----- get static XFA info
  731|       |
  732|  2.93k|  xfaFieldA = NULL;
  733|  2.93k|  if (acroFormA->xfaScanner) {
  ------------------
  |  Branch (733:7): [True: 163, False: 2.77k]
  ------------------
  734|       |    // convert field name to UTF-8, and remove segments that start
  735|       |    // with '#' -- to match the XFA field name
  736|    163|    xfaName = nameA->toUTF8();
  737|    163|    i0 = 0;
  738|  1.06k|    while (i0 < xfaName->getLength()) {
  ------------------
  |  Branch (738:12): [True: 905, False: 163]
  ------------------
  739|    905|      i1 = i0;
  740|  71.6k|      while (i1 < xfaName->getLength()) {
  ------------------
  |  Branch (740:14): [True: 71.5k, False: 123]
  ------------------
  741|  71.5k|	if (xfaName->getChar(i1) == '.') {
  ------------------
  |  Branch (741:6): [True: 782, False: 70.7k]
  ------------------
  742|    782|	  ++i1;
  743|    782|	  break;
  744|    782|	}
  745|  70.7k|	++i1;
  746|  70.7k|      }
  747|    905|      if (xfaName->getChar(i0) == '#') {
  ------------------
  |  Branch (747:11): [True: 320, False: 585]
  ------------------
  748|    320|	xfaName->del(i0, i1 - i0);
  749|    585|      } else {
  750|    585|	i0 = i1;
  751|    585|      }
  752|    905|    }
  753|    163|    xfaFieldA = acroFormA->xfaScanner->findField(xfaName);
  754|    163|    delete xfaName;
  755|    163|  }
  756|       |
  757|       |  //----- check for a radio button
  758|       |
  759|       |  // this is a kludge: if we see a Btn-type field with kids, and the
  760|       |  // Ff entry is missing, assume the kids are radio buttons
  761|  2.93k|  if (typeFromParentA && !typeStr->cmp("Btn") && !haveFlags) {
  ------------------
  |  Branch (761:7): [True: 298, False: 2.63k]
  |  Branch (761:26): [True: 111, False: 187]
  |  Branch (761:50): [True: 10, False: 101]
  ------------------
  762|     10|    flagsA = acroFormFlagRadio;
  ------------------
  |  |   40|     10|#define acroFormFlagRadio              (1 << 15)  // button
  ------------------
  763|     10|  }
  764|       |
  765|       |  //----- determine field type
  766|       |
  767|  2.93k|  if (!typeStr->cmp("Btn")) {
  ------------------
  |  Branch (767:7): [True: 696, False: 2.23k]
  ------------------
  768|    696|    if (flagsA & acroFormFlagPushbutton) {
  ------------------
  |  |   41|    696|#define acroFormFlagPushbutton         (1 << 16)  // button
  ------------------
  |  Branch (768:9): [True: 59, False: 637]
  ------------------
  769|     59|      typeA = acroFormFieldPushbutton;
  770|    637|    } else if (flagsA & acroFormFlagRadio) {
  ------------------
  |  |   40|    637|#define acroFormFlagRadio              (1 << 15)  // button
  ------------------
  |  Branch (770:16): [True: 115, False: 522]
  ------------------
  771|    115|      typeA = acroFormFieldRadioButton;
  772|    522|    } else {
  773|    522|      typeA = acroFormFieldCheckbox;
  774|    522|    }
  775|  2.23k|  } else if (!typeStr->cmp("Tx")) {
  ------------------
  |  Branch (775:14): [True: 2.09k, False: 143]
  ------------------
  776|  2.09k|    if (xfaFieldA && xfaFieldA->getBarcodeInfo()) {
  ------------------
  |  Branch (776:9): [True: 0, False: 2.09k]
  |  Branch (776:22): [True: 0, False: 0]
  ------------------
  777|      0|      typeA = acroFormFieldBarcode;
  778|  2.09k|    } else if (flagsA & acroFormFlagFileSelect) {
  ------------------
  |  |   45|  2.09k|#define acroFormFlagFileSelect         (1 << 20)  // text
  ------------------
  |  Branch (778:16): [True: 101, False: 1.99k]
  ------------------
  779|    101|      typeA = acroFormFieldFileSelect;
  780|  1.99k|    } else if (flagsA & acroFormFlagMultiline) {
  ------------------
  |  |   37|  1.99k|#define acroFormFlagMultiline          (1 << 12)  // text
  ------------------
  |  Branch (780:16): [True: 164, False: 1.82k]
  ------------------
  781|    164|      typeA = acroFormFieldMultilineText;
  782|  1.82k|    } else {
  783|  1.82k|      typeA = acroFormFieldText;
  784|  1.82k|    }
  785|  2.09k|  } else if (!typeStr->cmp("Ch")) {
  ------------------
  |  Branch (785:14): [True: 30, False: 113]
  ------------------
  786|     30|    if (flagsA & acroFormFlagCombo) {
  ------------------
  |  |   42|     30|#define acroFormFlagCombo              (1 << 17)  // choice
  ------------------
  |  Branch (786:9): [True: 10, False: 20]
  ------------------
  787|     10|      typeA = acroFormFieldComboBox;
  788|     20|    } else {
  789|     20|      typeA = acroFormFieldListBox;
  790|     20|    }
  791|    113|  } else if (!typeStr->cmp("Sig")) {
  ------------------
  |  Branch (791:14): [True: 0, False: 113]
  ------------------
  792|      0|    typeA = acroFormFieldSignature;
  793|    113|  } else {
  794|    113|    error(errSyntaxError, -1, "Invalid type in AcroForm field");
  795|    113|    goto err1;
  796|    113|  }
  797|  2.82k|  delete typeStr;
  798|       |
  799|  2.82k|  field = new AcroFormField(acroFormA, fieldRefA, &fieldObjA,
  800|  2.82k|			    typeA, nameA, flagsA, typeFromParentA, xfaFieldA);
  801|  2.82k|  fieldObjA.free();
  802|  2.82k|  return field;
  803|       |
  804|  1.87k| err1:
  805|  1.87k|  delete typeStr;
  806|  1.87k|  delete nameA;
  807|  1.87k|  fieldObjA.free();
  808|       |  return NULL;
  809|  2.93k|}
_ZN13AcroFormFieldC2EP8AcroFormP6ObjectS3_17AcroFormFieldTypeP10TextStringjiP8XFAField:
  815|  2.82k|			     XFAField *xfaFieldA) {
  816|  2.82k|  acroForm = acroFormA;
  817|  2.82k|  fieldRefA->copy(&fieldRef);
  818|  2.82k|  fieldObjA->copy(&fieldObj);
  819|  2.82k|  type = typeA;
  820|  2.82k|  name = nameA;
  821|  2.82k|  flags = flagsA;
  822|  2.82k|  typeFromParent = typeFromParentA;
  823|  2.82k|  xfaField = xfaFieldA;
  824|  2.82k|}
_ZN13AcroFormFieldD2Ev:
  826|  2.82k|AcroFormField::~AcroFormField() {
  827|  2.82k|  fieldRef.free();
  828|  2.82k|  fieldObj.free();
  829|  2.82k|  delete name;
  830|  2.82k|}
_ZN17AcroFormAnnotPageC2Eiii:
  327|   912k|    { annotNum = annotNumA; annotGen = annotGenA; pageNum = pageNumA; }

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

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

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

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

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

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

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

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

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

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

_ZN4DictC2EP4XRef:
   31|   839k|Dict::Dict(XRef *xrefA) {
   32|   839k|  xref = xrefA;
   33|   839k|  size = 8;
   34|   839k|  length = 0;
   35|   839k|  entries = (DictEntry *)gmallocn(size, sizeof(DictEntry));
   36|   839k|  hashTab = (DictEntry **)gmallocn(2 * size - 1, sizeof(DictEntry *));
   37|   839k|  memset(hashTab, 0, (2 * size - 1) * sizeof(DictEntry *));
   38|   839k|  ref = 1;
   39|   839k|}
_ZN4DictD2Ev:
   41|   838k|Dict::~Dict() {
   42|   838k|  int i;
   43|       |
   44|  3.33M|  for (i = 0; i < length; ++i) {
  ------------------
  |  Branch (44:15): [True: 2.49M, False: 838k]
  ------------------
   45|  2.49M|    gfree(entries[i].key);
   46|  2.49M|    entries[i].val.free();
   47|  2.49M|  }
   48|   838k|  gfree(entries);
   49|   838k|  gfree(hashTab);
   50|   838k|}
_ZN4Dict3addEPcP6Object:
   52|  3.16M|void Dict::add(char *key, Object *val) {
   53|  3.16M|  DictEntry *e;
   54|  3.16M|  int h;
   55|       |
   56|  3.16M|  if ((e = find(key))) {
  ------------------
  |  Branch (56:7): [True: 669k, False: 2.49M]
  ------------------
   57|   669k|    e->val.free();
   58|   669k|    e->val = *val;
   59|   669k|    gfree(key);
   60|  2.49M|  } else {
   61|  2.49M|    if (length == size) {
  ------------------
  |  Branch (61:9): [True: 65.7k, False: 2.43M]
  ------------------
   62|  65.7k|      expand();
   63|  65.7k|    }
   64|  2.49M|    h = hash(key);
   65|  2.49M|    entries[length].key = key;
   66|  2.49M|    entries[length].val = *val;
   67|  2.49M|    entries[length].next = hashTab[h];
   68|  2.49M|    hashTab[h] = &entries[length];
   69|  2.49M|    ++length;
   70|  2.49M|  }
   71|  3.16M|}
_ZN4Dict6expandEv:
   73|  65.7k|void Dict::expand() {
   74|  65.7k|  int h, i;
   75|       |
   76|  65.7k|  size *= 2;
   77|  65.7k|  entries = (DictEntry *)greallocn(entries, size, sizeof(DictEntry));
   78|  65.7k|  hashTab = (DictEntry **)greallocn(hashTab, 2 * size - 1,
   79|  65.7k|				    sizeof(DictEntry *));
   80|  65.7k|  memset(hashTab, 0, (2 * size - 1) * sizeof(DictEntry *));
   81|   618k|  for (i = 0; i < length; ++i) {
  ------------------
  |  Branch (81:15): [True: 552k, False: 65.7k]
  ------------------
   82|   552k|    h = hash(entries[i].key);
   83|   552k|    entries[i].next = hashTab[h];
   84|   552k|    hashTab[h] = &entries[i];
   85|   552k|  }
   86|  65.7k|}
_ZN4Dict4hashEPKc:
  101|  13.6M|int Dict::hash(const char *key) {
  102|  13.6M|  const char *p;
  103|  13.6M|  unsigned int h;
  104|       |
  105|  13.6M|  h = 0;
  106|  93.9M|  for (p = key; *p; ++p) {
  ------------------
  |  Branch (106:17): [True: 80.2M, False: 13.6M]
  ------------------
  107|  80.2M|    h = 17 * h + (int)(*p & 0xff);
  108|  80.2M|  }
  109|  13.6M|  return (int)(h % (2 * size - 1));
  110|  13.6M|}
_ZN4Dict6lookupEPKcP6Objecti:
  118|  6.44M|Object *Dict::lookup(const char *key, Object *obj, int recursion) {
  119|  6.44M|  DictEntry *e;
  120|       |
  121|  6.44M|  return (e = find(key)) ? e->val.fetch(xref, obj, recursion)
  ------------------
  |  Branch (121:10): [True: 1.55M, False: 4.88M]
  ------------------
  122|  6.44M|                         : obj->initNull();
  123|  6.44M|}
_ZN4Dict8lookupNFEPKcP6Object:
  125|  1.01M|Object *Dict::lookupNF(const char *key, Object *obj) {
  126|  1.01M|  DictEntry *e;
  127|       |
  128|  1.01M|  return (e = find(key)) ? e->val.copy(obj) : obj->initNull();
  ------------------
  |  Branch (128:10): [True: 248k, False: 768k]
  ------------------
  129|  1.01M|}
_ZN4Dict6getKeyEi:
  131|  40.7k|char *Dict::getKey(int i) {
  132|  40.7k|  return entries[i].key;
  133|  40.7k|}
_ZN4Dict6getValEiP6Object:
  135|  24.9k|Object *Dict::getVal(int i, Object *obj) {
  136|  24.9k|  return entries[i].val.fetch(xref, obj);
  137|  24.9k|}
_ZN4Dict8getValNFEiP6Object:
  139|  15.7k|Object *Dict::getValNF(int i, Object *obj) {
  140|  15.7k|  return entries[i].val.copy(obj);
  141|  15.7k|}
_ZN4Dict4findEPKc:
   88|  10.6M|inline DictEntry *Dict::find(const char *key) {
   89|  10.6M|  DictEntry *e;
   90|  10.6M|  int h;
   91|       |
   92|  10.6M|  h = hash(key);
   93|  13.3M|  for (e = hashTab[h]; e; e = e->next) {
  ------------------
  |  Branch (93:24): [True: 5.23M, False: 8.15M]
  ------------------
   94|  5.23M|    if (!strcmp(key, e->key)) {
  ------------------
  |  Branch (94:9): [True: 2.47M, False: 2.76M]
  ------------------
   95|  2.47M|      return e;
   96|  2.47M|    }
   97|  5.23M|  }
   98|  8.15M|  return NULL;
   99|  10.6M|}

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

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

_ZN23JArithmeticDecoderStatsC2Ei:
   20|  5.12M|JArithmeticDecoderStats::JArithmeticDecoderStats(int contextSizeA) {
   21|  5.12M|  contextSize = contextSizeA;
   22|  5.12M|  cxTab = (Guchar *)gmallocn(contextSize, sizeof(Guchar));
   23|  5.12M|  reset();
   24|  5.12M|}
_ZN23JArithmeticDecoderStatsD2Ev:
   26|  5.10M|JArithmeticDecoderStats::~JArithmeticDecoderStats() {
   27|  5.10M|  gfree(cxTab);
   28|  5.10M|}
_ZN23JArithmeticDecoderStats4copyEv:
   30|  2.68k|JArithmeticDecoderStats *JArithmeticDecoderStats::copy() {
   31|  2.68k|  JArithmeticDecoderStats *stats;
   32|       |
   33|  2.68k|  stats = new JArithmeticDecoderStats(contextSize);
   34|  2.68k|  memcpy(stats->cxTab, cxTab, contextSize);
   35|  2.68k|  return stats;
   36|  2.68k|}
_ZN23JArithmeticDecoderStats5resetEv:
   38|  6.10M|void JArithmeticDecoderStats::reset() {
   39|  6.10M|  memset(cxTab, 0, contextSize);
   40|  6.10M|}
_ZN23JArithmeticDecoderStats8setEntryEjii:
   46|  3.36M|void JArithmeticDecoderStats::setEntry(Guint cx, int i, int mps) {
   47|  3.36M|  cxTab[cx] = (Guchar)((i << 1) + mps);
   48|  3.36M|}
_ZN18JArithmeticDecoderC2Ev:
   87|   541k|JArithmeticDecoder::JArithmeticDecoder() {
   88|   541k|  str = NULL;
   89|   541k|  dataLen = 0;
   90|   541k|  limitStream = gFalse;
  ------------------
  |  |   18|   541k|#define gFalse 0
  ------------------
   91|   541k|  nBytesRead = 0;
   92|   541k|  readBufNext = 0;
   93|   541k|  readBufLength = 0;
   94|   541k|}
_ZN18JArithmeticDecoderD2Ev:
  110|   540k|JArithmeticDecoder::~JArithmeticDecoder() {
  111|   540k|  cleanup();
  112|   540k|}
_ZN18JArithmeticDecoder5startEv:
  114|   611k|void JArithmeticDecoder::start() {
  115|   611k|  buf0 = readByte();
  116|   611k|  buf1 = readByte();
  117|       |
  118|       |  // INITDEC
  119|   611k|  c = (buf0 ^ 0xff) << 16;
  120|   611k|  byteIn();
  121|   611k|  c <<= 7;
  122|   611k|  ct -= 7;
  123|   611k|  a = 0x80000000;
  124|   611k|}
_ZN18JArithmeticDecoder7restartEi:
  126|  23.2k|void JArithmeticDecoder::restart(int dataLenA) {
  127|  23.2k|  Guint cAdd;
  128|  23.2k|  GBool prevFF;
  129|  23.2k|  int k, nBits;
  130|       |
  131|  23.2k|  if (dataLen >= 0) {
  ------------------
  |  Branch (131:7): [True: 16.1k, False: 7.05k]
  ------------------
  132|  16.1k|    dataLen = dataLenA;
  133|  16.1k|  } else if (dataLen == -1) {
  ------------------
  |  Branch (133:14): [True: 1.48k, False: 5.56k]
  ------------------
  134|  1.48k|    dataLen = dataLenA;
  135|  1.48k|    buf1 = readByte();
  136|  5.56k|  } else {
  137|  5.56k|    k = (-dataLen - 1) * 8 - ct;
  138|  5.56k|    dataLen = dataLenA;
  139|  5.56k|    cAdd = 0;
  140|  5.56k|    prevFF = gFalse;
  ------------------
  |  |   18|  5.56k|#define gFalse 0
  ------------------
  141|   671k|    while (k > 0) {
  ------------------
  |  Branch (141:12): [True: 665k, False: 5.56k]
  ------------------
  142|   665k|      buf0 = readByte();
  143|   665k|      if (prevFF) {
  ------------------
  |  Branch (143:11): [True: 639k, False: 26.7k]
  ------------------
  144|   639k|	cAdd += 0xfe00 - (buf0 << 9);
  145|   639k|	nBits = 7;
  146|   639k|      } else {
  147|  26.7k|	cAdd += 0xff00 - (buf0 << 8);
  148|  26.7k|	nBits = 8;
  149|  26.7k|      }
  150|   665k|      prevFF = buf0 == 0xff;
  151|   665k|      if (k > nBits) {
  ------------------
  |  Branch (151:11): [True: 660k, False: 5.56k]
  ------------------
  152|   660k|	cAdd <<= nBits;
  153|   660k|	k -= nBits;
  154|   660k|      } else {
  155|  5.56k|	cAdd <<= k;
  156|  5.56k|	ct = nBits - k;
  157|  5.56k|	k = 0;
  158|  5.56k|      }
  159|   665k|    }
  160|  5.56k|    c += cAdd;
  161|  5.56k|    buf1 = readByte();
  162|  5.56k|  }
  163|  23.2k|}
_ZN18JArithmeticDecoder7cleanupEv:
  165|  1.25M|void JArithmeticDecoder::cleanup() {
  166|  1.25M|  if (limitStream) {
  ------------------
  |  Branch (166:7): [True: 949k, False: 302k]
  ------------------
  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|   949k|    readBufLength = 0;
  175|  7.08G|    while (dataLen > 0) {
  ------------------
  |  Branch (175:12): [True: 7.08G, False: 949k]
  ------------------
  176|  7.08G|      if (readBufLength < (int)sizeof(readBuf)) {
  ------------------
  |  Branch (176:11): [True: 4.95M, False: 7.07G]
  ------------------
  177|  4.95M|	readBuf[readBufLength++] = (Guchar)str->getChar();
  178|  4.95M|	++nBytesRead;
  179|  4.95M|      }
  180|  7.08G|      --dataLen;
  181|  7.08G|    }
  182|   949k|    readBufNext = 0;
  183|   949k|  }
  184|  1.25M|}
_ZN18JArithmeticDecoder9decodeBitEjP23JArithmeticDecoderStats:
  187|  3.58G|				  JArithmeticDecoderStats *stats) {
  188|  3.58G|  int bit;
  189|  3.58G|  Guint qe;
  190|  3.58G|  int iCX, mpsCX;
  191|       |
  192|  3.58G|  iCX = stats->cxTab[context] >> 1;
  193|  3.58G|  mpsCX = stats->cxTab[context] & 1;
  194|  3.58G|  qe = qeTab[iCX];
  195|  3.58G|  a -= qe;
  196|  3.58G|  if (c < a) {
  ------------------
  |  Branch (196:7): [True: 3.53G, False: 51.1M]
  ------------------
  197|  3.53G|    if (a & 0x80000000) {
  ------------------
  |  Branch (197:9): [True: 3.47G, False: 56.6M]
  ------------------
  198|  3.47G|      bit = mpsCX;
  199|  3.47G|    } else {
  200|       |      // MPS_EXCHANGE
  201|  56.6M|      if (a < qe) {
  ------------------
  |  Branch (201:11): [True: 8.44M, False: 48.1M]
  ------------------
  202|  8.44M|	bit = 1 - mpsCX;
  203|  8.44M|	if (switchTab[iCX]) {
  ------------------
  |  Branch (203:6): [True: 4.41M, False: 4.03M]
  ------------------
  204|  4.41M|	  stats->cxTab[context] = (Guchar)((nlpsTab[iCX] << 1) | (1 - mpsCX));
  205|  4.41M|	} else {
  206|  4.03M|	  stats->cxTab[context] = (Guchar)((nlpsTab[iCX] << 1) | mpsCX);
  207|  4.03M|	}
  208|  48.1M|      } else {
  209|  48.1M|	bit = mpsCX;
  210|  48.1M|	stats->cxTab[context] = (Guchar)((nmpsTab[iCX] << 1) | mpsCX);
  211|  48.1M|      }
  212|       |      // RENORMD
  213|  60.1M|      do {
  214|  60.1M|	if (ct == 0) {
  ------------------
  |  Branch (214:6): [True: 7.55M, False: 52.5M]
  ------------------
  215|  7.55M|	  byteIn();
  216|  7.55M|	}
  217|  60.1M|	a <<= 1;
  218|  60.1M|	c <<= 1;
  219|  60.1M|	--ct;
  220|  60.1M|      } while (!(a & 0x80000000));
  ------------------
  |  Branch (220:16): [True: 3.49M, False: 56.6M]
  ------------------
  221|  56.6M|    }
  222|  3.53G|  } else {
  223|  51.1M|    c -= a;
  224|       |    // LPS_EXCHANGE
  225|  51.1M|    if (a < qe) {
  ------------------
  |  Branch (225:9): [True: 9.95M, False: 41.1M]
  ------------------
  226|  9.95M|      bit = mpsCX;
  227|  9.95M|      stats->cxTab[context] = (Guchar)((nmpsTab[iCX] << 1) | mpsCX);
  228|  41.1M|    } else {
  229|  41.1M|      bit = 1 - mpsCX;
  230|  41.1M|      if (switchTab[iCX]) {
  ------------------
  |  Branch (230:11): [True: 5.44M, False: 35.7M]
  ------------------
  231|  5.44M|	stats->cxTab[context] = (Guchar)((nlpsTab[iCX] << 1) | (1 - mpsCX));
  232|  35.7M|      } else {
  233|  35.7M|	stats->cxTab[context] = (Guchar)((nlpsTab[iCX] << 1) | mpsCX);
  234|  35.7M|      }
  235|  41.1M|    }
  236|  51.1M|    a = qe;
  237|       |    // RENORMD
  238|  81.2M|    do {
  239|  81.2M|      if (ct == 0) {
  ------------------
  |  Branch (239:11): [True: 10.1M, False: 71.0M]
  ------------------
  240|  10.1M|	byteIn();
  241|  10.1M|      }
  242|  81.2M|      a <<= 1;
  243|  81.2M|      c <<= 1;
  244|  81.2M|      --ct;
  245|  81.2M|    } while (!(a & 0x80000000));
  ------------------
  |  Branch (245:14): [True: 30.1M, False: 51.1M]
  ------------------
  246|  51.1M|  }
  247|  3.58G|  return bit;
  248|  3.58G|}
_ZN18JArithmeticDecoder9decodeIntEPiP23JArithmeticDecoderStats:
  262|  13.7M|GBool JArithmeticDecoder::decodeInt(int *x, JArithmeticDecoderStats *stats) {
  263|  13.7M|  int s;
  264|  13.7M|  Guint v;
  265|  13.7M|  int i;
  266|       |
  267|  13.7M|  prev = 1;
  268|  13.7M|  s = decodeIntBit(stats);
  269|  13.7M|  if (decodeIntBit(stats)) {
  ------------------
  |  Branch (269:7): [True: 8.25M, False: 5.52M]
  ------------------
  270|  8.25M|    if (decodeIntBit(stats)) {
  ------------------
  |  Branch (270:9): [True: 5.53M, False: 2.71M]
  ------------------
  271|  5.53M|      if (decodeIntBit(stats)) {
  ------------------
  |  Branch (271:11): [True: 4.83M, False: 705k]
  ------------------
  272|  4.83M|	if (decodeIntBit(stats)) {
  ------------------
  |  Branch (272:6): [True: 4.51M, False: 311k]
  ------------------
  273|  4.51M|	  if (decodeIntBit(stats)) {
  ------------------
  |  Branch (273:8): [True: 4.45M, False: 64.7k]
  ------------------
  274|  4.45M|	    v = 0;
  275|   146M|	    for (i = 0; i < 32; ++i) {
  ------------------
  |  Branch (275:18): [True: 142M, False: 4.45M]
  ------------------
  276|   142M|	      v = (v << 1) | decodeIntBit(stats);
  277|   142M|	    }
  278|  4.45M|	    v += 4436;
  279|  4.45M|	  } else {
  280|  64.7k|	    v = 0;
  281|   842k|	    for (i = 0; i < 12; ++i) {
  ------------------
  |  Branch (281:18): [True: 777k, False: 64.7k]
  ------------------
  282|   777k|	      v = (v << 1) | decodeIntBit(stats);
  283|   777k|	    }
  284|  64.7k|	    v += 340;
  285|  64.7k|	  }
  286|  4.51M|	} else {
  287|   311k|	  v = 0;
  288|  2.80M|	  for (i = 0; i < 8; ++i) {
  ------------------
  |  Branch (288:16): [True: 2.49M, False: 311k]
  ------------------
  289|  2.49M|	    v = (v << 1) | decodeIntBit(stats);
  290|  2.49M|	  }
  291|   311k|	  v += 84;
  292|   311k|	}
  293|  4.83M|      } else {
  294|   705k|	v = 0;
  295|  4.93M|	for (i = 0; i < 6; ++i) {
  ------------------
  |  Branch (295:14): [True: 4.23M, False: 705k]
  ------------------
  296|  4.23M|	  v = (v << 1) | decodeIntBit(stats);
  297|  4.23M|	}
  298|   705k|	v += 20;
  299|   705k|      }
  300|  5.53M|    } else {
  301|  2.71M|      v = decodeIntBit(stats);
  302|  2.71M|      v = (v << 1) | decodeIntBit(stats);
  303|  2.71M|      v = (v << 1) | decodeIntBit(stats);
  304|  2.71M|      v = (v << 1) | decodeIntBit(stats);
  305|  2.71M|      v += 4;
  306|  2.71M|    }
  307|  8.25M|  } else {
  308|  5.52M|    v = decodeIntBit(stats);
  309|  5.52M|    v = (v << 1) | decodeIntBit(stats);
  310|  5.52M|  }
  311|       |
  312|  13.7M|  if (s) {
  ------------------
  |  Branch (312:7): [True: 9.08M, False: 4.69M]
  ------------------
  313|  9.08M|    if (v == 0) {
  ------------------
  |  Branch (313:9): [True: 1.60M, False: 7.48M]
  ------------------
  314|  1.60M|      return gFalse;
  ------------------
  |  |   18|  1.60M|#define gFalse 0
  ------------------
  315|  1.60M|    }
  316|  7.48M|    *x = -(int)v;
  317|  7.48M|  } else {
  318|  4.69M|    *x = (int)v;
  319|  4.69M|  }
  320|  12.1M|  return gTrue;
  ------------------
  |  |   17|  12.1M|#define gTrue 1
  ------------------
  321|  13.7M|}
_ZN18JArithmeticDecoder12decodeIntBitEP23JArithmeticDecoderStats:
  323|   222M|int JArithmeticDecoder::decodeIntBit(JArithmeticDecoderStats *stats) {
  324|   222M|  int bit;
  325|       |
  326|   222M|  bit = decodeBit(prev, stats);
  327|   222M|  if (prev < 0x100) {
  ------------------
  |  Branch (327:7): [True: 85.4M, False: 137M]
  ------------------
  328|  85.4M|    prev = (prev << 1) | bit;
  329|   137M|  } else {
  330|   137M|    prev = (((prev << 1) | bit) & 0x1ff) | 0x100;
  331|   137M|  }
  332|   222M|  return bit;
  333|   222M|}
_ZN18JArithmeticDecoder10decodeIAIDEjP23JArithmeticDecoderStats:
  336|  7.19M|				     JArithmeticDecoderStats *stats) {
  337|  7.19M|  Guint i;
  338|  7.19M|  int bit;
  339|       |
  340|  7.19M|  prev = 1;
  341|  39.7M|  for (i = 0; i < codeLen; ++i) {
  ------------------
  |  Branch (341:15): [True: 32.5M, False: 7.19M]
  ------------------
  342|  32.5M|    bit = decodeBit(prev, stats);
  343|  32.5M|    prev = (prev << 1) | bit;
  344|  32.5M|  }
  345|  7.19M|  return prev - (1 << codeLen);
  346|  7.19M|}
_ZN18JArithmeticDecoder6byteInEv:
  348|  18.3M|void JArithmeticDecoder::byteIn() {
  349|  18.3M|  if (buf0 == 0xff) {
  ------------------
  |  Branch (349:7): [True: 16.0M, False: 2.36M]
  ------------------
  350|  16.0M|    if (buf1 > 0x8f) {
  ------------------
  |  Branch (350:9): [True: 15.9M, False: 18.1k]
  ------------------
  351|  15.9M|      if (limitStream) {
  ------------------
  |  Branch (351:11): [True: 2.93M, False: 13.0M]
  ------------------
  352|  2.93M|	buf0 = buf1;
  353|  2.93M|	buf1 = readByte();
  354|  2.93M|	c = c + 0xff00 - (buf0 << 8);
  355|  2.93M|      }
  356|  15.9M|      ct = 8;
  357|  15.9M|    } else {
  358|  18.1k|      buf0 = buf1;
  359|  18.1k|      buf1 = readByte();
  360|  18.1k|      c = c + 0xfe00 - (buf0 << 9);
  361|  18.1k|      ct = 7;
  362|  18.1k|    }
  363|  16.0M|  } else {
  364|  2.36M|    buf0 = buf1;
  365|  2.36M|    buf1 = readByte();
  366|  2.36M|    c = c + 0xff00 - (buf0 << 8);
  367|  2.36M|    ct = 8;
  368|  2.36M|  }
  369|  18.3M|}
_ZN18JArithmeticDecoder8readByteEv:
   96|  7.21M|inline Guint JArithmeticDecoder::readByte() {
   97|  7.21M|  if (limitStream) {
  ------------------
  |  Branch (97:7): [True: 6.22M, False: 985k]
  ------------------
   98|  6.22M|    if (readBufNext < readBufLength) {
  ------------------
  |  Branch (98:9): [True: 775k, False: 5.45M]
  ------------------
   99|   775k|      return readBuf[readBufNext++];
  100|   775k|    }
  101|  5.45M|    --dataLen;
  102|  5.45M|    if (dataLen < 0) {
  ------------------
  |  Branch (102:9): [True: 3.56M, False: 1.88M]
  ------------------
  103|  3.56M|      return 0xff;
  104|  3.56M|    }
  105|  5.45M|  }
  106|  2.87M|  ++nBytesRead;
  107|  2.87M|  return (Guint)str->getChar() & 0xff;
  108|  7.21M|}

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

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

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

_ZN5LexerC2EP4XRefP6Stream:
   46|   444k|Lexer::Lexer(XRef *xref, Stream *str) {
   47|   444k|  Object obj;
   48|       |
   49|   444k|  curStr.initStream(str);
   50|   444k|  streams = new Array(xref);
   51|   444k|  streams->add(curStr.copy(&obj));
   52|   444k|  strPtr = 0;
   53|   444k|  freeArray = gTrue;
  ------------------
  |  |   17|   444k|#define gTrue 1
  ------------------
   54|   444k|  curStr.streamReset();
   55|   444k|}
_ZN5LexerD2Ev:
   75|   444k|Lexer::~Lexer() {
   76|   444k|  if (!curStr.isNone()) {
  ------------------
  |  Branch (76:7): [True: 138k, False: 306k]
  ------------------
   77|   138k|    curStr.streamClose();
   78|   138k|    curStr.free();
   79|   138k|  }
   80|   444k|  if (freeArray) {
  ------------------
  |  Branch (80:7): [True: 444k, False: 0]
  ------------------
   81|   444k|    delete streams;
   82|   444k|  }
   83|   444k|}
_ZN5Lexer7getCharEv:
   85|  3.60G|int Lexer::getChar() {
   86|  3.60G|  int c;
   87|       |
   88|  3.60G|  c = EOF;
   89|  3.60G|  while (!curStr.isNone() && (c = curStr.streamGetChar()) == EOF) {
  ------------------
  |  Branch (89:10): [True: 3.41G, False: 194M]
  |  Branch (89:30): [True: 306k, False: 3.41G]
  ------------------
   90|   306k|    curStr.streamClose();
   91|   306k|    curStr.free();
   92|   306k|    ++strPtr;
   93|   306k|    if (strPtr < streams->getLength()) {
  ------------------
  |  Branch (93:9): [True: 0, False: 306k]
  ------------------
   94|      0|      streams->get(strPtr, &curStr);
   95|      0|      curStr.streamReset();
   96|      0|    }
   97|   306k|  }
   98|  3.60G|  return c;
   99|  3.60G|}
_ZN5Lexer8lookCharEv:
  101|   318M|int Lexer::lookChar() {
  102|   318M|  if (curStr.isNone()) {
  ------------------
  |  Branch (102:7): [True: 4.29k, False: 318M]
  ------------------
  103|  4.29k|    return EOF;
  104|  4.29k|  }
  105|   318M|  return curStr.streamLookChar();
  106|   318M|}
_ZN5Lexer6getObjEP6Object:
  108|   247M|Object *Lexer::getObj(Object *obj) {
  109|   247M|  char *p;
  110|   247M|  int c, c2;
  111|   247M|  GBool comment, neg, doubleMinus, done, invalid;
  112|   247M|  int numParen, nErrors;
  113|   247M|  int xi;
  114|   247M|  double xf, scale;
  115|   247M|  GString *s;
  116|   247M|  int n, m;
  117|       |
  118|       |  // skip whitespace and comments
  119|   247M|  comment = gFalse;
  ------------------
  |  |   18|   247M|#define gFalse 0
  ------------------
  120|  2.62G|  while (1) {
  ------------------
  |  Branch (120:10): [True: 2.62G, Folded]
  ------------------
  121|  2.62G|    if ((c = getChar()) == EOF) {
  ------------------
  |  Branch (121:9): [True: 194M, False: 2.43G]
  ------------------
  122|   194M|      return obj->initEOF();
  123|   194M|    }
  124|  2.43G|    if (comment) {
  ------------------
  |  Branch (124:9): [True: 24.6M, False: 2.40G]
  ------------------
  125|  24.6M|      if (c == '\r' || c == '\n')
  ------------------
  |  Branch (125:11): [True: 132k, False: 24.5M]
  |  Branch (125:24): [True: 192k, False: 24.3M]
  ------------------
  126|   325k|	comment = gFalse;
  ------------------
  |  |   18|   325k|#define gFalse 0
  ------------------
  127|  2.40G|    } else if (c == '%') {
  ------------------
  |  Branch (127:16): [True: 328k, False: 2.40G]
  ------------------
  128|   328k|      comment = gTrue;
  ------------------
  |  |   17|   328k|#define gTrue 1
  ------------------
  129|  2.40G|    } else if (specialChars[c] != 1) {
  ------------------
  |  Branch (129:16): [True: 52.6M, False: 2.35G]
  ------------------
  130|  52.6M|      break;
  131|  52.6M|    }
  132|  2.43G|  }
  133|       |
  134|       |  // start reading token
  135|  52.6M|  switch (c) {
  136|       |
  137|       |  // number
  138|  6.16M|  case '0': case '1': case '2': case '3': case '4':
  ------------------
  |  Branch (138:3): [True: 3.15M, False: 49.5M]
  |  Branch (138:13): [True: 1.25M, False: 51.4M]
  |  Branch (138:23): [True: 940k, False: 51.7M]
  |  Branch (138:33): [True: 398k, False: 52.2M]
  |  Branch (138:43): [True: 425k, False: 52.2M]
  ------------------
  139|  7.83M|  case '5': case '6': case '7': case '8': case '9':
  ------------------
  |  Branch (139:3): [True: 214k, False: 52.4M]
  |  Branch (139:13): [True: 421k, False: 52.2M]
  |  Branch (139:23): [True: 170k, False: 52.4M]
  |  Branch (139:33): [True: 601k, False: 52.0M]
  |  Branch (139:43): [True: 255k, False: 52.4M]
  ------------------
  140|  8.44M|  case '+': case '-': case '.':
  ------------------
  |  Branch (140:3): [True: 48.9k, False: 52.6M]
  |  Branch (140:13): [True: 342k, False: 52.3M]
  |  Branch (140:23): [True: 221k, False: 52.4M]
  ------------------
  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|  8.44M|    neg = gFalse;
  ------------------
  |  |   18|  8.44M|#define gFalse 0
  ------------------
  156|  8.44M|    doubleMinus = gFalse;
  ------------------
  |  |   18|  8.44M|#define gFalse 0
  ------------------
  157|  8.44M|    xf = xi = 0;
  158|  8.44M|    if (c == '+') {
  ------------------
  |  Branch (158:9): [True: 48.9k, False: 8.39M]
  ------------------
  159|       |      // just ignore it
  160|  8.39M|    } else if (c == '-') {
  ------------------
  |  Branch (160:16): [True: 342k, False: 8.05M]
  ------------------
  161|   342k|      neg = gTrue;
  ------------------
  |  |   17|   342k|#define gTrue 1
  ------------------
  162|   342k|      if (lookChar() == '-') {
  ------------------
  |  Branch (162:11): [True: 11.3k, False: 331k]
  ------------------
  163|  11.3k|	doubleMinus = gTrue;
  ------------------
  |  |   17|  11.3k|#define gTrue 1
  ------------------
  164|  19.6k|	do {
  165|  19.6k|	  getChar();
  166|  19.6k|	} while (lookChar() == '-');
  ------------------
  |  Branch (166:11): [True: 8.29k, False: 11.3k]
  ------------------
  167|  11.3k|      }
  168|  8.05M|    } else if (c == '.') {
  ------------------
  |  Branch (168:16): [True: 221k, False: 7.83M]
  ------------------
  169|   221k|      goto doReal;
  170|  7.83M|    } else {
  171|  7.83M|      xf = xi = c - '0';
  172|  7.83M|    }
  173|  17.1M|    while (1) {
  ------------------
  |  Branch (173:12): [True: 17.1M, Folded]
  ------------------
  174|  17.1M|      c = lookChar();
  175|  17.1M|      if (isdigit(c)) {
  ------------------
  |  Branch (175:11): [True: 8.91M, False: 8.22M]
  ------------------
  176|  8.91M|	getChar();
  177|  8.91M|	xi = xi * 10 + (c - '0');
  178|  8.91M|	if (xf < 1e20) {
  ------------------
  |  Branch (178:6): [True: 8.68M, False: 231k]
  ------------------
  179|  8.68M|	  xf = xf * 10 + (c - '0');
  180|  8.68M|	}
  181|  8.91M|      } else if (c == '.') {
  ------------------
  |  Branch (181:18): [True: 304k, False: 7.91M]
  ------------------
  182|   304k|	getChar();
  183|   304k|	goto doReal;
  184|  7.91M|      } else {
  185|  7.91M|	break;
  186|  7.91M|      }
  187|  17.1M|    }
  188|  7.93M|    while ((c = lookChar()) == '-' || isdigit(c)) {
  ------------------
  |  Branch (188:12): [True: 5.33k, False: 7.92M]
  |  Branch (188:39): [True: 6.50k, False: 7.91M]
  ------------------
  189|  11.8k|      getChar();
  190|  11.8k|    }
  191|  7.91M|    if (neg) {
  ------------------
  |  Branch (191:9): [True: 337k, False: 7.58M]
  ------------------
  192|   337k|      xi = -xi;
  193|   337k|    }
  194|  7.91M|    if (doubleMinus) {
  ------------------
  |  Branch (194:9): [True: 11.1k, False: 7.90M]
  ------------------
  195|  11.1k|      xi = 0;
  196|  11.1k|    }
  197|  7.91M|    obj->initInt(xi);
  198|  7.91M|    break;
  199|   526k|  doReal:
  200|   526k|    scale = 0.1;
  201|  1.05M|    while (1) {
  ------------------
  |  Branch (201:12): [True: 1.05M, Folded]
  ------------------
  202|  1.05M|      c = lookChar();
  203|  1.05M|      if (c == '-') {
  ------------------
  |  Branch (203:11): [True: 38.0k, False: 1.01M]
  ------------------
  204|  38.0k|	error(errSyntaxWarning, getPos(), "Badly formatted number");
  205|  38.0k|	getChar();
  206|  38.0k|	continue;
  207|  38.0k|      }
  208|  1.01M|      if (!isdigit(c)) {
  ------------------
  |  Branch (208:11): [True: 526k, False: 487k]
  ------------------
  209|   526k|	break;
  210|   526k|      }
  211|   487k|      getChar();
  212|   487k|      xf = xf + scale * (c - '0');
  213|   487k|      scale *= 0.1;
  214|   487k|    }
  215|   526k|    while ((c = lookChar()) == '-' || isdigit(c)) {
  ------------------
  |  Branch (215:12): [True: 0, False: 526k]
  |  Branch (215:39): [True: 0, False: 526k]
  ------------------
  216|      0|      getChar();
  217|      0|    }
  218|   526k|    if (neg) {
  ------------------
  |  Branch (218:9): [True: 5.29k, False: 521k]
  ------------------
  219|  5.29k|      xf = -xf;
  220|  5.29k|    }
  221|   526k|    obj->initReal(xf);
  222|   526k|    break;
  223|       |
  224|       |  // string
  225|   226k|  case '(':
  ------------------
  |  Branch (225:3): [True: 226k, False: 52.4M]
  ------------------
  226|   226k|    p = tokBuf;
  227|   226k|    n = 0;
  228|   226k|    numParen = 1;
  229|   226k|    done = gFalse;
  ------------------
  |  |   18|   226k|#define gFalse 0
  ------------------
  230|   226k|    s = NULL;
  231|   650M|    do {
  232|   650M|      c2 = EOF;
  233|   650M|      switch (c = getChar()) {
  234|       |
  235|  11.6k|      case EOF:
  ------------------
  |  Branch (235:7): [True: 11.6k, False: 650M]
  ------------------
  236|  11.6k|	error(errSyntaxError, getPos(), "Unterminated string");
  237|  11.6k|	done = gTrue;
  ------------------
  |  |   17|  11.6k|#define gTrue 1
  ------------------
  238|  11.6k|	break;
  239|       |
  240|  2.86M|      case '(':
  ------------------
  |  Branch (240:7): [True: 2.86M, False: 647M]
  ------------------
  241|  2.86M|	++numParen;
  242|  2.86M|	c2 = c;
  243|  2.86M|	break;
  244|       |
  245|  1.56M|      case ')':
  ------------------
  |  Branch (245:7): [True: 1.56M, False: 649M]
  ------------------
  246|  1.56M|	if (--numParen == 0) {
  ------------------
  |  Branch (246:6): [True: 213k, False: 1.35M]
  ------------------
  247|   213k|	  done = gTrue;
  ------------------
  |  |   17|   213k|#define gTrue 1
  ------------------
  248|  1.35M|	} else {
  249|  1.35M|	  c2 = c;
  250|  1.35M|	}
  251|  1.56M|	break;
  252|       |
  253|  6.10M|      case '\r':
  ------------------
  |  Branch (253:7): [True: 6.10M, False: 644M]
  ------------------
  254|       |	// The PDF spec says that any literal end-of-line sequence
  255|       |	// (LF, CR, CR+LF) is translated to a single LF char.
  256|  6.10M|	c = lookChar();
  257|  6.10M|	if (c == '\n') {
  ------------------
  |  Branch (257:6): [True: 180k, False: 5.92M]
  ------------------
  258|   180k|	  getChar();
  259|   180k|	}
  260|  6.10M|	c2 = '\n';
  261|  6.10M|	break;
  262|       |
  263|  1.01M|      case '\\':
  ------------------
  |  Branch (263:7): [True: 1.01M, False: 649M]
  ------------------
  264|  1.01M|	switch (c = getChar()) {
  265|  7.02k|	case 'n':
  ------------------
  |  Branch (265:2): [True: 7.02k, False: 1.00M]
  ------------------
  266|  7.02k|	  c2 = '\n';
  267|  7.02k|	  break;
  268|  21.5k|	case 'r':
  ------------------
  |  Branch (268:2): [True: 21.5k, False: 991k]
  ------------------
  269|  21.5k|	  c2 = '\r';
  270|  21.5k|	  break;
  271|  24.7k|	case 't':
  ------------------
  |  Branch (271:2): [True: 24.7k, False: 988k]
  ------------------
  272|  24.7k|	  c2 = '\t';
  273|  24.7k|	  break;
  274|  7.50k|	case 'b':
  ------------------
  |  Branch (274:2): [True: 7.50k, False: 1.00M]
  ------------------
  275|  7.50k|	  c2 = '\b';
  276|  7.50k|	  break;
  277|  4.90k|	case 'f':
  ------------------
  |  Branch (277:2): [True: 4.90k, False: 1.00M]
  ------------------
  278|  4.90k|	  c2 = '\f';
  279|  4.90k|	  break;
  280|  4.52k|	case '\\':
  ------------------
  |  Branch (280:2): [True: 4.52k, False: 1.00M]
  ------------------
  281|  13.7k|	case '(':
  ------------------
  |  Branch (281:2): [True: 9.19k, False: 1.00M]
  ------------------
  282|  24.4k|	case ')':
  ------------------
  |  Branch (282:2): [True: 10.7k, False: 1.00M]
  ------------------
  283|  24.4k|	  c2 = c;
  284|  24.4k|	  break;
  285|  23.4k|	case '0': case '1': case '2': case '3':
  ------------------
  |  Branch (285:2): [True: 10.9k, False: 1.00M]
  |  Branch (285:12): [True: 3.48k, False: 1.00M]
  |  Branch (285:22): [True: 5.62k, False: 1.00M]
  |  Branch (285:32): [True: 3.38k, False: 1.00M]
  ------------------
  286|  56.8k|	case '4': case '5': case '6': case '7':
  ------------------
  |  Branch (286:2): [True: 6.77k, False: 1.00M]
  |  Branch (286:12): [True: 8.96k, False: 1.00M]
  |  Branch (286:22): [True: 8.83k, False: 1.00M]
  |  Branch (286:32): [True: 8.76k, False: 1.00M]
  ------------------
  287|  56.8k|	  c2 = c - '0';
  288|  56.8k|	  c = lookChar();
  289|  56.8k|	  if (c >= '0' && c <= '7') {
  ------------------
  |  Branch (289:8): [True: 32.5k, False: 24.2k]
  |  Branch (289:20): [True: 10.6k, False: 21.8k]
  ------------------
  290|  10.6k|	    getChar();
  291|  10.6k|	    c2 = (c2 << 3) + (c - '0');
  292|  10.6k|	    c = lookChar();
  293|  10.6k|	    if (c >= '0' && c <= '7') {
  ------------------
  |  Branch (293:10): [True: 5.15k, False: 5.53k]
  |  Branch (293:22): [True: 998, False: 4.15k]
  ------------------
  294|    998|	      getChar();
  295|    998|	      c2 = (c2 << 3) + (c - '0');
  296|    998|	    }
  297|  10.6k|	  }
  298|  56.8k|	  break;
  299|  7.29k|	case '\r':
  ------------------
  |  Branch (299:2): [True: 7.29k, False: 1.00M]
  ------------------
  300|  7.29k|	  c = lookChar();
  301|  7.29k|	  if (c == '\n') {
  ------------------
  |  Branch (301:8): [True: 1.26k, False: 6.02k]
  ------------------
  302|  1.26k|	    getChar();
  303|  1.26k|	  }
  304|  7.29k|	  break;
  305|  9.88k|	case '\n':
  ------------------
  |  Branch (305:2): [True: 9.88k, False: 1.00M]
  ------------------
  306|  9.88k|	  break;
  307|  1.84k|	case EOF:
  ------------------
  |  Branch (307:2): [True: 1.84k, False: 1.01M]
  ------------------
  308|  1.84k|	  error(errSyntaxError, getPos(), "Unterminated string");
  309|  1.84k|	  done = gTrue;
  ------------------
  |  |   17|  1.84k|#define gTrue 1
  ------------------
  310|  1.84k|	  break;
  311|   847k|	default:
  ------------------
  |  Branch (311:2): [True: 847k, False: 166k]
  ------------------
  312|   847k|	  c2 = c;
  313|   847k|	  break;
  314|  1.01M|	}
  315|  1.01M|	break;
  316|       |
  317|   639M|      default:
  ------------------
  |  Branch (317:7): [True: 639M, False: 11.5M]
  ------------------
  318|   639M|	c2 = c;
  319|   639M|	break;
  320|   650M|      }
  321|       |
  322|   650M|      if (c2 != EOF) {
  ------------------
  |  Branch (322:11): [True: 650M, False: 243k]
  ------------------
  323|   650M|	if (n == tokBufSize) {
  ------------------
  |  |   19|   650M|#define tokBufSize 128		// size of token buffer
  ------------------
  |  Branch (323:6): [True: 5.00M, False: 645M]
  ------------------
  324|  5.00M|	  if (!s)
  ------------------
  |  Branch (324:8): [True: 79.4k, False: 4.92M]
  ------------------
  325|  79.4k|	    s = new GString(tokBuf, tokBufSize);
  ------------------
  |  |   19|  79.4k|#define tokBufSize 128		// size of token buffer
  ------------------
  326|  4.92M|	  else
  327|  4.92M|	    s->append(tokBuf, tokBufSize);
  ------------------
  |  |   19|  4.92M|#define tokBufSize 128		// size of token buffer
  ------------------
  328|  5.00M|	  p = tokBuf;
  329|  5.00M|	  n = 0;
  330|  5.00M|	}
  331|   650M|	*p++ = (char)c2;
  332|   650M|	++n;
  333|   650M|      }
  334|   650M|    } while (!done);
  ------------------
  |  Branch (334:14): [True: 650M, False: 226k]
  ------------------
  335|   226k|    if (!s)
  ------------------
  |  Branch (335:9): [True: 147k, False: 79.4k]
  ------------------
  336|   147k|      s = new GString(tokBuf, n);
  337|  79.4k|    else
  338|  79.4k|      s->append(tokBuf, n);
  339|   226k|    obj->initString(s);
  340|   226k|    break;
  341|       |
  342|       |  // name
  343|  7.69M|  case '/':
  ------------------
  |  Branch (343:3): [True: 7.69M, False: 44.9M]
  ------------------
  344|  7.69M|    p = tokBuf;
  345|  7.69M|    n = 0;
  346|  7.69M|    s = NULL;
  347|  7.69M|    invalid = gFalse;
  ------------------
  |  |   18|  7.69M|#define gFalse 0
  ------------------
  348|  34.2M|    while ((c = lookChar()) != EOF && !specialChars[c]) {
  ------------------
  |  Branch (348:12): [True: 34.2M, False: 4.86k]
  |  Branch (348:39): [True: 26.5M, False: 7.68M]
  ------------------
  349|  26.5M|      getChar();
  350|  26.5M|      if (c == '#') {
  ------------------
  |  Branch (350:11): [True: 829k, False: 25.7M]
  ------------------
  351|   829k|	c2 = lookChar();
  352|   829k|	if (c2 >= '0' && c2 <= '9') {
  ------------------
  |  Branch (352:6): [True: 410k, False: 419k]
  |  Branch (352:19): [True: 3.85k, False: 406k]
  ------------------
  353|  3.85k|	  c = c2 - '0';
  354|   825k|	} else if (c2 >= 'A' && c2 <= 'F') {
  ------------------
  |  Branch (354:13): [True: 406k, False: 419k]
  |  Branch (354:26): [True: 47.3k, False: 359k]
  ------------------
  355|  47.3k|	  c = c2 - 'A' + 10;
  356|   778k|	} else if (c2 >= 'a' && c2 <= 'f') {
  ------------------
  |  Branch (356:13): [True: 358k, False: 419k]
  |  Branch (356:26): [True: 98.5k, False: 260k]
  ------------------
  357|  98.5k|	  c = c2 - 'a' + 10;
  358|   679k|	} else {
  359|   679k|	  error(errSyntaxError, getPos(), "Invalid hex escape in name");
  360|   679k|	  goto notEscChar;
  361|   679k|	}
  362|   149k|	getChar();
  363|   149k|	c2 = lookChar();
  364|   149k|	if (c2 >= '0' && c2 <= '9') {
  ------------------
  |  Branch (364:6): [True: 146k, False: 2.92k]
  |  Branch (364:19): [True: 27.8k, False: 118k]
  ------------------
  365|  27.8k|	  c = (c << 4) + (c2 - '0');
  366|   121k|	} else if (c2 >= 'A' && c2 <= 'F') {
  ------------------
  |  Branch (366:13): [True: 96.2k, False: 25.5k]
  |  Branch (366:26): [True: 47.2k, False: 49.0k]
  ------------------
  367|  47.2k|	  c = (c << 4) + (c2 - 'A' + 10);
  368|  74.6k|	} else if (c2 >= 'a' && c2 <= 'f') {
  ------------------
  |  Branch (368:13): [True: 2.23k, False: 72.3k]
  |  Branch (368:26): [True: 713, False: 1.52k]
  ------------------
  369|    713|	  c = (c << 4) + (c2 - 'a' + 10);
  370|  73.8k|	} else {
  371|  73.8k|	  error(errSyntaxError, getPos(), "Invalid hex escape in name");
  372|  73.8k|	  goto notEscChar;
  373|  73.8k|	}
  374|  75.8k|	getChar();
  375|  75.8k|	if (c == 0) {
  ------------------
  |  Branch (375:6): [True: 760, False: 75.0k]
  ------------------
  376|    760|	  invalid = gTrue;
  ------------------
  |  |   17|    760|#define gTrue 1
  ------------------
  377|    760|	}
  378|  75.8k|      }
  379|  26.5M|     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|  26.5M|      ++n;
  384|  26.5M|      if (n < tokBufSize) {
  ------------------
  |  |   19|  26.5M|#define tokBufSize 128		// size of token buffer
  ------------------
  |  Branch (384:11): [True: 25.8M, False: 767k]
  ------------------
  385|  25.8M|	*p++ = (char)c;
  386|  25.8M|      } else if (n == tokBufSize) {
  ------------------
  |  |   19|   767k|#define tokBufSize 128		// size of token buffer
  ------------------
  |  Branch (386:18): [True: 3.04k, False: 764k]
  ------------------
  387|  3.04k|	*p = (char)c;
  388|  3.04k|	s = new GString(tokBuf, n);
  389|   764k|      } else {
  390|   764k|	s->append((char)c);
  391|   764k|      }
  392|  26.5M|    }
  393|  7.69M|    if (invalid) {
  ------------------
  |  Branch (393:9): [True: 759, False: 7.69M]
  ------------------
  394|    759|      error(errSyntaxError, getPos(), "Null character in name");
  395|    759|      obj->initError();
  396|    759|      if (s) {
  ------------------
  |  Branch (396:11): [True: 296, False: 463]
  ------------------
  397|    296|	delete s;
  398|    296|      }
  399|  7.69M|    } else if (n < tokBufSize) {
  ------------------
  |  |   19|  7.69M|#define tokBufSize 128		// size of token buffer
  ------------------
  |  Branch (399:16): [True: 7.68M, False: 2.74k]
  ------------------
  400|  7.68M|      *p = '\0';
  401|  7.68M|      obj->initName(tokBuf);
  402|  7.68M|    } else {
  403|  2.74k|      obj->initName(s->getCString());
  404|  2.74k|      delete s;
  405|  2.74k|    }
  406|  7.69M|    break;
  407|       |
  408|       |  // array punctuation
  409|  5.57M|  case '[':
  ------------------
  |  Branch (409:3): [True: 5.57M, False: 47.0M]
  ------------------
  410|  6.12M|  case ']':
  ------------------
  |  Branch (410:3): [True: 553k, False: 52.1M]
  ------------------
  411|  6.12M|    tokBuf[0] = (char)c;
  412|  6.12M|    tokBuf[1] = '\0';
  413|  6.12M|    obj->initCmd(tokBuf);
  414|  6.12M|    break;
  415|       |
  416|       |  // hex string or dict punctuation
  417|  4.31M|  case '<':
  ------------------
  |  Branch (417:3): [True: 4.31M, False: 48.3M]
  ------------------
  418|  4.31M|    c = lookChar();
  419|       |
  420|       |    // dict punctuation
  421|  4.31M|    if (c == '<') {
  ------------------
  |  Branch (421:9): [True: 3.48M, False: 828k]
  ------------------
  422|  3.48M|      getChar();
  423|  3.48M|      tokBuf[0] = tokBuf[1] = '<';
  424|  3.48M|      tokBuf[2] = '\0';
  425|  3.48M|      obj->initCmd(tokBuf);
  426|       |
  427|       |    // hex string
  428|  3.48M|    } else {
  429|   828k|      p = tokBuf;
  430|   828k|      m = n = 0;
  431|   828k|      c2 = 0;
  432|   828k|      s = NULL;
  433|   828k|      nErrors = 0;
  434|  64.7M|      while (nErrors < 100) {
  ------------------
  |  Branch (434:14): [True: 64.5M, False: 216k]
  ------------------
  435|  64.5M|	c = getChar();
  436|  64.5M|	if (c == '>') {
  ------------------
  |  Branch (436:6): [True: 608k, False: 63.9M]
  ------------------
  437|   608k|	  break;
  438|  63.9M|	} else if (c == EOF) {
  ------------------
  |  Branch (438:13): [True: 3.58k, False: 63.9M]
  ------------------
  439|  3.58k|	  error(errSyntaxError, getPos(), "Unterminated hex string");
  440|  3.58k|	  break;
  441|  63.9M|	} else if (specialChars[c] != 1) {
  ------------------
  |  Branch (441:13): [True: 54.6M, False: 9.36M]
  ------------------
  442|  54.6M|	  c2 = c2 << 4;
  443|  54.6M|	  if (c >= '0' && c <= '9') {
  ------------------
  |  Branch (443:8): [True: 48.0M, False: 6.53M]
  |  Branch (443:20): [True: 7.93M, False: 40.1M]
  ------------------
  444|  7.93M|	    c2 += c - '0';
  445|  46.6M|	  } else if (c >= 'A' && c <= 'F') {
  ------------------
  |  Branch (445:15): [True: 35.9M, False: 10.7M]
  |  Branch (445:27): [True: 922k, False: 35.0M]
  ------------------
  446|   922k|	    c2 += c - 'A' + 10;
  447|  45.7M|	  } else if (c >= 'a' && c <= 'f') {
  ------------------
  |  Branch (447:15): [True: 31.6M, False: 14.1M]
  |  Branch (447:27): [True: 6.68M, False: 24.9M]
  ------------------
  448|  6.68M|	    c2 += c - 'a' + 10;
  449|  39.0M|	  } else {
  450|  39.0M|	    error(errSyntaxError, getPos(),
  451|  39.0M|		  "Illegal character <{0:02x}> in hex string", c);
  452|  39.0M|	    ++nErrors;
  453|  39.0M|	  }
  454|  54.6M|	  if (++m == 2) {
  ------------------
  |  Branch (454:8): [True: 27.1M, False: 27.4M]
  ------------------
  455|  27.1M|	    if (n == tokBufSize) {
  ------------------
  |  |   19|  27.1M|#define tokBufSize 128		// size of token buffer
  ------------------
  |  Branch (455:10): [True: 7.66k, False: 27.1M]
  ------------------
  456|  7.66k|	      if (!s)
  ------------------
  |  Branch (456:12): [True: 4.12k, False: 3.54k]
  ------------------
  457|  4.12k|		s = new GString(tokBuf, tokBufSize);
  ------------------
  |  |   19|  4.12k|#define tokBufSize 128		// size of token buffer
  ------------------
  458|  3.54k|	      else
  459|  3.54k|		s->append(tokBuf, tokBufSize);
  ------------------
  |  |   19|  3.54k|#define tokBufSize 128		// size of token buffer
  ------------------
  460|  7.66k|	      p = tokBuf;
  461|  7.66k|	      n = 0;
  462|  7.66k|	    }
  463|  27.1M|	    *p++ = (char)c2;
  464|  27.1M|	    ++n;
  465|  27.1M|	    c2 = 0;
  466|  27.1M|	    m = 0;
  467|  27.1M|	  }
  468|  54.6M|	}
  469|  64.5M|      }
  470|   828k|      if (!s)
  ------------------
  |  Branch (470:11): [True: 824k, False: 4.12k]
  ------------------
  471|   824k|	s = new GString(tokBuf, n);
  472|  4.12k|      else
  473|  4.12k|	s->append(tokBuf, n);
  474|   828k|      if (m == 1)
  ------------------
  |  Branch (474:11): [True: 359k, False: 469k]
  ------------------
  475|   359k|	s->append((char)(c2 << 4));
  476|   828k|      obj->initString(s);
  477|   828k|    }
  478|  4.31M|    break;
  479|       |
  480|       |  // dict punctuation
  481|  3.47M|  case '>':
  ------------------
  |  Branch (481:3): [True: 3.47M, False: 49.1M]
  ------------------
  482|  3.47M|    c = lookChar();
  483|  3.47M|    if (c == '>') {
  ------------------
  |  Branch (483:9): [True: 2.17M, False: 1.30M]
  ------------------
  484|  2.17M|      getChar();
  485|  2.17M|      tokBuf[0] = tokBuf[1] = '>';
  486|  2.17M|      tokBuf[2] = '\0';
  487|  2.17M|      obj->initCmd(tokBuf);
  488|  2.17M|    } else {
  489|  1.30M|      error(errSyntaxError, getPos(), "Illegal character '>'");
  490|  1.30M|      obj->initError();
  491|  1.30M|    }
  492|  3.47M|    break;
  493|       |
  494|       |  // error
  495|   985k|  case ')':
  ------------------
  |  Branch (495:3): [True: 985k, False: 51.6M]
  ------------------
  496|  1.19M|  case '{':
  ------------------
  |  Branch (496:3): [True: 212k, False: 52.4M]
  ------------------
  497|  1.34M|  case '}':
  ------------------
  |  Branch (497:3): [True: 147k, False: 52.5M]
  ------------------
  498|  1.34M|    error(errSyntaxError, getPos(), "Illegal character '{0:c}'", c);
  499|  1.34M|    obj->initError();
  500|  1.34M|    break;
  501|       |
  502|       |  // command
  503|  21.0M|  default:
  ------------------
  |  Branch (503:3): [True: 21.0M, False: 31.6M]
  ------------------
  504|  21.0M|    p = tokBuf;
  505|  21.0M|    *p++ = (char)c;
  506|  21.0M|    n = 1;
  507|   242M|    while ((c = lookChar()) != EOF && !specialChars[c]) {
  ------------------
  |  Branch (507:12): [True: 242M, False: 30.6k]
  |  Branch (507:39): [True: 222M, False: 20.0M]
  ------------------
  508|   222M|      getChar();
  509|   222M|      if (++n == tokBufSize) {
  ------------------
  |  |   19|   222M|#define tokBufSize 128		// size of token buffer
  ------------------
  |  Branch (509:11): [True: 996k, False: 221M]
  ------------------
  510|   996k|	error(errSyntaxError, getPos(), "Command token too long");
  511|   996k|	break;
  512|   996k|      }
  513|   221M|      *p++ = (char)c;
  514|   221M|    }
  515|  21.0M|    *p = '\0';
  516|  21.0M|    if (tokBuf[0] == 't' && !strcmp(tokBuf, "true")) {
  ------------------
  |  Branch (516:9): [True: 2.11M, False: 18.9M]
  |  Branch (516:29): [True: 74.9k, False: 2.03M]
  ------------------
  517|  74.9k|      obj->initBool(gTrue);
  ------------------
  |  |   17|  74.9k|#define gTrue 1
  ------------------
  518|  20.9M|    } else if (tokBuf[0] == 'f' && !strcmp(tokBuf, "false")) {
  ------------------
  |  Branch (518:16): [True: 35.2k, False: 20.9M]
  |  Branch (518:36): [True: 3.41k, False: 31.8k]
  ------------------
  519|  3.41k|      obj->initBool(gFalse);
  ------------------
  |  |   18|  3.41k|#define gFalse 0
  ------------------
  520|  20.9M|    } else if (tokBuf[0] == 'n' && !strcmp(tokBuf, "null")) {
  ------------------
  |  Branch (520:16): [True: 168k, False: 20.7M]
  |  Branch (520:36): [True: 1.33k, False: 167k]
  ------------------
  521|  1.33k|      obj->initNull();
  522|  20.9M|    } else {
  523|  20.9M|      obj->initCmd(tokBuf);
  524|  20.9M|    }
  525|  21.0M|    break;
  526|  52.6M|  }
  527|       |
  528|  52.6M|  return obj;
  529|  52.6M|}
_ZN5Lexer14skipToNextLineEv:
  531|   133k|void Lexer::skipToNextLine() {
  532|   133k|  int c;
  533|       |
  534|   517k|  while (1) {
  ------------------
  |  Branch (534:10): [True: 517k, Folded]
  ------------------
  535|   517k|    c = getChar();
  536|   517k|    if (c == EOF || c == '\n') {
  ------------------
  |  Branch (536:9): [True: 3.87k, False: 513k]
  |  Branch (536:21): [True: 56.9k, False: 456k]
  ------------------
  537|  60.8k|      return;
  538|  60.8k|    }
  539|   456k|    if (c == '\r') {
  ------------------
  |  Branch (539:9): [True: 72.8k, False: 383k]
  ------------------
  540|  72.8k|      if ((c = lookChar()) == '\n') {
  ------------------
  |  Branch (540:11): [True: 58.9k, False: 13.8k]
  ------------------
  541|  58.9k|	getChar();
  542|  58.9k|      }
  543|  72.8k|      return;
  544|  72.8k|    }
  545|   456k|  }
  546|   133k|}
_ZN5Lexer9skipToEOFEv:
  548|  50.5k|void Lexer::skipToEOF() {
  549|  2.90M|  while (getChar() != EOF) ;
  ------------------
  |  Branch (549:10): [True: 2.85M, False: 50.5k]
  ------------------
  550|  50.5k|}
_ZN5Lexer7isSpaceEi:
  552|  51.7M|GBool Lexer::isSpace(int c) {
  553|  51.7M|  return c >= 0 && c <= 0xff && specialChars[c] == 1;
  ------------------
  |  Branch (553:10): [True: 51.7M, False: 12.2k]
  |  Branch (553:20): [True: 51.7M, False: 0]
  |  Branch (553:33): [True: 10.7M, False: 41.0M]
  ------------------
  554|  51.7M|}

_ZN5Lexer8skipCharEv:
   49|   322k|  void skipChar() { getChar(); }
_ZN5Lexer9getStreamEv:
   56|   523k|    { return curStr.isNone() ? (Stream *)NULL : curStr.getStream(); }
  ------------------
  |  Branch (56:14): [True: 3.87k, False: 519k]
  ------------------
_ZN5Lexer6getPosEv:
   60|  59.2M|    { return curStr.isNone() ? -1 : curStr.streamGetPos(); }
  ------------------
  |  Branch (60:14): [True: 690k, False: 58.5M]
  ------------------
_ZN5Lexer6setPosEli:
   64|   103k|    { if (!curStr.isNone()) curStr.streamSetPos(pos, dir); }
  ------------------
  |  Branch (64:11): [True: 103k, False: 0]
  ------------------

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

_ZN10LinkActionD2Ev:
   41|    819|  virtual ~LinkAction() {}
_ZN8LinkDest4isOkEv:
   85|    448|  GBool isOk() { return ok; }
_ZN8LinkGoTo4isOkEv:
  135|    472|  virtual GBool isOk() { return dest || namedDest; }
  ------------------
  |  Branch (135:33): [True: 288, False: 184]
  |  Branch (135:41): [True: 20, False: 164]
  ------------------
_ZN9LinkGoToR4isOkEv:
  165|    150|  virtual GBool isOk() { return fileName && (dest || namedDest); }
  ------------------
  |  Branch (165:33): [True: 15, False: 135]
  |  Branch (165:46): [True: 7, False: 8]
  |  Branch (165:54): [True: 5, False: 3]
  ------------------
_ZN7LinkURI4isOkEv:
  223|     53|  virtual GBool isOk() { return uri != NULL; }
_ZN9LinkNamed4isOkEv:
  247|     16|  virtual GBool isOk() { return name != NULL; }
_ZN14LinkJavaScript4isOkEv:
  296|     43|  virtual GBool isOk() { return js != NULL; }
_ZN11LinkUnknown4isOkEv:
  373|     85|  virtual GBool isOk() { return action != NULL; }

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

_ZN6Object9initArrayEP4XRef:
   51|   856k|Object *Object::initArray(XRef *xref) {
   52|   856k|  initObj(objArray);
  ------------------
  |  |   77|   856k|#define initObj(t) type = t
  ------------------
   53|   856k|  array = new Array(xref);
   54|   856k|  return this;
   55|   856k|}
_ZN6Object8initDictEP4XRef:
   57|   839k|Object *Object::initDict(XRef *xref) {
   58|   839k|  initObj(objDict);
  ------------------
  |  |   77|   839k|#define initObj(t) type = t
  ------------------
   59|   839k|  dict = new Dict(xref);
   60|   839k|  return this;
   61|   839k|}
_ZN6Object8initDictEP4Dict:
   63|  6.97k|Object *Object::initDict(Dict *dictA) {
   64|  6.97k|  initObj(objDict);
  ------------------
  |  |   77|  6.97k|#define initObj(t) type = t
  ------------------
   65|  6.97k|  dict = dictA;
   66|  6.97k|  dict->incRef();
   67|  6.97k|  return this;
   68|  6.97k|}
_ZN6Object10initStreamEP6Stream:
   70|   567k|Object *Object::initStream(Stream *streamA) {
   71|   567k|  initObj(objStream);
  ------------------
  |  |   77|   567k|#define initObj(t) type = t
  ------------------
   72|   567k|  stream = streamA;
   73|   567k|  return this;
   74|   567k|}
_ZN6Object4copyEPS_:
   76|   252M|Object *Object::copy(Object *obj) {
   77|   252M|  *obj = *this;
   78|   252M|  switch (type) {
   79|   763k|  case objString:
  ------------------
  |  Branch (79:3): [True: 763k, False: 251M]
  ------------------
   80|   763k|    obj->string = string->copy();
   81|   763k|    break;
   82|  7.11M|  case objName:
  ------------------
  |  Branch (82:3): [True: 7.11M, False: 245M]
  ------------------
   83|  7.11M|    obj->name = copyString(name);
   84|  7.11M|    break;
   85|  2.93M|  case objArray:
  ------------------
  |  Branch (85:3): [True: 2.93M, False: 249M]
  ------------------
   86|  2.93M|    array->incRef();
   87|  2.93M|    break;
   88|  2.74M|  case objDict:
  ------------------
  |  Branch (88:3): [True: 2.74M, False: 249M]
  ------------------
   89|  2.74M|    dict->incRef();
   90|  2.74M|    break;
   91|   985k|  case objStream:
  ------------------
  |  Branch (91:3): [True: 985k, False: 251M]
  ------------------
   92|   985k|    obj->stream = stream->copy();
   93|   985k|    break;
   94|  28.3M|  case objCmd:
  ------------------
  |  Branch (94:3): [True: 28.3M, False: 224M]
  ------------------
   95|  28.3M|    obj->cmd = copyString(cmd);
   96|  28.3M|    break;
   97|   209M|  default:
  ------------------
  |  Branch (97:3): [True: 209M, False: 42.8M]
  ------------------
   98|   209M|    break;
   99|   252M|  }
  100|       |#ifdef DEBUG_OBJECT_MEM
  101|       |#if MULTITHREADED
  102|       |  gAtomicIncrement(&numAlloc[type]);
  103|       |#else
  104|       |  ++numAlloc[type];
  105|       |#endif
  106|       |#endif
  107|   252M|  return obj;
  108|   252M|}
_ZN6Object5fetchEP4XRefPS_i:
  110|  13.6M|Object *Object::fetch(XRef *xref, Object *obj, int recursion) {
  111|  13.6M|  return (type == objRef && xref) ?
  ------------------
  |  Branch (111:11): [True: 2.34M, False: 11.2M]
  |  Branch (111:29): [True: 2.34M, False: 3]
  ------------------
  112|  11.2M|         xref->fetch(ref.num, ref.gen, obj, recursion) : copy(obj);
  113|  13.6M|}
_ZN6Object4freeEv:
  115|   597M|void Object::free() {
  116|   597M|  switch (type) {
  117|  1.85M|  case objString:
  ------------------
  |  Branch (117:3): [True: 1.85M, False: 596M]
  ------------------
  118|  1.85M|    delete string;
  119|  1.85M|    break;
  120|  14.8M|  case objName:
  ------------------
  |  Branch (120:3): [True: 14.8M, False: 583M]
  ------------------
  121|  14.8M|    gfree(name);
  122|  14.8M|    break;
  123|  3.79M|  case objArray:
  ------------------
  |  Branch (123:3): [True: 3.79M, False: 594M]
  ------------------
  124|  3.79M|    if (!array->decRef()) {
  ------------------
  |  Branch (124:9): [True: 855k, False: 2.93M]
  ------------------
  125|   855k|      delete array;
  126|   855k|    }
  127|  3.79M|    break;
  128|  3.58M|  case objDict:
  ------------------
  |  Branch (128:3): [True: 3.58M, False: 594M]
  ------------------
  129|  3.58M|    if (!dict->decRef()) {
  ------------------
  |  Branch (129:9): [True: 838k, False: 2.74M]
  ------------------
  130|   838k|      delete dict;
  131|   838k|    }
  132|  3.58M|    break;
  133|  1.55M|  case objStream:
  ------------------
  |  Branch (133:3): [True: 1.55M, False: 596M]
  ------------------
  134|  1.55M|    delete stream;
  135|  1.55M|    break;
  136|  61.0M|  case objCmd:
  ------------------
  |  Branch (136:3): [True: 61.0M, False: 536M]
  ------------------
  137|  61.0M|    gfree(cmd);
  138|  61.0M|    break;
  139|   511M|  default:
  ------------------
  |  Branch (139:3): [True: 511M, False: 86.6M]
  ------------------
  140|   511M|    break;
  141|   597M|  }
  142|       |#ifdef DEBUG_OBJECT_MEM
  143|       |#if MULTITHREADED
  144|       |  gAtomicDecrement(&numAlloc[type]);
  145|       |#else
  146|       |  --numAlloc[type];
  147|       |#endif
  148|       |#endif
  149|   597M|  type = objNone;
  150|   597M|}
_ZN6Object11getTypeNameEv:
  152|   575k|const char *Object::getTypeName() {
  153|   575k|  return objTypeNames[type];
  154|   575k|}

_ZN6ObjectC2Ev:
   85|   605M|    type(objNone) {}
_ZN6Object8initNullEv:
   99|  89.9M|    { initObj(objNull); return this; }
  ------------------
  |  |   77|  89.9M|#define initObj(t) type = t
  ------------------
_ZN6Object8isStreamEv:
  134|  82.3M|  GBool isStream() { return type == objStream; }
_ZN6Object9getStreamEv:
  158|   899k|  Stream *getStream() { return stream; }
_ZN6Object8initBoolEi:
   89|  78.3k|    { initObj(objBool); booln = boolnA; return this; }
  ------------------
  |  |   77|  78.3k|#define initObj(t) type = t
  ------------------
_ZN6Object7initIntEi:
   91|  12.4M|    { initObj(objInt); intg = intgA; return this; }
  ------------------
  |  |   77|  12.4M|#define initObj(t) type = t
  ------------------
_ZN6Object8initRealEd:
   93|   526k|    { initObj(objReal); real = realA; return this; }
  ------------------
  |  |   77|   526k|#define initObj(t) type = t
  ------------------
_ZN6Object10initStringEP7GString:
   95|  1.08M|    { initObj(objString); string = stringA; return this; }
  ------------------
  |  |   77|  1.08M|#define initObj(t) type = t
  ------------------
_ZN6Object8initNameEPKc:
   97|  7.69M|    { initObj(objName); name = copyString(nameA); return this; }
  ------------------
  |  |   77|  7.69M|#define initObj(t) type = t
  ------------------
_ZN6Object7initRefEii:
  105|  1.05M|    { initObj(objRef); ref.num = numA; ref.gen = genA; return this; }
  ------------------
  |  |   77|  1.05M|#define initObj(t) type = t
  ------------------
_ZN6Object7initCmdEPc:
  107|  32.7M|    { initObj(objCmd); cmd = copyString(cmdA); return this; }
  ------------------
  |  |   77|  32.7M|#define initObj(t) type = t
  ------------------
_ZN6Object9initErrorEv:
  109|  2.66M|    { initObj(objError); return this; }
  ------------------
  |  |   77|  2.66M|#define initObj(t) type = t
  ------------------
_ZN6Object7initEOFEv:
  111|   194M|    { initObj(objEOF); return this; }
  ------------------
  |  |   77|   194M|#define initObj(t) type = t
  ------------------
_ZN6Object6isBoolEv:
  125|  36.5k|  GBool isBool() { return type == objBool; }
_ZN6Object5isIntEv:
  126|   330M|  GBool isInt() { return type == objInt; }
_ZN6Object5isNumEv:
  128|   868k|  GBool isNum() { return type == objInt || type == objReal; }
  ------------------
  |  Branch (128:26): [True: 410k, False: 458k]
  |  Branch (128:44): [True: 146k, False: 311k]
  ------------------
_ZN6Object8isStringEv:
  129|   219M|  GBool isString() { return type == objString; }
_ZN6Object6isNameEv:
  130|  18.3M|  GBool isName() { return type == objName; }
_ZN6Object6isNullEv:
  131|   992k|  GBool isNull() { return type == objNull; }
_ZN6Object7isArrayEv:
  132|  11.4M|  GBool isArray() { return type == objArray; }
_ZN6Object6isDictEv:
  133|  2.36M|  GBool isDict() { return type == objDict; }
_ZN6Object5isRefEv:
  135|  18.3M|  GBool isRef() { return type == objRef; }
_ZN6Object7isErrorEv:
  137|  3.18M|  GBool isError() { return type == objError; }
_ZN6Object5isEOFEv:
  138|  46.0M|  GBool isEOF() { return type == objEOF; }
_ZN6Object6isNoneEv:
  139|  3.98G|  GBool isNone() { return type == objNone; }
_ZN6Object6isNameEPKc:
  143|   749k|    { return type == objName && !strcmp(name, nameA); }
  ------------------
  |  Branch (143:14): [True: 651k, False: 98.0k]
  |  Branch (143:33): [True: 335k, False: 316k]
  ------------------
_ZN6Object5isCmdEPKc:
  147|   317M|    { return type == objCmd && !strcmp(cmd, cmdA); }
  ------------------
  |  Branch (147:14): [True: 72.7M, False: 244M]
  |  Branch (147:32): [True: 3.96M, False: 68.8M]
  ------------------
_ZN6Object7getBoolEv:
  150|  6.26k|  GBool getBool() { return booln; }
_ZN6Object6getIntEv:
  151|  7.30M|  int getInt() { return intg; }
_ZN6Object6getNumEv:
  153|   557k|  double getNum() { return type == objInt ? (double)intg : real; }
  ------------------
  |  Branch (153:28): [True: 410k, False: 146k]
  ------------------
_ZN6Object9getStringEv:
  154|   151k|  GString *getString() { return string; }
_ZN6Object7getNameEv:
  155|  3.28M|  char *getName() { return name; }
_ZN6Object8getArrayEv:
  156|    448|  Array *getArray() { return array; }
_ZN6Object7getDictEv:
  157|  1.48M|  Dict *getDict() { return dict; }
_ZN6Object6getRefEv:
  159|   674k|  Ref getRef() { return ref; }
_ZN6Object9getRefNumEv:
  160|  1.89M|  int getRefNum() { return ref.num; }
_ZN6Object9getRefGenEv:
  161|  1.18M|  int getRefGen() { return ref.gen; }
_ZN6Object14arrayGetLengthEv:
  233|  21.2M|  { return array->getLength(); }
_ZN6Object8arrayAddEPS_:
  236|  22.4M|  { array->add(elem); }
_ZN6Object8arrayGetEiPS_i:
  239|  1.81M|  { return array->get(i, obj, recursion); }
_ZN6Object10arrayGetNFEiPS_:
  242|  18.3M|  { return array->getNF(i, obj); }
_ZN6Object7dictAddEPcPS_:
  254|  3.14M|  { dict->add(key, val); }
_ZN6Object10dictLookupEPKcPS_i:
  263|  1.27M|  { return dict->lookup(key, obj, recursion); }
_ZN6Object12dictLookupNFEPKcPS_:
  266|  65.0k|  { return dict->lookupNF(key, obj); }
_ZN6Object11streamResetEv:
  290|   463k|  { stream->reset(); }
_ZN6Object11streamCloseEv:
  293|   455k|  { stream->close(); }
_ZN6Object13streamGetCharEv:
  296|  3.41G|  { return stream->getChar(); }
_ZN6Object14streamLookCharEv:
  299|   318M|  { return stream->lookChar(); }
_ZN6Object12streamGetPosEv:
  308|  58.5M|  { return stream->getPos(); }
_ZN6Object12streamSetPosEli:
  311|   103k|  { stream->setPos(pos, dir); }
_ZN6Object13streamGetDictEv:
  314|   789k|  { return stream->getDict(); }

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

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

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

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

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

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

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

_ZN6ParserC2EP4XRefP5Lexeri:
   22|   444k|Parser::Parser(XRef *xrefA, Lexer *lexerA, GBool allowStreamsA) {
   23|   444k|  xref = xrefA;
   24|   444k|  lexer = lexerA;
   25|   444k|  inlineImg = 0;
   26|   444k|  allowStreams = allowStreamsA;
   27|   444k|  lexer->getObj(&buf1);
   28|   444k|  lexer->getObj(&buf2);
   29|   444k|}
_ZN6ParserD2Ev:
   31|   444k|Parser::~Parser() {
   32|   444k|  buf1.free();
   33|   444k|  buf2.free();
   34|   444k|  delete lexer;
   35|   444k|}
_ZN6Parser6getObjEP6ObjectiPh14CryptAlgorithmiiii:
   40|   225M|		       int objNum, int objGen, int recursion) {
   41|   225M|  char *key;
   42|   225M|  Stream *str;
   43|   225M|  Object obj2;
   44|   225M|  int num;
   45|   225M|  DecryptStream *decrypt;
   46|   225M|  GString *s, *s2;
   47|   225M|  int c;
   48|       |
   49|       |  // refill buffer after inline image data
   50|   225M|  if (inlineImg == 2) {
  ------------------
  |  Branch (50:7): [True: 85.0k, False: 225M]
  ------------------
   51|  85.0k|    buf1.free();
   52|  85.0k|    buf2.free();
   53|  85.0k|    lexer->getObj(&buf1);
   54|  85.0k|    lexer->getObj(&buf2);
   55|  85.0k|    inlineImg = 0;
   56|  85.0k|  }
   57|       |
   58|       |  // array
   59|   225M|  if (!simpleOnly && recursion < objectRecursionLimit && buf1.isCmd("[")) {
  ------------------
  |  |   20|   251M|#define objectRecursionLimit 500
  ------------------
  |  Branch (59:7): [True: 25.7M, False: 199M]
  |  Branch (59:22): [True: 13.5M, False: 12.2M]
  |  Branch (59:58): [True: 856k, False: 12.6M]
  ------------------
   60|   856k|    shift();
   61|   856k|    obj->initArray(xref);
   62|  23.2M|    while (!buf1.isCmd("]") && !buf1.isEOF())
  ------------------
  |  Branch (62:12): [True: 22.9M, False: 300k]
  |  Branch (62:32): [True: 22.4M, False: 555k]
  ------------------
   63|  22.4M|      obj->arrayAdd(getObj(&obj2, gFalse, fileKey, encAlgorithm, keyLength,
  ------------------
  |  |   18|  22.4M|#define gFalse 0
  ------------------
   64|  22.4M|			   objNum, objGen, recursion + 1));
   65|   856k|    if (buf1.isEOF())
  ------------------
  |  Branch (65:9): [True: 555k, False: 300k]
  ------------------
   66|   555k|      error(errSyntaxError, getPos(), "End of file inside array");
   67|   856k|    shift();
   68|       |
   69|       |  // dictionary or stream
   70|   224M|  } else if (!simpleOnly && recursion < objectRecursionLimit &&
  ------------------
  |  |   20|   249M|#define objectRecursionLimit 500
  ------------------
  |  Branch (70:14): [True: 24.8M, False: 199M]
  |  Branch (70:29): [True: 12.6M, False: 12.2M]
  ------------------
   71|  12.6M|	     buf1.isCmd("<<")) {
  ------------------
  |  Branch (71:7): [True: 822k, False: 11.8M]
  ------------------
   72|   822k|    shift();
   73|   822k|    obj->initDict(xref);
   74|  18.9M|    while (!buf1.isCmd(">>") && !buf1.isEOF()) {
  ------------------
  |  Branch (74:12): [True: 18.2M, False: 667k]
  |  Branch (74:33): [True: 18.1M, False: 107k]
  ------------------
   75|  18.1M|      if (!buf1.isName()) {
  ------------------
  |  Branch (75:11): [True: 14.9M, False: 3.19M]
  ------------------
   76|  14.9M|	error(errSyntaxError, getPos(),
   77|  14.9M|	      "Dictionary key must be a name object");
   78|  14.9M|	shift();
   79|  14.9M|      } else {
   80|  3.19M|	key = copyString(buf1.getName());
   81|  3.19M|	shift();
   82|  3.19M|	if (buf1.isEOF() || buf1.isError()) {
  ------------------
  |  Branch (82:6): [True: 3.65k, False: 3.18M]
  |  Branch (82:22): [True: 44.9k, False: 3.14M]
  ------------------
   83|  48.5k|	  gfree(key);
   84|  48.5k|	  break;
   85|  48.5k|	}
   86|  3.14M|	obj->dictAdd(key, getObj(&obj2, gFalse,
  ------------------
  |  |   18|  3.14M|#define gFalse 0
  ------------------
   87|  3.14M|				 fileKey, encAlgorithm, keyLength,
   88|  3.14M|				 objNum, objGen, recursion + 1));
   89|  3.14M|      }
   90|  18.1M|    }
   91|   822k|    if (buf1.isEOF())
  ------------------
  |  Branch (91:9): [True: 110k, False: 711k]
  ------------------
   92|   110k|      error(errSyntaxError, getPos(), "End of file inside dictionary");
   93|       |    // stream objects are not allowed inside content streams or
   94|       |    // object streams
   95|   822k|    if (allowStreams && buf2.isCmd("stream")) {
  ------------------
  |  Branch (95:9): [True: 399k, False: 423k]
  |  Branch (95:25): [True: 133k, False: 266k]
  ------------------
   96|   133k|      if ((str = makeStream(obj, fileKey, encAlgorithm, keyLength,
  ------------------
  |  Branch (96:11): [True: 122k, False: 11.2k]
  ------------------
   97|   133k|			    objNum, objGen, recursion + 1))) {
   98|   122k|	obj->initStream(str);
   99|   122k|      } else {
  100|  11.2k|	obj->free();
  101|  11.2k|	obj->initError();
  102|  11.2k|      }
  103|   689k|    } else {
  104|   689k|      shift();
  105|   689k|    }
  106|       |
  107|       |  // indirect reference or integer
  108|   223M|  } else if (buf1.isInt()) {
  ------------------
  |  Branch (108:14): [True: 5.25M, False: 218M]
  ------------------
  109|  5.25M|    num = buf1.getInt();
  110|  5.25M|    shift();
  111|  5.25M|    if (buf1.isInt() && buf2.isCmd("R")) {
  ------------------
  |  Branch (111:9): [True: 2.29M, False: 2.95M]
  |  Branch (111:25): [True: 752k, False: 1.54M]
  ------------------
  112|   752k|      int gen = buf1.getInt();
  113|   752k|      if (num >= 0 && gen >= 0) {
  ------------------
  |  Branch (113:11): [True: 749k, False: 2.76k]
  |  Branch (113:23): [True: 748k, False: 1.03k]
  ------------------
  114|   748k|	obj->initRef(num, gen);
  115|   748k|      } else {
  116|  3.79k|	error(errSyntaxError, getPos(),
  117|  3.79k|	      "Negative number or generation in indirect reference");
  118|  3.79k|	obj->initError();
  119|  3.79k|      }
  120|   752k|      shift();
  121|   752k|      shift();
  122|  4.50M|    } else {
  123|  4.50M|      obj->initInt(num);
  124|  4.50M|    }
  125|       |
  126|       |  // string
  127|   218M|  } else if (buf1.isString() && fileKey) {
  ------------------
  |  Branch (127:14): [True: 548k, False: 217M]
  |  Branch (127:33): [True: 31.4k, False: 517k]
  ------------------
  128|  31.4k|    s = buf1.getString();
  129|  31.4k|    s2 = new GString();
  130|  31.4k|    obj2.initNull();
  131|  31.4k|    decrypt = new DecryptStream(new MemStream(s->getCString(), 0,
  132|  31.4k|					      s->getLength(), &obj2),
  133|  31.4k|				fileKey, encAlgorithm, keyLength,
  134|  31.4k|				objNum, objGen);
  135|  31.4k|    decrypt->reset();
  136|  1.47M|    while ((c = decrypt->getChar()) != EOF) {
  ------------------
  |  Branch (136:12): [True: 1.44M, False: 31.4k]
  ------------------
  137|  1.44M|      s2->append((char)c);
  138|  1.44M|    }
  139|  31.4k|    delete decrypt;
  140|  31.4k|    obj->initString(s2);
  141|  31.4k|    shift();
  142|       |
  143|       |  // simple object
  144|   218M|  } else {
  145|   218M|    buf1.copy(obj);
  146|   218M|    shift();
  147|   218M|  }
  148|       |
  149|   225M|  return obj;
  150|   225M|}
_ZN6Parser10makeStreamEP6ObjectPh14CryptAlgorithmiiii:
  154|   133k|			   int objNum, int objGen, int recursion) {
  155|       |  // get stream start position
  156|   133k|  lexer->skipToNextLine();
  157|   133k|  Stream *curStr = lexer->getStream();
  158|   133k|  if (!curStr) {
  ------------------
  |  Branch (158:7): [True: 3.87k, False: 129k]
  ------------------
  159|  3.87k|    return NULL;
  160|  3.87k|  }
  161|   129k|  GFileOffset pos = curStr->getPos();
  162|       |
  163|   129k|  GBool haveLength = gFalse;
  ------------------
  |  |   18|   129k|#define gFalse 0
  ------------------
  164|   129k|  GFileOffset length = 0;
  165|   129k|  GFileOffset endPos;
  166|       |
  167|       |  // check for length in damaged file
  168|   129k|  if (xref && xref->getStreamEnd(pos, &endPos)) {
  ------------------
  |  Branch (168:7): [True: 128k, False: 896]
  |  Branch (168:15): [True: 52.8k, False: 76.0k]
  ------------------
  169|  52.8k|    length = endPos - pos;
  170|  52.8k|    haveLength = gTrue;
  ------------------
  |  |   17|  52.8k|#define gTrue 1
  ------------------
  171|       |
  172|       |  // get length from the stream object
  173|  76.9k|  } else {
  174|  76.9k|    Object obj;
  175|  76.9k|    dict->dictLookup("Length", &obj, recursion);
  176|  76.9k|    if (obj.isInt()) {
  ------------------
  |  Branch (176:9): [True: 51.0k, False: 25.8k]
  ------------------
  177|  51.0k|      length = (GFileOffset)(Guint)obj.getInt();
  178|  51.0k|      haveLength = gTrue;
  ------------------
  |  |   17|  51.0k|#define gTrue 1
  ------------------
  179|  51.0k|    } else {
  180|  25.8k|      error(errSyntaxError, getPos(),
  181|  25.8k|	    "Missing or invalid 'Length' attribute in stream");
  182|  25.8k|    }
  183|  76.9k|    obj.free();
  184|  76.9k|  }
  185|       |
  186|       |  // in badly damaged PDF files, we can run off the end of the input
  187|       |  // stream immediately after the "stream" token
  188|   129k|  if (!lexer->getStream()) {
  ------------------
  |  Branch (188:7): [True: 0, False: 129k]
  ------------------
  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|   129k|  BaseStream *baseStr =
  195|   129k|      (BaseStream *)lexer->getStream()->getBaseStream()->copy();
  196|       |
  197|       |  // 'Length' attribute is missing -- search for 'endstream'
  198|   129k|  if (!haveLength) {
  ------------------
  |  Branch (198:7): [True: 25.8k, False: 103k]
  ------------------
  199|  25.8k|    GBool foundEndstream = gFalse;
  ------------------
  |  |   18|  25.8k|#define gFalse 0
  ------------------
  200|  25.8k|    char endstreamBuf[8];
  201|  25.8k|    if ((curStr = lexer->getStream())) {
  ------------------
  |  Branch (201:9): [True: 25.8k, False: 0]
  ------------------
  202|  25.8k|      int c;
  203|  8.46M|      while ((c = curStr->getChar()) != EOF) {
  ------------------
  |  Branch (203:14): [True: 8.45M, False: 7.34k]
  ------------------
  204|  8.45M|	if (c == 'e' &&
  ------------------
  |  Branch (204:6): [True: 315k, False: 8.14M]
  ------------------
  205|   315k|	    curStr->getBlock(endstreamBuf, 8) == 8 &&
  ------------------
  |  Branch (205:6): [True: 313k, False: 1.44k]
  ------------------
  206|   313k|	    !memcmp(endstreamBuf, "ndstream", 8)) {
  ------------------
  |  Branch (206:6): [True: 18.5k, False: 295k]
  ------------------
  207|  18.5k|	  length = curStr->getPos() - 9 - pos;
  208|  18.5k|	  foundEndstream = gTrue;
  ------------------
  |  |   17|  18.5k|#define gTrue 1
  ------------------
  209|  18.5k|	  break;
  210|  18.5k|	}
  211|  8.45M|      }
  212|  25.8k|    }
  213|  25.8k|    if (!foundEndstream) {
  ------------------
  |  Branch (213:9): [True: 7.34k, False: 18.5k]
  ------------------
  214|  7.34k|      error(errSyntaxError, getPos(), "Couldn't find 'endstream' for stream");
  215|  7.34k|      delete baseStr;
  216|  7.34k|      return NULL;
  217|  7.34k|    }
  218|  25.8k|  }
  219|       |
  220|       |  // make new base stream
  221|   122k|  Stream *str = baseStr->makeSubStream(pos, gTrue, length, dict);
  ------------------
  |  |   17|   122k|#define gTrue 1
  ------------------
  222|       |
  223|       |  // look for the 'endstream' marker
  224|   122k|  if (haveLength) {
  ------------------
  |  Branch (224:7): [True: 103k, False: 18.5k]
  ------------------
  225|       |    // skip over stream data
  226|   103k|    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|   103k|    GBool foundEndstream = gFalse;
  ------------------
  |  |   18|   103k|#define gFalse 0
  ------------------
  235|   103k|    char endstreamBuf[8];
  236|   103k|    if ((curStr = lexer->getStream())) {
  ------------------
  |  Branch (236:9): [True: 103k, False: 0]
  ------------------
  237|       |      // skip up to 100 whitespace chars
  238|   103k|      int c;
  239|   226k|      for (int i = 0; i < 100; ++i) {
  ------------------
  |  Branch (239:23): [True: 224k, False: 1.08k]
  ------------------
  240|   224k|	c = curStr->getChar();
  241|   224k|	if (!Lexer::isSpace(c)) {
  ------------------
  |  Branch (241:6): [True: 102k, False: 122k]
  ------------------
  242|   102k|	  break;
  243|   102k|	}
  244|   224k|      }
  245|   103k|      if (c == 'e') {
  ------------------
  |  Branch (245:11): [True: 55.5k, False: 48.4k]
  ------------------
  246|  55.5k|	if (curStr->getBlock(endstreamBuf, 8) == 8 &&
  ------------------
  |  Branch (246:6): [True: 55.1k, False: 323]
  ------------------
  247|  55.1k|	    !memcmp(endstreamBuf, "ndstream", 8)) {
  ------------------
  |  Branch (247:6): [True: 53.0k, False: 2.17k]
  ------------------
  248|  53.0k|	  foundEndstream = gTrue;
  ------------------
  |  |   17|  53.0k|#define gTrue 1
  ------------------
  249|  53.0k|	}
  250|  55.5k|      }
  251|   103k|    }
  252|   103k|    if (!foundEndstream) {
  ------------------
  |  Branch (252:9): [True: 50.9k, False: 53.0k]
  ------------------
  253|  50.9k|      error(errSyntaxError, getPos(), "Missing 'endstream'");
  254|       |      // kludge for broken PDF files: just add 5k to the length, and
  255|       |      // hope it's enough
  256|       |      // (dict is now owned by str, so we need to copy it before deleting str)
  257|  50.9k|      Object obj;
  258|  50.9k|      dict->copy(&obj);
  259|  50.9k|      delete str;
  260|  50.9k|      length += 5000;
  261|  50.9k|      str = baseStr->makeSubStream(pos, gTrue, length, &obj);
  ------------------
  |  |   17|  50.9k|#define gTrue 1
  ------------------
  262|  50.9k|    }
  263|   103k|  }
  264|       |
  265|       |  // free the copied base stream
  266|   122k|  delete baseStr;
  267|       |
  268|       |  // handle decryption
  269|   122k|  if (fileKey) {
  ------------------
  |  Branch (269:7): [True: 6.69k, False: 115k]
  ------------------
  270|       |    // the 'Crypt' filter is used to mark unencrypted metadata streams
  271|       |    //~ this should also check for an empty DecodeParams entry
  272|  6.69k|    GBool encrypted = gTrue;
  ------------------
  |  |   17|  6.69k|#define gTrue 1
  ------------------
  273|  6.69k|    Object obj;
  274|  6.69k|    dict->dictLookup("Filter", &obj, recursion);
  275|  6.69k|    if (obj.isName("Crypt")) {
  ------------------
  |  Branch (275:9): [True: 322, False: 6.36k]
  ------------------
  276|    322|      encrypted = gFalse;
  ------------------
  |  |   18|    322|#define gFalse 0
  ------------------
  277|  6.36k|    } else if (obj.isArray() && obj.arrayGetLength() >= 1) {
  ------------------
  |  Branch (277:16): [True: 2.28k, False: 4.08k]
  |  Branch (277:33): [True: 1.00k, False: 1.27k]
  ------------------
  278|  1.00k|      Object obj2;
  279|  1.00k|      if (obj.arrayGet(0, &obj2)->isName("Crypt")) {
  ------------------
  |  Branch (279:11): [True: 0, False: 1.00k]
  ------------------
  280|      0|	encrypted = gFalse;
  ------------------
  |  |   18|      0|#define gFalse 0
  ------------------
  281|      0|      }
  282|  1.00k|      obj2.free();
  283|  1.00k|    }
  284|  6.69k|    obj.free();
  285|  6.69k|    if (encrypted) {
  ------------------
  |  Branch (285:9): [True: 6.36k, False: 322]
  ------------------
  286|  6.36k|      str = new DecryptStream(str, fileKey, encAlgorithm, keyLength,
  287|  6.36k|			      objNum, objGen);
  288|  6.36k|    }
  289|  6.69k|  }
  290|       |
  291|       |  // get filters
  292|   122k|  str = str->addFilters(dict, recursion);
  293|       |
  294|   122k|  return str;
  295|   129k|}
_ZN6Parser5shiftEv:
  297|   246M|void Parser::shift() {
  298|   246M|  if (inlineImg > 0) {
  ------------------
  |  Branch (298:7): [True: 560k, False: 246M]
  ------------------
  299|   560k|    if (inlineImg < 2) {
  ------------------
  |  Branch (299:9): [True: 322k, False: 237k]
  ------------------
  300|   322k|      ++inlineImg;
  301|   322k|    } 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|   246M|  } else if (buf2.isCmd("ID")) {
  ------------------
  |  Branch (306:14): [True: 322k, False: 245M]
  ------------------
  307|   322k|    lexer->skipChar();		// skip char after 'ID' command
  308|   322k|    inlineImg = 1;
  309|   322k|  }
  310|   246M|  buf1.free();
  311|   246M|  buf1 = buf2;
  312|   246M|  if (inlineImg > 0)		// don't buffer inline image data
  ------------------
  |  Branch (312:7): [True: 645k, False: 245M]
  ------------------
  313|   645k|    buf2.initNull();
  314|   245M|  else
  315|   245M|    lexer->getObj(&buf2);
  316|   246M|}

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

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

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

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

_ZN10BaseStream13getBaseStreamEv:
  178|   129k|  virtual BaseStream *getBaseStream() { return this; }
_ZN10BaseStream7getDictEv:
  180|   789k|  virtual Dict *getDict() { return dict.getDict(); }
_ZN10BaseStream11getFileNameEv:
  181|  16.2k|  virtual GString *getFileName() { return NULL; }
_ZN12FilterStream6getPosEv:
  206|  35.7M|  virtual GFileOffset getPos() { return str->getPos(); }
_ZN12FilterStream7getDictEv:
  210|   596k|  virtual Dict *getDict() { return str->getDict(); }
_ZN15StreamPredictor4isOkEv:
  277|  14.9k|  GBool isOk() { return ok; }
_ZN15StreamPredictor12getPredictorEv:
  285|  9.36k|  int getPredictor() { return predictor; }
_ZN15StreamPredictor8getWidthEv:
  286|  9.36k|  int getWidth() { return width; }
_ZN15StreamPredictor9getNCompsEv:
  287|  9.36k|  int getNComps() { return nComps; }
_ZN15StreamPredictor8getNBitsEv:
  288|  9.36k|  int getNBits() { return nBits; }
_ZN9MemStream7getCharEv:
  366|   806M|    { return (bufPtr < bufEnd) ? (*bufPtr++ & 0xff) : EOF; }
  ------------------
  |  Branch (366:14): [True: 710M, False: 95.4M]
  ------------------
_ZN9MemStream8lookCharEv:
  368|   167M|    { return (bufPtr < bufEnd) ? (*bufPtr & 0xff) : EOF; }
  ------------------
  |  Branch (368:14): [True: 167M, False: 16.4k]
  ------------------
_ZN9MemStream6getPosEv:
  370|   129M|  virtual GFileOffset getPos() { return (GFileOffset)(bufPtr - buf); }
_ZN9MemStream8getStartEv:
  372|  32.4k|  virtual GFileOffset getStart() { return start; }
_ZN11EmbedStream5resetEv:
  405|  55.8k|  virtual void reset() {}
_ZN11EmbedStream6getPosEv:
  409|  55.6k|  virtual GFileOffset getPos() { return str->getPos(); }
_ZN14ASCIIHexStream7getCharEv:
  434|   128k|    { int c = lookChar(); buf = EOF; return c; }
_ZN13ASCII85Stream7getCharEv:
  459|  4.66M|    { int ch = lookChar(); ++index; return ch; }
_ZN15RunLengthStream7getCharEv:
  538|  15.6M|    { return (bufPtr >= bufEnd && !fillBuf()) ? EOF : (*bufPtr++ & 0xff); }
  ------------------
  |  Branch (538:15): [True: 1.67M, False: 13.9M]
  |  Branch (538:35): [True: 1.24M, False: 434k]
  ------------------
_ZN15RunLengthStream8lookCharEv:
  540|   571k|    { return (bufPtr >= bufEnd && !fillBuf()) ? EOF : (*bufPtr & 0xff); }
  ------------------
  |  Branch (540:15): [True: 10.2k, False: 561k]
  |  Branch (540:35): [True: 1.00k, False: 9.25k]
  ------------------
_ZN14CCITTFaxStream7eatBitsEi:
  609|   101M|  void eatBits(int n) { if ((inputBits -= n) < 0) inputBits = 0; }
  ------------------
  |  Branch (609:29): [True: 6.59k, False: 101M]
  ------------------
_ZN9EOFStream5resetEv:
  873|  3.17k|  virtual void reset() {}
_ZN9EOFStream7getCharEv:
  874|  1.97k|  virtual int getChar() { return EOF; }
_ZN9EOFStream8getBlockEPci:
  876|    349|  virtual int getBlock(char *blk, int size) { return 0; }

_ZN10TextStringC2Ev:
   21|  1.07M|TextString::TextString() {
   22|       |  u = NULL;
   23|  1.07M|  len = size = 0;
   24|  1.07M|}
_ZN10TextStringC2EP7GString:
   26|  75.1k|TextString::TextString(GString *s) {
   27|       |  u = NULL;
   28|  75.1k|  len = size = 0;
   29|  75.1k|  append(s);
   30|  75.1k|}
_ZN10TextStringC2EPS_:
   32|  83.2k|TextString::TextString(TextString *s) {
   33|  83.2k|  len = size = s->len;
   34|  83.2k|  if (len) {
  ------------------
  |  Branch (34:7): [True: 7.24k, False: 76.0k]
  ------------------
   35|  7.24k|    u = (Unicode *)gmallocn(size, sizeof(Unicode));
   36|  7.24k|    memcpy(u, s->u, len * sizeof(Unicode));
   37|  76.0k|  } else {
   38|       |    u = NULL;
   39|  76.0k|  }
   40|  83.2k|}
_ZN10TextStringD2Ev:
   42|  1.23M|TextString::~TextString() {
   43|  1.23M|  gfree(u);
   44|  1.23M|}
_ZN10TextString6appendEP7GString:
   53|  75.1k|TextString *TextString::append(GString *s) {
   54|  75.1k|  return insert(len, s);
   55|  75.1k|}
_ZN10TextString6insertEij:
   57|  41.8k|TextString *TextString::insert(int idx, Unicode c) {
   58|  41.8k|  if (idx >= 0 && idx <= len) {
  ------------------
  |  Branch (58:7): [True: 41.8k, False: 0]
  |  Branch (58:19): [True: 41.8k, False: 0]
  ------------------
   59|  41.8k|    expand(1);
   60|  41.8k|    if (idx < len) {
  ------------------
  |  Branch (60:9): [True: 41.8k, False: 0]
  ------------------
   61|  41.8k|      memmove(u + idx + 1, u + idx, (len - idx) * sizeof(Unicode));
   62|  41.8k|    }
   63|  41.8k|    u[idx] = c;
   64|  41.8k|    ++len;
   65|  41.8k|  }
   66|  41.8k|  return this;
   67|  41.8k|}
_ZN10TextString6insertEiPji:
   69|   325k|TextString *TextString::insert(int idx, Unicode *u2, int n) {
   70|   325k|  if (idx >= 0 && idx <= len) {
  ------------------
  |  Branch (70:7): [True: 325k, False: 0]
  |  Branch (70:19): [True: 325k, False: 0]
  ------------------
   71|   325k|    expand(n);
   72|   325k|    if (idx < len) {
  ------------------
  |  Branch (72:9): [True: 118k, False: 207k]
  ------------------
   73|   118k|      memmove(u + idx + n, u + idx, (len - idx) * sizeof(Unicode));
   74|   118k|    }
   75|   325k|    memcpy(u + idx, u2, n * sizeof(Unicode));
   76|   325k|    len += n;
   77|   325k|  }
   78|   325k|  return this;
   79|   325k|}
_ZN10TextString6insertEiP7GString:
   81|   117k|TextString *TextString::insert(int idx, GString *s) {
   82|   117k|  Unicode uBuf[100];
   83|   117k|  int n, i;
   84|       |
   85|   117k|  if (idx >= 0 && idx <= len) {
  ------------------
  |  Branch (85:7): [True: 117k, False: 0]
  |  Branch (85:19): [True: 117k, False: 0]
  ------------------
   86|       |    // look for a UTF-16BE BOM
   87|   117k|    if ((s->getChar(0) & 0xff) == 0xfe &&
  ------------------
  |  Branch (87:9): [True: 31.1k, False: 86.3k]
  ------------------
   88|  31.1k|	(s->getChar(1) & 0xff) == 0xff) {
  ------------------
  |  Branch (88:2): [True: 30.2k, False: 974]
  ------------------
   89|  30.2k|      i = 2;
   90|  30.2k|      n = 0;
   91|  3.87M|      while (getUTF16BE(s, &i, uBuf + n)) {
  ------------------
  |  Branch (91:14): [True: 3.84M, False: 30.2k]
  ------------------
   92|  3.84M|	++n;
   93|  3.84M|	if (n == sizeof(uBuf) / sizeof(Unicode)) {
  ------------------
  |  Branch (93:6): [True: 32.0k, False: 3.80M]
  ------------------
   94|  32.0k|	  insert(idx, uBuf, n);
   95|  32.0k|	  idx += n;
   96|  32.0k|	  n = 0;
   97|  32.0k|	}
   98|  3.84M|      }
   99|  30.2k|      if (n > 0) {
  ------------------
  |  Branch (99:11): [True: 29.8k, False: 333]
  ------------------
  100|  29.8k|	insert(idx, uBuf, n);
  101|  29.8k|      }
  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.2k|    } else if ((s->getChar(0) & 0xff) == 0xff &&
  ------------------
  |  Branch (106:16): [True: 60.2k, False: 27.0k]
  ------------------
  107|  60.2k|	       (s->getChar(1) & 0xff) == 0xfe) {
  ------------------
  |  Branch (107:9): [True: 59.7k, False: 536]
  ------------------
  108|  59.7k|      i = 2;
  109|  59.7k|      n = 0;
  110|  13.8M|      while (getUTF16LE(s, &i, uBuf + n)) {
  ------------------
  |  Branch (110:14): [True: 13.8M, False: 59.7k]
  ------------------
  111|  13.8M|	++n;
  112|  13.8M|	if (n == sizeof(uBuf) / sizeof(Unicode)) {
  ------------------
  |  Branch (112:6): [True: 132k, False: 13.6M]
  ------------------
  113|   132k|	  insert(idx, uBuf, n);
  114|   132k|	  idx += n;
  115|   132k|	  n = 0;
  116|   132k|	}
  117|  13.8M|      }
  118|  59.7k|      if (n > 0) {
  ------------------
  |  Branch (118:11): [True: 13.8k, False: 45.9k]
  ------------------
  119|  13.8k|	insert(idx, uBuf, n);
  120|  13.8k|      }
  121|       |
  122|       |    // look for a UTF-8 BOM
  123|  59.7k|    } else if ((s->getChar(0) & 0xff) == 0xef &&
  ------------------
  |  Branch (123:16): [True: 2.65k, False: 24.8k]
  ------------------
  124|  2.65k|	       (s->getChar(1) & 0xff) == 0xbb &&
  ------------------
  |  Branch (124:9): [True: 2.07k, False: 578]
  ------------------
  125|  2.07k|	       (s->getChar(2) & 0xff) == 0xbf) {
  ------------------
  |  Branch (125:9): [True: 1.86k, False: 217]
  ------------------
  126|  1.86k|      i = 3;
  127|  1.86k|      n = 0;
  128|  11.7M|      while (getUTF8(s, &i, uBuf + n)) {
  ------------------
  |  Branch (128:14): [True: 11.7M, False: 1.86k]
  ------------------
  129|  11.7M|	++n;
  130|  11.7M|	if (n == sizeof(uBuf) / sizeof(Unicode)) {
  ------------------
  |  Branch (130:6): [True: 115k, False: 11.5M]
  ------------------
  131|   115k|	  insert(idx, uBuf, n);
  132|   115k|	  idx += n;
  133|   115k|	  n = 0;
  134|   115k|	}
  135|  11.7M|      }
  136|  1.86k|      if (n > 0) {
  ------------------
  |  Branch (136:11): [True: 1.58k, False: 281]
  ------------------
  137|  1.58k|	insert(idx, uBuf, n);
  138|  1.58k|      }
  139|       |
  140|       |    // otherwise, use PDFDocEncoding
  141|  25.6k|    } else {
  142|  25.6k|      n = s->getLength();
  143|  25.6k|      expand(n);
  144|  25.6k|      if (idx < len) {
  ------------------
  |  Branch (144:11): [True: 13.8k, False: 11.8k]
  ------------------
  145|  13.8k|	memmove(u + idx + n, u + idx, (len - idx) * sizeof(Unicode));
  146|  13.8k|      }
  147|  23.9M|      for (i = 0; i < n; ++i) {
  ------------------
  |  Branch (147:19): [True: 23.8M, False: 25.6k]
  ------------------
  148|  23.8M|	u[idx + i] = pdfDocEncoding[s->getChar(i) & 0xff];
  149|  23.8M|      }
  150|  25.6k|      len += n;
  151|  25.6k|    }
  152|   117k|  }
  153|   117k|  return this;
  154|   117k|}
_ZN10TextString6expandEi:
  156|   393k|void TextString::expand(int delta) {
  157|   393k|  int newLen;
  158|       |
  159|   393k|  newLen = len + delta;
  160|   393k|  if (delta > INT_MAX - len) {
  ------------------
  |  Branch (160:7): [True: 0, False: 393k]
  ------------------
  161|       |    // trigger an out-of-memory error
  162|      0|    size = -1;
  163|   393k|  } else if (newLen <= size) {
  ------------------
  |  Branch (163:14): [True: 320k, False: 72.9k]
  ------------------
  164|   320k|    return;
  165|   320k|  } else if (size > 0 && size <= INT_MAX / 2 && size*2 >= newLen) {
  ------------------
  |  Branch (165:14): [True: 45.1k, False: 27.7k]
  |  Branch (165:26): [True: 45.1k, False: 0]
  |  Branch (165:49): [True: 44.3k, False: 765]
  ------------------
  166|  44.3k|    size *= 2;
  167|  44.3k|  } else {
  168|  28.5k|    size = newLen;
  169|  28.5k|  }
  170|  72.9k|  u = (Unicode *)greallocn(u, size, sizeof(Unicode));
  171|  72.9k|}
_ZN10TextString6toUTF8Ev:
  201|    163|GString *TextString::toUTF8() {
  202|    163|  GString *s = new GString();
  203|  64.7k|  for (int i = 0; i < len; ++i) {
  ------------------
  |  Branch (203:19): [True: 64.5k, False: 163]
  ------------------
  204|  64.5k|    char buf[8];
  205|  64.5k|    int n = mapUTF8(u[i], buf, sizeof(buf));
  206|  64.5k|    s->append(buf, n);
  207|  64.5k|  }
  208|    163|  return s;
  209|    163|}

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

_Z7mapUTF8jPci:
   12|  64.5k|int mapUTF8(Unicode u, char *buf, int bufSize) {
   13|  64.5k|  if        (u <= 0x0000007f) {
  ------------------
  |  Branch (13:14): [True: 60.2k, False: 4.35k]
  ------------------
   14|  60.2k|    if (bufSize < 1) {
  ------------------
  |  Branch (14:9): [True: 0, False: 60.2k]
  ------------------
   15|      0|      return 0;
   16|      0|    }
   17|  60.2k|    buf[0] = (char)u;
   18|  60.2k|    return 1;
   19|  60.2k|  } else if (u <= 0x000007ff) {
  ------------------
  |  Branch (19:14): [True: 1.53k, False: 2.81k]
  ------------------
   20|  1.53k|    if (bufSize < 2) {
  ------------------
  |  Branch (20:9): [True: 0, False: 1.53k]
  ------------------
   21|      0|      return 0;
   22|      0|    }
   23|  1.53k|    buf[0] = (char)(0xc0 + (u >> 6));
   24|  1.53k|    buf[1] = (char)(0x80 + (u & 0x3f));
   25|  1.53k|    return 2;
   26|  2.81k|  } else if (u <= 0x0000ffff) {
  ------------------
  |  Branch (26:14): [True: 2.60k, False: 207]
  ------------------
   27|  2.60k|    if (bufSize < 3) {
  ------------------
  |  Branch (27:9): [True: 0, False: 2.60k]
  ------------------
   28|      0|      return 0;
   29|      0|    }
   30|  2.60k|    buf[0] = (char)(0xe0 + (u >> 12));
   31|  2.60k|    buf[1] = (char)(0x80 + ((u >> 6) & 0x3f));
   32|  2.60k|    buf[2] = (char)(0x80 + (u & 0x3f));
   33|  2.60k|    return 3;
   34|  2.60k|  } else if (u <= 0x0010ffff) {
  ------------------
  |  Branch (34:14): [True: 101, False: 106]
  ------------------
   35|    101|    if (bufSize < 4) {
  ------------------
  |  Branch (35:9): [True: 0, False: 101]
  ------------------
   36|      0|      return 0;
   37|      0|    }
   38|    101|    buf[0] = (char)(0xf0 + (u >> 18));
   39|    101|    buf[1] = (char)(0x80 + ((u >> 12) & 0x3f));
   40|    101|    buf[2] = (char)(0x80 + ((u >> 6) & 0x3f));
   41|    101|    buf[3] = (char)(0x80 + (u & 0x3f));
   42|    101|    return 4;
   43|    106|  } else {
   44|    106|    return 0;
   45|    106|  }
   46|  64.5k|}
_Z7getUTF8P7GStringPiPj:
   61|  11.7M|GBool getUTF8(GString *s, int *i, Unicode *u) {
   62|  11.7M|  Guchar c0, c1, c2, c3, c4, c5;
   63|       |
   64|  11.7M|  if (*i >= s->getLength()) {
  ------------------
  |  Branch (64:7): [True: 1.86k, False: 11.7M]
  ------------------
   65|  1.86k|    return gFalse;
  ------------------
  |  |   18|  1.86k|#define gFalse 0
  ------------------
   66|  1.86k|  }
   67|  11.7M|  c0 = (Guchar)s->getChar((*i)++);
   68|  11.7M|  if (c0 < 0x80) {
  ------------------
  |  Branch (68:7): [True: 9.19M, False: 2.51M]
  ------------------
   69|  9.19M|    *u = (Unicode)c0;
   70|  9.19M|  } else if (c0 < 0xe0) {
  ------------------
  |  Branch (70:14): [True: 1.63M, False: 878k]
  ------------------
   71|  1.63M|    if (*i < s->getLength() &&
  ------------------
  |  Branch (71:9): [True: 1.63M, False: 353]
  ------------------
   72|  1.63M|	((c1 = (Guchar)s->getChar(*i)) & 0xc0) == 0x80) {
  ------------------
  |  Branch (72:2): [True: 500k, False: 1.13M]
  ------------------
   73|   500k|      *i += 1;
   74|   500k|      *u = (Unicode)(((c0 & 0x1f) << 6) |
   75|   500k|		     (c1 & 0x3f));
   76|  1.13M|    } else {
   77|  1.13M|      *u =  (Unicode)c0;
   78|  1.13M|    }
   79|  1.63M|  } else if (c0 < 0xf0) {
  ------------------
  |  Branch (79:14): [True: 272k, False: 605k]
  ------------------
   80|   272k|    if (*i < s->getLength() - 1 &&
  ------------------
  |  Branch (80:9): [True: 271k, False: 711]
  ------------------
   81|   271k|	((c1 = (Guchar)s->getChar(*i)) & 0xc0) == 0x80 &&
  ------------------
  |  Branch (81:2): [True: 40.4k, False: 231k]
  ------------------
   82|  40.4k|	((c2 = (Guchar)s->getChar(*i + 1)) & 0xc0) == 0x80) {
  ------------------
  |  Branch (82:2): [True: 10.7k, False: 29.6k]
  ------------------
   83|  10.7k|      *i += 2;
   84|  10.7k|      *u = (Unicode)(((c0 & 0x0f) << 12) |
   85|  10.7k|		     ((c1 & 0x3f) << 6) |
   86|  10.7k|		     (c2 & 0x3f));
   87|   261k|    } else {
   88|   261k|      *u = (Unicode)c0;
   89|   261k|    }
   90|   605k|  } else if (c0 < 0xf8) {
  ------------------
  |  Branch (90:14): [True: 92.5k, False: 513k]
  ------------------
   91|  92.5k|    if (*i < s->getLength() - 2 &&
  ------------------
  |  Branch (91:9): [True: 92.1k, False: 362]
  ------------------
   92|  92.1k|	((c1 = (Guchar)s->getChar(*i)) & 0xc0) == 0x80 &&
  ------------------
  |  Branch (92:2): [True: 32.8k, False: 59.2k]
  ------------------
   93|  32.8k|	((c2 = (Guchar)s->getChar(*i + 1)) & 0xc0) == 0x80 &&
  ------------------
  |  Branch (93:2): [True: 10.5k, False: 22.3k]
  ------------------
   94|  10.5k|	((c3 = (Guchar)s->getChar(*i + 2)) & 0xc0) == 0x80) {
  ------------------
  |  Branch (94:2): [True: 7.56k, False: 2.98k]
  ------------------
   95|  7.56k|      *i += 3;
   96|  7.56k|      *u = (Unicode)(((c0 & 0x07) << 18) |
   97|  7.56k|		     ((c1 & 0x3f) << 12) |
   98|  7.56k|		     ((c2 & 0x3f) << 6) |
   99|  7.56k|		     (c3 & 0x3f));
  100|  84.9k|    } else {
  101|  84.9k|      *u = (Unicode)c0;
  102|  84.9k|    }
  103|   513k|  } else if (c0 < 0xfc) {
  ------------------
  |  Branch (103:14): [True: 23.6k, False: 489k]
  ------------------
  104|  23.6k|    if (*i < s->getLength() - 3 &&
  ------------------
  |  Branch (104:9): [True: 23.2k, False: 346]
  ------------------
  105|  23.2k|	((c1 = (Guchar)s->getChar(*i)) & 0xc0) == 0x80 &&
  ------------------
  |  Branch (105:2): [True: 7.37k, False: 15.9k]
  ------------------
  106|  7.37k|	((c2 = (Guchar)s->getChar(*i + 1)) & 0xc0) == 0x80 &&
  ------------------
  |  Branch (106:2): [True: 5.74k, False: 1.63k]
  ------------------
  107|  5.74k|	((c3 = (Guchar)s->getChar(*i + 2)) & 0xc0) == 0x80 &&
  ------------------
  |  Branch (107:2): [True: 3.78k, False: 1.95k]
  ------------------
  108|  3.78k|	((c4 = (Guchar)s->getChar(*i + 3)) & 0xc0) == 0x80) {
  ------------------
  |  Branch (108:2): [True: 1.61k, False: 2.17k]
  ------------------
  109|  1.61k|      *i += 4;
  110|  1.61k|      *u = (Unicode)(((c0 & 0x03) << 24) |
  111|  1.61k|		     ((c1 & 0x3f) << 18) |
  112|  1.61k|		     ((c2 & 0x3f) << 12) |
  113|  1.61k|		     ((c3 & 0x3f) << 6) |
  114|  1.61k|		     (c4 & 0x3f));
  115|  22.0k|    } else {
  116|  22.0k|      *u = (Unicode)c0;
  117|  22.0k|    }
  118|   489k|  } else if (c0 < 0xfe) {
  ------------------
  |  Branch (118:14): [True: 78.9k, False: 410k]
  ------------------
  119|  78.9k|    if (*i < s->getLength() - 4 &&
  ------------------
  |  Branch (119:9): [True: 78.1k, False: 818]
  ------------------
  120|  78.1k|	((c1 = (Guchar)s->getChar(*i)) & 0xc0) == 0x80 &&
  ------------------
  |  Branch (120:2): [True: 4.08k, False: 74.0k]
  ------------------
  121|  4.08k|	((c2 = (Guchar)s->getChar(*i + 1)) & 0xc0) == 0x80 &&
  ------------------
  |  Branch (121:2): [True: 2.42k, False: 1.65k]
  ------------------
  122|  2.42k|	((c3 = (Guchar)s->getChar(*i + 2)) & 0xc0) == 0x80 &&
  ------------------
  |  Branch (122:2): [True: 2.10k, False: 324]
  ------------------
  123|  2.10k|	((c4 = (Guchar)s->getChar(*i + 3)) & 0xc0) == 0x80 &&
  ------------------
  |  Branch (123:2): [True: 1.76k, False: 340]
  ------------------
  124|  1.76k|	((c5 = (Guchar)s->getChar(*i + 4)) & 0xc0) == 0x80) {
  ------------------
  |  Branch (124:2): [True: 983, False: 779]
  ------------------
  125|    983|      *i += 5;
  126|    983|      *u = (Unicode)(((c0 & 0x01) << 30) |
  127|    983|		     ((c1 & 0x3f) << 24) |
  128|    983|		     ((c2 & 0x3f) << 18) |
  129|    983|		     ((c3 & 0x3f) << 12) |
  130|    983|		     ((c4 & 0x3f) << 6) |
  131|    983|		     (c5 & 0x3f));
  132|  77.9k|    } else {
  133|  77.9k|      *u = (Unicode)c0;
  134|  77.9k|    }
  135|   410k|  } else {
  136|   410k|    *u = (Unicode)c0;
  137|   410k|  }
  138|  11.7M|  return gTrue;
  ------------------
  |  |   17|  11.7M|#define gTrue 1
  ------------------
  139|  11.7M|}
_Z10getUTF16BEP7GStringPiPj:
  141|  3.87M|GBool getUTF16BE(GString *s, int *i, Unicode *u) {
  142|  3.87M|  int w0, w1;
  143|       |
  144|  3.87M|  if (*i >= s->getLength() - 1) {
  ------------------
  |  Branch (144:7): [True: 30.2k, False: 3.84M]
  ------------------
  145|  30.2k|    return gFalse;
  ------------------
  |  |   18|  30.2k|#define gFalse 0
  ------------------
  146|  30.2k|  }
  147|  3.84M|  w0 = ((s->getChar(*i) & 0xff) << 8) | (s->getChar(*i + 1) & 0xff);
  148|  3.84M|  *i += 2;
  149|  3.84M|  if (w0 < 0xd800 || w0 >= 0xe000) {
  ------------------
  |  Branch (149:7): [True: 3.63M, False: 203k]
  |  Branch (149:22): [True: 116k, False: 86.1k]
  ------------------
  150|  3.75M|    *u = (Unicode)w0;
  151|  3.75M|  } else {
  152|  86.1k|    if (*i < s->getLength() - 1) {
  ------------------
  |  Branch (152:9): [True: 85.8k, False: 289]
  ------------------
  153|  85.8k|      w1 = ((s->getChar(*i) & 0xff) << 8) | (s->getChar(*i + 1) & 0xff);
  154|  85.8k|      *i += 2;
  155|  85.8k|      *u = 0x10000 + ((w0 - 0xd800) << 10) + (w1 - 0xdc00);
  156|  85.8k|    } else {
  157|    289|      *u = (Unicode)w0;
  158|    289|    }
  159|  86.1k|  }
  160|  3.84M|  return gTrue;
  ------------------
  |  |   17|  3.84M|#define gTrue 1
  ------------------
  161|  3.87M|}
_Z10getUTF16LEP7GStringPiPj:
  163|  13.8M|GBool getUTF16LE(GString *s, int *i, Unicode *u) {
  164|  13.8M|  int w0, w1;
  165|       |
  166|  13.8M|  if (*i >= s->getLength() - 1) {
  ------------------
  |  Branch (166:7): [True: 59.7k, False: 13.8M]
  ------------------
  167|  59.7k|    return gFalse;
  ------------------
  |  |   18|  59.7k|#define gFalse 0
  ------------------
  168|  59.7k|  }
  169|  13.8M|  w0 = (s->getChar(*i) & 0xff) | ((s->getChar(*i + 1) & 0xff) << 8);
  170|  13.8M|  *i += 2;
  171|  13.8M|  if (w0 < 0xd800 || w0 >= 0xe000) {
  ------------------
  |  Branch (171:7): [True: 13.3M, False: 415k]
  |  Branch (171:22): [True: 348k, False: 66.6k]
  ------------------
  172|  13.7M|    *u = (Unicode)w0;
  173|  13.7M|  } else {
  174|  66.6k|    if (*i < s->getLength() - 1) {
  ------------------
  |  Branch (174:9): [True: 64.5k, False: 2.05k]
  ------------------
  175|  64.5k|      w1 = (s->getChar(*i) & 0xff) | ((s->getChar(*i + 1) & 0xff) << 8);
  176|  64.5k|      *i += 2;
  177|  64.5k|      *u = 0x10000 + ((w0 - 0xd800) << 10) + (w1 - 0xdc00);
  178|  64.5k|    } else {
  179|  2.05k|      *u = (Unicode)w0;
  180|  2.05k|    }
  181|  66.6k|  }
  182|  13.8M|  return gTrue;
  ------------------
  |  |   17|  13.8M|#define gTrue 1
  ------------------
  183|  13.8M|}

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

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

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

_ZN18XFAFieldLayoutInfoC2E20XFAFieldLayoutHAlign20XFAFieldLayoutVAligndd:
   47|  2.14k|				       double marginRightA) {
   48|  2.14k|  hAlign = hAlignA;
   49|  2.14k|  vAlign = vAlignA;
   50|  2.14k|  marginLeft = marginLeftA;
   51|  2.14k|  marginRight = marginRightA;
   52|  2.14k|}
_ZN8XFAFieldC2EP7GStringS1_S1_P18XFAFieldLayoutInfoP19XFAFieldPictureInfoP19XFAFieldBarcodeInfo:
   95|  7.72k|  : name(nameA)
   96|  7.72k|  , fullName(fullNameA)
   97|  7.72k|  , value(valueA)
   98|  7.72k|  , layoutInfo(layoutInfoA)
   99|  7.72k|  , pictureInfo(pictureInfoA)
  100|  7.72k|  , barcodeInfo(barcodeInfoA)
  101|  7.72k|{
  102|  7.72k|}
_ZN8XFAFieldD2Ev:
  104|  7.72k|XFAField::~XFAField() {
  105|  7.72k|  delete name;
  106|  7.72k|  delete fullName;
  107|  7.72k|  delete value;
  108|  7.72k|  delete layoutInfo;
  109|  7.72k|  delete pictureInfo;
  110|  7.72k|  delete barcodeInfo;
  111|  7.72k|}
_ZN10XFAScanner4loadEP6Object:
  115|  1.55k|XFAScanner *XFAScanner::load(Object *xfaObj) {
  116|  1.55k|  GString *xfaData = readXFAStreams(xfaObj);
  117|  1.55k|  if (!xfaData) {
  ------------------
  |  Branch (117:7): [True: 75, False: 1.48k]
  ------------------
  118|     75|    return NULL;
  119|     75|  }
  120|  1.48k|  ZxDoc *xml = ZxDoc::loadMem(xfaData->getCString(), xfaData->getLength());
  121|  1.48k|  delete xfaData;
  122|  1.48k|  if (!xml) {
  ------------------
  |  Branch (122:7): [True: 456, False: 1.02k]
  ------------------
  123|    456|    error(errSyntaxError, -1, "Invalid XML in XFA form");
  124|    456|    return NULL;
  125|    456|  }
  126|       |
  127|  1.02k|  XFAScanner *scanner = new XFAScanner();
  128|       |
  129|  1.02k|  if (xml->getRoot()) {
  ------------------
  |  Branch (129:7): [True: 1.02k, False: 1]
  ------------------
  130|  1.02k|    GHash *formValues = scanner->scanFormValues(xml->getRoot());
  131|  1.02k|    ZxElement *dataElem = NULL;
  132|  1.02k|    ZxElement *datasets =
  133|  1.02k|        xml->getRoot()->findFirstChildElement("xfa:datasets");
  134|  1.02k|    if (datasets) {
  ------------------
  |  Branch (134:9): [True: 55, False: 969]
  ------------------
  135|     55|      dataElem = datasets->findFirstChildElement("xfa:data");
  136|     55|    }
  137|  1.02k|    ZxElement *tmpl = xml->getRoot()->findFirstChildElement("template");
  138|  1.02k|    if (tmpl) {
  ------------------
  |  Branch (138:9): [True: 433, False: 591]
  ------------------
  139|    433|      scanner->scanNode(tmpl, NULL, NULL, NULL, NULL, NULL,
  140|    433|			dataElem, formValues);
  141|    433|    }
  142|  1.02k|    deleteGHash(formValues, GString);
  ------------------
  |  |   60|  1.02k|  do {                                             \
  |  |   61|  1.02k|    GHash *_hash = (hash);                         \
  |  |   62|  1.02k|    {                                              \
  |  |   63|  1.02k|      GHashIter *_iter;                            \
  |  |   64|  1.02k|      GString *_key;                               \
  |  |   65|  1.02k|      void *_p;                                    \
  |  |   66|  1.02k|      _hash->startIter(&_iter);                    \
  |  |   67|  1.35k|      while (_hash->getNext(&_iter, &_key, &_p)) { \
  |  |  ------------------
  |  |  |  Branch (67:14): [True: 331, False: 1.02k]
  |  |  ------------------
  |  |   68|    331|        delete (T*)_p;                             \
  |  |   69|    331|      }                                            \
  |  |   70|  1.02k|      delete _hash;                                \
  |  |   71|  1.02k|    }                                              \
  |  |   72|  1.02k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (72:11): [Folded, False: 1.02k]
  |  |  ------------------
  ------------------
  143|  1.02k|  }
  144|       |
  145|  1.02k|  delete xml;
  146|       |
  147|  1.02k|  return scanner;
  148|  1.48k|}
_ZN10XFAScannerC2Ev:
  150|  1.02k|XFAScanner::XFAScanner() {
  151|  1.02k|  fields = new GHash();
  152|  1.02k|}
_ZN10XFAScannerD2Ev:
  154|  1.02k|XFAScanner::~XFAScanner() {
  155|  1.02k|  deleteGHash(fields, XFAField);
  ------------------
  |  |   60|  1.02k|  do {                                             \
  |  |   61|  1.02k|    GHash *_hash = (hash);                         \
  |  |   62|  1.02k|    {                                              \
  |  |   63|  1.02k|      GHashIter *_iter;                            \
  |  |   64|  1.02k|      GString *_key;                               \
  |  |   65|  1.02k|      void *_p;                                    \
  |  |   66|  1.02k|      _hash->startIter(&_iter);                    \
  |  |   67|  8.74k|      while (_hash->getNext(&_iter, &_key, &_p)) { \
  |  |  ------------------
  |  |  |  Branch (67:14): [True: 7.72k, False: 1.02k]
  |  |  ------------------
  |  |   68|  7.72k|        delete (T*)_p;                             \
  |  |   69|  7.72k|      }                                            \
  |  |   70|  1.02k|      delete _hash;                                \
  |  |   71|  1.02k|    }                                              \
  |  |   72|  1.02k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (72:11): [Folded, False: 1.02k]
  |  |  ------------------
  ------------------
  156|  1.02k|}
_ZN10XFAScanner9findFieldEP7GString:
  158|    163|XFAField *XFAScanner::findField(GString *acroFormFieldName) {
  159|    163|  return (XFAField *)fields->lookup(acroFormFieldName);
  160|    163|}
_ZN10XFAScanner14readXFAStreamsEP6Object:
  162|  1.55k|GString *XFAScanner::readXFAStreams(Object *xfaObj) {
  163|  1.55k|  GString *data = new GString();
  164|  1.55k|  char buf[4096];
  165|  1.55k|  int n;
  166|  1.55k|  if (xfaObj->isStream()) {
  ------------------
  |  Branch (166:7): [True: 11, False: 1.54k]
  ------------------
  167|     11|    xfaObj->streamReset();
  168|  1.81k|    while ((n = xfaObj->getStream()->getBlock(buf, sizeof(buf))) > 0) {
  ------------------
  |  Branch (168:12): [True: 1.80k, False: 11]
  ------------------
  169|  1.80k|      data->append(buf, n);
  170|  1.80k|    }
  171|  1.54k|  } else if (xfaObj->isArray()) {
  ------------------
  |  Branch (171:14): [True: 1.54k, False: 1]
  ------------------
  172|  8.85k|    for (int i = 1; i < xfaObj->arrayGetLength(); i += 2) {
  ------------------
  |  Branch (172:21): [True: 7.38k, False: 1.47k]
  ------------------
  173|  7.38k|      Object obj;
  174|  7.38k|      if (!xfaObj->arrayGet(i, &obj)->isStream()) {
  ------------------
  |  Branch (174:11): [True: 74, False: 7.31k]
  ------------------
  175|     74|	error(errSyntaxError, -1, "XFA array element is wrong type");
  176|     74|	obj.free();
  177|     74|	delete data;
  178|     74|	return NULL;
  179|     74|      }
  180|  7.31k|      obj.streamReset();
  181|  47.7k|      while ((n = obj.getStream()->getBlock(buf, sizeof(buf))) > 0) {
  ------------------
  |  Branch (181:14): [True: 40.3k, False: 7.31k]
  ------------------
  182|  40.3k|	data->append(buf, n);
  183|  40.3k|      }
  184|  7.31k|      obj.free();
  185|  7.31k|    }
  186|  1.54k|  } else {
  187|      1|    error(errSyntaxError, -1, "XFA object is wrong type");
  188|      1|    return NULL;
  189|      1|  }
  190|  1.48k|  return data;
  191|  1.55k|}
_ZN10XFAScanner14scanFormValuesEP9ZxElement:
  193|  1.02k|GHash *XFAScanner::scanFormValues(ZxElement *xmlRoot) {
  194|  1.02k|  GHash *formValues = new GHash(gTrue);
  ------------------
  |  |   17|  1.02k|#define gTrue 1
  ------------------
  195|  1.02k|  ZxElement *formElem = xmlRoot->findFirstChildElement("form");
  196|  1.02k|  if (formElem) {
  ------------------
  |  Branch (196:7): [True: 76, False: 948]
  ------------------
  197|       |    scanFormNode(formElem, NULL, formValues);
  198|     76|  }
  199|  1.02k|  return formValues;
  200|  1.02k|}
_ZN10XFAScanner12scanFormNodeEP9ZxElementP7GStringP5GHash:
  203|  2.46k|			      GHash *formValues) {
  204|  2.46k|  GHash *fullNameIdx = new GHash();
  205|  2.46k|  for (ZxNode *node = elem->getFirstChild();
  206|  56.5k|       node;
  ------------------
  |  Branch (206:8): [True: 54.0k, False: 2.46k]
  ------------------
  207|  54.0k|       node = node->getNextChild()) {
  208|  54.0k|    if (node->isElement("value")) {
  ------------------
  |  Branch (208:9): [True: 2.84k, False: 51.2k]
  ------------------
  209|  2.84k|      if (fullName) {
  ------------------
  |  Branch (209:11): [True: 2.38k, False: 459]
  ------------------
  210|  2.38k|	ZxNode *child1Node = ((ZxElement *)node)->getFirstChild();
  211|  2.38k|	if (child1Node && child1Node->isElement()) {
  ------------------
  |  Branch (211:6): [True: 1.56k, False: 820]
  |  Branch (211:20): [True: 1.31k, False: 255]
  ------------------
  212|  1.31k|	  ZxNode *child2Node = ((ZxElement *)child1Node)->getFirstChild();
  213|  1.31k|	  if (child2Node && child2Node->isCharData()) {
  ------------------
  |  Branch (213:8): [True: 892, False: 418]
  |  Branch (213:22): [True: 331, False: 561]
  ------------------
  214|    331|	    formValues->add(fullName->copy(),
  215|    331|			    ((ZxCharData *)child2Node)->getData()->copy());
  216|    331|	  }
  217|  1.31k|	}
  218|  2.38k|      }
  219|  51.2k|    } else if (node->isElement()) {
  ------------------
  |  Branch (219:16): [True: 26.3k, False: 24.8k]
  ------------------
  220|  26.3k|      ZxAttr *nameAttr = ((ZxElement *)node)->findAttr("name");
  221|  26.3k|      if (nameAttr && (node->isElement("subform") ||
  ------------------
  |  Branch (221:11): [True: 2.21k, False: 24.1k]
  |  Branch (221:24): [True: 415, False: 1.79k]
  ------------------
  222|  1.98k|		       node->isElement("field"))) {
  ------------------
  |  Branch (222:10): [True: 1.56k, False: 231]
  ------------------
  223|  1.98k|	GString *nodeName = nameAttr->getValue();
  224|  1.98k|	GString *childFullName;
  225|  1.98k|	if (fullName) {
  ------------------
  |  Branch (225:6): [True: 1.59k, False: 389]
  ------------------
  226|  1.59k|	  childFullName = GString::format("{0:t}.{1:t}", fullName, nodeName);
  227|  1.59k|	} else {
  228|    389|	  childFullName = nodeName->copy();
  229|    389|	}
  230|  1.98k|	int idx = fullNameIdx->lookupInt(nodeName);
  231|  1.98k|	childFullName->appendf("[{0:d}]", idx);
  232|  1.98k|	fullNameIdx->replace(nodeName, idx + 1);
  233|  1.98k|	scanFormNode((ZxElement *)node, childFullName, formValues);
  234|  1.98k|	delete childFullName;
  235|  24.3k|      } else if (node->isElement("subform")) {
  ------------------
  |  Branch (235:18): [True: 406, False: 23.9k]
  ------------------
  236|    406|	scanFormNode((ZxElement *)node, fullName, formValues);
  237|    406|      }
  238|  26.3k|    }
  239|  54.0k|  }
  240|  2.46k|  delete fullNameIdx;
  241|  2.46k|}
_ZN10XFAScanner8scanNodeEP9ZxElementP7GStringS3_P5GHashS5_S3_S1_S5_:
  247|   363k|			  GHash *formValues) {
  248|   363k|  GString *nodeName = getNodeName(elem);
  249|   363k|  GHash *childNameIdx;
  250|   363k|  if (!nameIdx || nodeName) {
  ------------------
  |  Branch (250:7): [True: 433, False: 362k]
  |  Branch (250:19): [True: 30.0k, False: 332k]
  ------------------
  251|  30.4k|    childNameIdx = new GHash();
  252|   332k|  } else {
  253|   332k|    childNameIdx = nameIdx;
  254|   332k|  }
  255|   363k|  GString *nodeFullName = getNodeFullName(elem);
  256|   363k|  GHash *childFullNameIdx;
  257|   363k|  if (!fullNameIdx || (nodeFullName && !elem->isElement("area"))) {
  ------------------
  |  Branch (257:7): [True: 433, False: 362k]
  |  Branch (257:24): [True: 30.5k, False: 332k]
  |  Branch (257:40): [True: 30.0k, False: 551]
  ------------------
  258|  30.4k|    childFullNameIdx = new GHash();
  259|   332k|  } else {
  260|   332k|    childFullNameIdx = fullNameIdx;
  261|   332k|  }
  262|       |
  263|   363k|  GString *childName;
  264|   363k|  if (nodeName) {
  ------------------
  |  Branch (264:7): [True: 30.0k, False: 333k]
  ------------------
  265|  30.0k|    if (parentName) {
  ------------------
  |  Branch (265:9): [True: 27.3k, False: 2.68k]
  ------------------
  266|  27.3k|      childName = GString::format("{0:t}.{1:t}", parentName, nodeName);
  267|  27.3k|    } else {
  268|  2.68k|      childName = nodeName->copy();
  269|  2.68k|    }
  270|  30.0k|    int idx = nameIdx->lookupInt(nodeName);
  271|  30.0k|    nameIdx->replace(nodeName, idx + 1);
  272|  30.0k|    if (nodeIsBindGlobal(elem)) {
  ------------------
  |  Branch (272:9): [True: 0, False: 30.0k]
  ------------------
  273|      0|      childName->appendf("[0]");
  274|  30.0k|    } else {
  275|  30.0k|      childName->appendf("[{0:d}]", idx);
  276|  30.0k|    }
  277|   333k|  } else {
  278|   333k|    childName = parentName;
  279|   333k|  }
  280|   363k|  GString *childFullName;
  281|   363k|  if (nodeFullName) {
  ------------------
  |  Branch (281:7): [True: 30.5k, False: 332k]
  ------------------
  282|  30.5k|    if (parentFullName) {
  ------------------
  |  Branch (282:9): [True: 27.8k, False: 2.70k]
  ------------------
  283|  27.8k|      childFullName = GString::format("{0:t}.{1:t}",
  284|  27.8k|				      parentFullName, nodeFullName);
  285|  27.8k|    } else {
  286|  2.70k|      childFullName = nodeFullName->copy();
  287|  2.70k|    }
  288|  30.5k|    int idx = fullNameIdx->lookupInt(nodeFullName);
  289|  30.5k|    fullNameIdx->replace(nodeFullName, idx + 1);
  290|  30.5k|    childFullName->appendf("[{0:d}]", idx);
  291|   332k|  } else {
  292|   332k|    childFullName = parentFullName;
  293|   332k|  }
  294|       |
  295|   363k|  if (elem->isElement("field")) {
  ------------------
  |  Branch (295:7): [True: 8.07k, False: 355k]
  ------------------
  296|  8.07k|    if (childName && childFullName) {
  ------------------
  |  Branch (296:9): [True: 7.72k, False: 353]
  |  Branch (296:22): [True: 7.72k, False: 0]
  ------------------
  297|  7.72k|      scanField(elem, childName, childFullName, exclGroupName,
  298|  7.72k|		dataElem, formValues);
  299|  7.72k|    }
  300|   355k|  } else {
  301|   355k|    GString *childExclGroupName;
  302|   355k|    if (elem->isElement("exclGroup")) {
  ------------------
  |  Branch (302:9): [True: 633, False: 354k]
  ------------------
  303|    633|      childExclGroupName = childName;
  304|   354k|    } else {
  305|   354k|      childExclGroupName = NULL;
  306|   354k|    }
  307|   355k|    for (ZxNode *child = elem->getFirstChild();
  308|  1.02M|	 child;
  ------------------
  |  Branch (308:3): [True: 670k, False: 355k]
  ------------------
  309|   670k|	 child = child->getNextChild()) {
  310|   670k|      if (child->isElement()) {
  ------------------
  |  Branch (310:11): [True: 362k, False: 307k]
  ------------------
  311|   362k|	scanNode((ZxElement *)child, childName, childFullName,
  312|   362k|		 childNameIdx, childFullNameIdx, childExclGroupName,
  313|   362k|		 dataElem, formValues);
  314|   362k|      }
  315|   670k|    }
  316|   355k|  }
  317|       |
  318|   363k|  if (childName != parentName) {
  ------------------
  |  Branch (318:7): [True: 30.0k, False: 333k]
  ------------------
  319|  30.0k|    delete childName;
  320|  30.0k|  }
  321|   363k|  if (childFullName != parentFullName) {
  ------------------
  |  Branch (321:7): [True: 30.5k, False: 332k]
  ------------------
  322|  30.5k|    delete childFullName;
  323|  30.5k|  }
  324|   363k|  if (childNameIdx != nameIdx) {
  ------------------
  |  Branch (324:7): [True: 30.4k, False: 332k]
  ------------------
  325|  30.4k|    delete childNameIdx;
  326|  30.4k|  }
  327|   363k|  if (childFullNameIdx != fullNameIdx) {
  ------------------
  |  Branch (327:7): [True: 30.4k, False: 332k]
  ------------------
  328|  30.4k|    delete childFullNameIdx;
  329|  30.4k|  }
  330|   363k|}
_ZN10XFAScanner9scanFieldEP9ZxElementP7GStringS3_S3_S1_P5GHash:
  334|  7.72k|			   GHash *formValues) {
  335|  7.72k|  GString *value = getFieldValue(elem, name, fullName, exclGroupName,
  336|  7.72k|				 dataElem, formValues);
  337|  7.72k|  XFAFieldLayoutInfo *layoutInfo = getFieldLayoutInfo(elem);
  338|  7.72k|  XFAFieldPictureInfo *pictureInfo = getFieldPictureInfo(elem);
  339|  7.72k|  XFAFieldBarcodeInfo *barcodeInfo = getFieldBarcodeInfo(elem);
  340|  7.72k|  XFAField *field = new XFAField(name->copy(), fullName->copy(), value,
  341|  7.72k|				 layoutInfo, pictureInfo, barcodeInfo);
  342|  7.72k|  fields->add(field->fullName, field);
  343|  7.72k|}
_ZN10XFAScanner13getFieldValueEP9ZxElementP7GStringS3_S3_S1_P5GHash:
  347|  7.72k|				   ZxElement *dataElem, GHash *formValues) {
  348|  7.72k|  GString *val = NULL;
  349|       |
  350|       |  //--- check the <xfa:datasets> packet
  351|  7.72k|  val = getDatasetsValue(name->getCString(), dataElem);
  352|  7.72k|  if (!val && exclGroupName) {
  ------------------
  |  Branch (352:7): [True: 7.60k, False: 119]
  |  Branch (352:15): [True: 422, False: 7.18k]
  ------------------
  353|    422|    val = (GString *)getDatasetsValue(exclGroupName->getCString(), dataElem);
  354|    422|  }
  355|       |
  356|       |  //--- check the <form> element
  357|  7.72k|  if (!val) {
  ------------------
  |  Branch (357:7): [True: 7.60k, False: 119]
  ------------------
  358|  7.60k|    val = (GString *)formValues->lookup(fullName);
  359|  7.60k|  }
  360|       |
  361|       |  //--- check the <value> element within the field
  362|  7.72k|  if (!val) {
  ------------------
  |  Branch (362:7): [True: 7.60k, False: 119]
  ------------------
  363|  7.60k|    ZxElement *valueElem = elem->findFirstChildElement("value");
  364|  7.60k|    if (valueElem) {
  ------------------
  |  Branch (364:9): [True: 2.10k, False: 5.50k]
  ------------------
  365|  2.10k|      ZxNode *child1Node = valueElem->getFirstChild();
  366|  2.10k|      if (child1Node && child1Node->isElement()) {
  ------------------
  |  Branch (366:11): [True: 1.90k, False: 197]
  |  Branch (366:25): [True: 1.82k, False: 83]
  ------------------
  367|  1.82k|	ZxNode *child2Node = ((ZxElement *)child1Node)->getFirstChild();
  368|  1.82k|	if (child2Node && child2Node->isCharData()) {
  ------------------
  |  Branch (368:6): [True: 1.23k, False: 588]
  |  Branch (368:20): [True: 1.03k, False: 197]
  ------------------
  369|  1.03k|	  val = ((ZxCharData *)child2Node)->getData();
  370|  1.03k|	}
  371|  1.82k|      }
  372|  2.10k|    }
  373|  7.60k|  }
  374|       |
  375|       |  //--- get the checkbutton item value
  376|  7.72k|  GString *checkbuttonItem = NULL;
  377|  7.72k|  ZxElement *uiElem = elem->findFirstChildElement("ui");
  378|  7.72k|  if (uiElem) {
  ------------------
  |  Branch (378:7): [True: 2.26k, False: 5.46k]
  ------------------
  379|  2.26k|    ZxNode *uiChild = uiElem->getFirstChild();
  380|  2.26k|    if (uiChild && uiChild->isElement("checkButton")) {
  ------------------
  |  Branch (380:9): [True: 2.09k, False: 171]
  |  Branch (380:20): [True: 1.66k, False: 429]
  ------------------
  381|  1.66k|      ZxElement *itemsElem = elem->findFirstChildElement("items");
  382|  1.66k|      if (itemsElem) {
  ------------------
  |  Branch (382:11): [True: 822, False: 839]
  ------------------
  383|    822|	ZxNode *node1 = itemsElem->getFirstChild();
  384|    822|	if (node1 && node1->isElement()) {
  ------------------
  |  Branch (384:6): [True: 734, False: 88]
  |  Branch (384:15): [True: 659, False: 75]
  ------------------
  385|    659|	  ZxNode *node2 = ((ZxElement *)node1)->getFirstChild();
  386|    659|	  if (node2 && node2->isCharData()) {
  ------------------
  |  Branch (386:8): [True: 387, False: 272]
  |  Branch (386:17): [True: 293, False: 94]
  ------------------
  387|    293|	    checkbuttonItem = ((ZxCharData *)node2)->getData();
  388|    293|	  }
  389|    659|	}
  390|    822|      }
  391|  1.66k|    }
  392|  2.26k|  }
  393|       |  // convert XFA checkbutton value to AcroForm-style On/Off value
  394|  7.72k|  if (checkbuttonItem && val) {
  ------------------
  |  Branch (394:7): [True: 293, False: 7.42k]
  |  Branch (394:26): [True: 257, False: 36]
  ------------------
  395|    257|    if (val->cmp(checkbuttonItem)) {
  ------------------
  |  Branch (395:9): [True: 174, False: 83]
  ------------------
  396|    174|      val = new GString("Off");
  397|    174|    } else {
  398|     83|      val = new GString("On");
  399|     83|    }
  400|  7.46k|  } else if (val) {
  ------------------
  |  Branch (400:14): [True: 900, False: 6.56k]
  ------------------
  401|    900|    val = val->copy();
  402|    900|  }
  403|       |
  404|  7.72k|  return val;
  405|  7.72k|}
_ZN10XFAScanner16getDatasetsValueEPcP9ZxElement:
  407|  15.9k|GString *XFAScanner::getDatasetsValue(char *partName, ZxElement *elem) {
  408|  15.9k|  if (!elem) {
  ------------------
  |  Branch (408:7): [True: 7.29k, False: 8.64k]
  ------------------
  409|  7.29k|    return NULL;
  410|  7.29k|  }
  411|       |
  412|       |  // partName = xxxx[nn].yyyy----
  413|  8.64k|  char *p = strchr(partName, '[');
  414|  8.64k|  if (!p) {
  ------------------
  |  Branch (414:7): [True: 307, False: 8.34k]
  ------------------
  415|    307|    return NULL;
  416|    307|  }
  417|  8.34k|  int partLen = (int)(p - partName);
  418|  8.34k|  int idx = atoi(p + 1);
  419|  8.34k|  p = strchr(p + 1, '.');
  420|  8.34k|  if (p) {
  ------------------
  |  Branch (420:7): [True: 6.70k, False: 1.63k]
  ------------------
  421|  6.70k|    ++p;
  422|  6.70k|  }
  423|       |
  424|  8.34k|  int curIdx = 0;
  425|  8.34k|  for (ZxNode *node = elem->getFirstChild();
  426|  54.3k|       node;
  ------------------
  |  Branch (426:8): [True: 47.8k, False: 6.51k]
  ------------------
  427|  47.8k|       node = node->getNextChild()) {
  428|  47.8k|    if (!node->isElement()) {
  ------------------
  |  Branch (428:9): [True: 10.1k, False: 37.6k]
  ------------------
  429|  10.1k|      continue;
  430|  10.1k|    }
  431|  37.6k|    GString *nodeName = ((ZxElement *)node)->getType();
  432|  37.6k|    if (nodeName->getLength() != partLen ||
  ------------------
  |  Branch (432:9): [True: 34.6k, False: 3.02k]
  ------------------
  433|  35.3k|	strncmp(nodeName->getCString(), partName, partLen)) {
  ------------------
  |  Branch (433:2): [True: 703, False: 2.32k]
  ------------------
  434|  35.3k|      continue;
  435|  35.3k|    }
  436|  2.32k|    if (curIdx != idx) {
  ------------------
  |  Branch (436:9): [True: 499, False: 1.82k]
  ------------------
  437|    499|      ++curIdx;
  438|    499|      continue;
  439|    499|    }
  440|  1.82k|    if (p) {
  ------------------
  |  Branch (440:9): [True: 1.20k, False: 620]
  ------------------
  441|  1.20k|      GString *val = getDatasetsValue(p, (ZxElement *)node);
  442|  1.20k|      if (val) {
  ------------------
  |  Branch (442:11): [True: 117, False: 1.09k]
  ------------------
  443|    117|	return val;
  444|    117|      }
  445|  1.09k|      break;
  446|  1.20k|    } else {
  447|    620|      ZxNode *child = ((ZxElement *)node)->getFirstChild();
  448|    620|      if (!child || !child->isCharData()) {
  ------------------
  |  Branch (448:11): [True: 141, False: 479]
  |  Branch (448:21): [True: 360, False: 119]
  ------------------
  449|    501|	return NULL;
  450|    501|      }
  451|    119|      return ((ZxCharData *)child)->getData();
  452|    620|    }
  453|  1.82k|  }
  454|       |
  455|       |  // search for an 'ancestor match'
  456|  7.60k|  if (p) {
  ------------------
  |  Branch (456:7): [True: 6.58k, False: 1.01k]
  ------------------
  457|  6.58k|    return getDatasetsValue(p, elem);
  458|  6.58k|  }
  459|       |
  460|  1.01k|  return NULL;
  461|  7.60k|}
_ZN10XFAScanner18getFieldLayoutInfoEP9ZxElement:
  463|  7.72k|XFAFieldLayoutInfo *XFAScanner::getFieldLayoutInfo(ZxElement *elem) {
  464|  7.72k|  ZxElement *paraElem = elem->findFirstChildElement("para");
  465|  7.72k|  if (!paraElem) {
  ------------------
  |  Branch (465:7): [True: 5.57k, False: 2.14k]
  ------------------
  466|  5.57k|    return NULL;
  467|  5.57k|  }
  468|  2.14k|  XFAFieldLayoutHAlign hAlign = xfaFieldLayoutHAlignLeft;
  469|  2.14k|  ZxAttr *hAlignAttr = paraElem->findAttr("hAlign");
  470|  2.14k|  if (hAlignAttr) {
  ------------------
  |  Branch (470:7): [True: 40, False: 2.10k]
  ------------------
  471|     40|    if (!hAlignAttr->getValue()->cmp("left")) {
  ------------------
  |  Branch (471:9): [True: 0, False: 40]
  ------------------
  472|      0|      hAlign = xfaFieldLayoutHAlignLeft;
  473|     40|    } else if (!hAlignAttr->getValue()->cmp("center")) {
  ------------------
  |  Branch (473:16): [True: 0, False: 40]
  ------------------
  474|      0|      hAlign = xfaFieldLayoutHAlignCenter;
  475|     40|    } else if (!hAlignAttr->getValue()->cmp("right")) {
  ------------------
  |  Branch (475:16): [True: 0, False: 40]
  ------------------
  476|      0|      hAlign = xfaFieldLayoutHAlignRight;
  477|      0|    }
  478|     40|  }
  479|  2.14k|  XFAFieldLayoutVAlign vAlign = xfaFieldLayoutVAlignTop;
  480|  2.14k|  ZxAttr *vAlignAttr = paraElem->findAttr("vAlign");
  481|  2.14k|  if (vAlignAttr) {
  ------------------
  |  Branch (481:7): [True: 1.24k, False: 899]
  ------------------
  482|  1.24k|    if (!vAlignAttr->getValue()->cmp("top")) {
  ------------------
  |  Branch (482:9): [True: 0, False: 1.24k]
  ------------------
  483|      0|      vAlign = xfaFieldLayoutVAlignTop;
  484|  1.24k|    } else if (!vAlignAttr->getValue()->cmp("middle")) {
  ------------------
  |  Branch (484:16): [True: 125, False: 1.12k]
  ------------------
  485|    125|      vAlign = xfaFieldLayoutVAlignMiddle;
  486|  1.12k|    } else if (!vAlignAttr->getValue()->cmp("bottom")) {
  ------------------
  |  Branch (486:16): [True: 0, False: 1.12k]
  ------------------
  487|      0|      vAlign = xfaFieldLayoutVAlignBottom;
  488|      0|    }
  489|  1.24k|  }
  490|  2.14k|  double marginLeft = 0;
  491|  2.14k|  double marginRight = 0;
  492|  2.14k|  ZxAttr *marginAttr;
  493|  2.14k|  if ((marginAttr = paraElem->findAttr("marginLeft"))) {
  ------------------
  |  Branch (493:7): [True: 0, False: 2.14k]
  ------------------
  494|      0|    marginLeft = getMeasurement(marginAttr->getValue());
  495|      0|  }
  496|  2.14k|  if ((marginAttr = paraElem->findAttr("marginRight"))) {
  ------------------
  |  Branch (496:7): [True: 0, False: 2.14k]
  ------------------
  497|      0|    marginRight = getMeasurement(marginAttr->getValue());
  498|      0|  }
  499|  2.14k|  return new XFAFieldLayoutInfo(hAlign, vAlign, marginLeft, marginRight);
  500|  7.72k|}
_ZN10XFAScanner19getFieldPictureInfoEP9ZxElement:
  502|  7.72k|XFAFieldPictureInfo *XFAScanner::getFieldPictureInfo(ZxElement *elem) {
  503|  7.72k|  ZxElement *uiElem = elem->findFirstChildElement("ui");
  504|  7.72k|  if (!uiElem) {
  ------------------
  |  Branch (504:7): [True: 5.46k, False: 2.26k]
  ------------------
  505|  5.46k|    return NULL;
  506|  5.46k|  }
  507|  2.26k|  XFAFieldPictureSubtype subtype;
  508|  2.26k|  if (uiElem->findFirstChildElement("dateTimeEdit")) {
  ------------------
  |  Branch (508:7): [True: 0, False: 2.26k]
  ------------------
  509|      0|    subtype = xfaFieldPictureDateTime;
  510|  2.26k|  } else if (uiElem->findFirstChildElement("numericEdit")) {
  ------------------
  |  Branch (510:14): [True: 0, False: 2.26k]
  ------------------
  511|      0|    subtype = xfaFieldPictureNumeric;
  512|  2.26k|  } else if (uiElem->findFirstChildElement("textEdit")) {
  ------------------
  |  Branch (512:14): [True: 0, False: 2.26k]
  ------------------
  513|      0|    subtype = xfaFieldPictureText;
  514|  2.26k|  } else {
  515|  2.26k|    return NULL;
  516|  2.26k|  }
  517|       |
  518|      0|  ZxElement *formatElem, *pictureElem;
  519|      0|  ZxNode *pictureChildNode;
  520|      0|  if (!(formatElem = elem->findFirstChildElement("format")) ||
  ------------------
  |  Branch (520:7): [True: 0, False: 0]
  ------------------
  521|      0|      !(pictureElem = formatElem->findFirstChildElement("picture")) ||
  ------------------
  |  Branch (521:7): [True: 0, False: 0]
  ------------------
  522|      0|      !(pictureChildNode = pictureElem->getFirstChild()) ||
  ------------------
  |  Branch (522:7): [True: 0, False: 0]
  ------------------
  523|      0|      !pictureChildNode->isCharData()) {
  ------------------
  |  Branch (523:7): [True: 0, False: 0]
  ------------------
  524|      0|    return NULL;
  525|      0|  }
  526|      0|  GString *format = ((ZxCharData *)pictureChildNode)->getData()->copy();
  527|       |
  528|      0|  return new XFAFieldPictureInfo(subtype, format);
  529|      0|}
_ZN10XFAScanner19getFieldBarcodeInfoEP9ZxElement:
  531|  7.72k|XFAFieldBarcodeInfo *XFAScanner::getFieldBarcodeInfo(ZxElement *elem) {
  532|  7.72k|  ZxElement *uiElem, *barcodeElem;
  533|  7.72k|  if (!(uiElem = elem->findFirstChildElement("ui")) ||
  ------------------
  |  Branch (533:7): [True: 5.46k, False: 2.26k]
  ------------------
  534|  7.72k|      !(barcodeElem = uiElem->findFirstChildElement("barcode"))) {
  ------------------
  |  Branch (534:7): [True: 2.26k, False: 0]
  ------------------
  535|  7.72k|    return NULL;
  536|  7.72k|  }
  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|   363k|GString *XFAScanner::getNodeName(ZxElement *elem) {
  643|   363k|  if (elem->isElement("template") ||
  ------------------
  |  Branch (643:7): [True: 3.67k, False: 359k]
  ------------------
  644|   359k|      elem->isElement("area") ||
  ------------------
  |  Branch (644:7): [True: 889, False: 358k]
  ------------------
  645|   358k|      elem->isElement("draw")) {
  ------------------
  |  Branch (645:7): [True: 86, False: 358k]
  ------------------
  646|  4.64k|    return NULL;
  647|  4.64k|  }
  648|   358k|  if (!elem->isElement("field") && nodeIsBindNone(elem)) {
  ------------------
  |  Branch (648:7): [True: 350k, False: 8.07k]
  |  Branch (648:36): [True: 0, False: 350k]
  ------------------
  649|      0|    return NULL;
  650|      0|  }
  651|   358k|  ZxAttr *nameAttr = elem->findAttr("name");
  652|   358k|  if (!nameAttr) {
  ------------------
  |  Branch (652:7): [True: 328k, False: 30.0k]
  ------------------
  653|   328k|    return NULL;
  654|   328k|  }
  655|  30.0k|  return nameAttr->getValue();
  656|   358k|}
_ZN10XFAScanner15getNodeFullNameEP9ZxElement:
  658|   363k|GString *XFAScanner::getNodeFullName(ZxElement *elem) {
  659|   363k|  if (elem->isElement("template") ||
  ------------------
  |  Branch (659:7): [True: 3.67k, False: 359k]
  ------------------
  660|   359k|      elem->isElement("draw")) {
  ------------------
  |  Branch (660:7): [True: 86, False: 359k]
  ------------------
  661|  3.75k|    return NULL;
  662|  3.75k|  }
  663|   359k|  ZxAttr *nameAttr = elem->findAttr("name");
  664|   359k|  if (!nameAttr) {
  ------------------
  |  Branch (664:7): [True: 328k, False: 30.5k]
  ------------------
  665|   328k|    return NULL;
  666|   328k|  }
  667|  30.5k|  return nameAttr->getValue();
  668|   359k|}
_ZN10XFAScanner16nodeIsBindGlobalEP9ZxElement:
  670|  30.0k|GBool XFAScanner::nodeIsBindGlobal(ZxElement *elem) {
  671|  30.0k|  ZxElement *bindElem = elem->findFirstChildElement("bind");
  672|  30.0k|  if (!bindElem) {
  ------------------
  |  Branch (672:7): [True: 30.0k, False: 22]
  ------------------
  673|  30.0k|    return gFalse;
  ------------------
  |  |   18|  30.0k|#define gFalse 0
  ------------------
  674|  30.0k|  }
  675|     22|  ZxAttr *attr = bindElem->findAttr("match");
  676|     22|  return attr && !attr->getValue()->cmp("global");
  ------------------
  |  Branch (676:10): [True: 0, False: 22]
  |  Branch (676:18): [True: 0, False: 0]
  ------------------
  677|  30.0k|}
_ZN10XFAScanner14nodeIsBindNoneEP9ZxElement:
  679|   350k|GBool XFAScanner::nodeIsBindNone(ZxElement *elem) {
  680|   350k|  ZxElement *bindElem = elem->findFirstChildElement("bind");
  681|   350k|  if (!bindElem) {
  ------------------
  |  Branch (681:7): [True: 350k, False: 107]
  ------------------
  682|   350k|    return gFalse;
  ------------------
  |  |   18|   350k|#define gFalse 0
  ------------------
  683|   350k|  }
  684|    107|  ZxAttr *attr = bindElem->findAttr("match");
  685|    107|  return attr && !attr->getValue()->cmp("none");
  ------------------
  |  Branch (685:10): [True: 0, False: 107]
  |  Branch (685:18): [True: 0, False: 0]
  ------------------
  686|   350k|}

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

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

_ZN6ZxNodeC2Ev:
   64|  3.08M|ZxNode::ZxNode() {
   65|  3.08M|  next = NULL;
   66|  3.08M|  parent = NULL;
   67|       |  firstChild = lastChild = NULL;
   68|  3.08M|}
_ZN6ZxNodeD2Ev:
   70|  3.08M|ZxNode::~ZxNode() {
   71|  3.08M|  ZxNode *child;
   72|       |
   73|  6.16M|  while (firstChild) {
  ------------------
  |  Branch (73:10): [True: 3.07M, False: 3.08M]
  ------------------
   74|  3.07M|    child = firstChild;
   75|  3.07M|    firstChild = firstChild->next;
   76|  3.07M|    delete child;
   77|  3.07M|  }
   78|  3.08M|}
_ZN6ZxNode21findFirstChildElementEPKc:
  143|   432k|ZxElement *ZxNode::findFirstChildElement(const char *type) {
  144|   432k|  ZxNode *child;
  145|       |
  146|  1.52M|  for (child = firstChild; child; child = child->next) {
  ------------------
  |  Branch (146:28): [True: 1.10M, False: 420k]
  ------------------
  147|  1.10M|    if (child->isElement(type)) {
  ------------------
  |  Branch (147:9): [True: 12.6k, False: 1.08M]
  ------------------
  148|  12.6k|      return (ZxElement *)child;
  149|  12.6k|    }
  150|  1.10M|  }
  151|   420k|  return NULL;
  152|   432k|}
_ZN6ZxNode8addChildEPS_:
  186|  3.07M|void ZxNode::addChild(ZxNode *child) {
  187|  3.07M|  if (lastChild) {
  ------------------
  |  Branch (187:7): [True: 2.65M, False: 420k]
  ------------------
  188|  2.65M|    lastChild->next = child;
  189|  2.65M|    lastChild = child;
  190|  2.65M|  } else {
  191|   420k|    firstChild = lastChild = child;
  192|   420k|  }
  193|  3.07M|  child->parent = this;
  194|       |  child->next = NULL;
  195|  3.07M|}
_ZN5ZxDocC2Ev:
  199|  1.48k|ZxDoc::ZxDoc() {
  200|  1.48k|  xmlDecl = NULL;
  201|  1.48k|  docTypeDecl = NULL;
  202|       |  root = NULL;
  203|  1.48k|}
_ZN5ZxDoc7loadMemEPKcj:
  205|  1.48k|ZxDoc *ZxDoc::loadMem(const char *data, Guint dataLen) {
  206|  1.48k|  ZxDoc *doc;
  207|       |
  208|  1.48k|  doc = new ZxDoc();
  209|  1.48k|  if (!doc->parse(data, dataLen)) {
  ------------------
  |  Branch (209:7): [True: 456, False: 1.02k]
  ------------------
  210|    456|    delete doc;
  211|    456|    return NULL;
  212|    456|  }
  213|  1.02k|  return doc;
  214|  1.48k|}
_ZN5ZxDoc8addChildEP6ZxNode:
  262|  2.70k|void ZxDoc::addChild(ZxNode *node) {
  263|  2.70k|  if (node->isXMLDecl() && !xmlDecl) {
  ------------------
  |  Branch (263:7): [True: 536, False: 2.16k]
  |  Branch (263:28): [True: 536, False: 0]
  ------------------
  264|    536|    xmlDecl = (ZxXMLDecl *)node;
  265|  2.16k|  } else if (node->isDocTypeDecl() && !docTypeDecl) {
  ------------------
  |  Branch (265:14): [True: 106, False: 2.06k]
  |  Branch (265:39): [True: 106, False: 0]
  ------------------
  266|    106|    docTypeDecl = (ZxDocTypeDecl *)node;
  267|  2.06k|  } else if (node->isElement() && !root) {
  ------------------
  |  Branch (267:14): [True: 1.02k, False: 1.03k]
  |  Branch (267:35): [True: 1.02k, False: 0]
  ------------------
  268|  1.02k|    root = (ZxElement *)node;
  269|  1.02k|  }
  270|  2.70k|  ZxNode::addChild(node);
  271|  2.70k|}
_ZN5ZxDoc5parseEPKcj:
  273|  1.48k|bool ZxDoc::parse(const char *data, Guint dataLen) {
  274|  1.48k|  parsePtr = data;
  275|  1.48k|  parseEnd = data + dataLen;
  276|       |  
  277|  1.48k|  parseSpace();
  278|  1.48k|  parseBOM();
  279|  1.48k|  parseSpace();
  280|  1.48k|  parseXMLDecl(this);
  281|  1.48k|  parseMisc(this);
  282|  1.48k|  parseDocTypeDecl(this);
  283|  1.48k|  parseMisc(this);
  284|  1.48k|  if (match("<")) {
  ------------------
  |  Branch (284:7): [True: 1.02k, False: 456]
  ------------------
  285|  1.02k|    parseElement(this);
  286|  1.02k|  }
  287|  1.48k|  parseMisc(this);
  288|       |  return root != NULL;
  289|  1.48k|}
_ZN5ZxDoc12parseXMLDeclEP6ZxNode:
  291|  1.48k|void ZxDoc::parseXMLDecl(ZxNode *par) {
  292|  1.48k|  GString *version, *encoding, *s;
  293|  1.48k|  bool standalone;
  294|       |
  295|  1.48k|  if (!match("<?xml")) {
  ------------------
  |  Branch (295:7): [True: 944, False: 536]
  ------------------
  296|    944|    return;
  297|    944|  }
  298|    536|  parsePtr += 5;
  299|    536|  parseSpace();
  300|       |
  301|       |  // version
  302|    536|  version = NULL;
  303|    536|  if (match("version")) {
  ------------------
  |  Branch (303:7): [True: 510, False: 26]
  ------------------
  304|    510|    parsePtr += 7;
  305|    510|    parseSpace();
  306|    510|    if (match("=")) {
  ------------------
  |  Branch (306:9): [True: 487, False: 23]
  ------------------
  307|    487|      ++parsePtr;
  308|    487|      parseSpace();
  309|    487|      version = parseQuotedString();
  310|    487|    }
  311|    510|  }
  312|    536|  if (!version) {
  ------------------
  |  Branch (312:7): [True: 49, False: 487]
  ------------------
  313|     49|    version = new GString("1.0");
  314|     49|  }
  315|    536|  parseSpace();
  316|       |	
  317|       |  // encoding
  318|    536|  encoding = NULL;
  319|    536|  if (match("encoding")) {
  ------------------
  |  Branch (319:7): [True: 371, False: 165]
  ------------------
  320|    371|    parsePtr += 8;
  321|    371|    parseSpace();
  322|    371|    if (match("=")) {
  ------------------
  |  Branch (322:9): [True: 351, False: 20]
  ------------------
  323|    351|      ++parsePtr;
  324|    351|      parseSpace();
  325|    351|      encoding = parseQuotedString();
  326|    351|    }
  327|    371|  }
  328|    536|  parseSpace();
  329|       |
  330|       |  // standalone
  331|    536|  standalone = false;
  332|    536|  if (match("standalone")) {
  ------------------
  |  Branch (332:7): [True: 69, False: 467]
  ------------------
  333|     69|    parsePtr += 10;
  334|     69|    parseSpace();
  335|     69|    if (match("=")) {
  ------------------
  |  Branch (335:9): [True: 51, False: 18]
  ------------------
  336|     51|      ++parsePtr;
  337|     51|      parseSpace();
  338|     51|      s = parseQuotedString();
  339|     51|      standalone = !s->cmp("yes");
  340|     51|      delete s;
  341|     51|    }
  342|     69|  }
  343|    536|  parseSpace();
  344|       |
  345|    536|  if (match("?>")) {
  ------------------
  |  Branch (345:7): [True: 298, False: 238]
  ------------------
  346|    298|    parsePtr += 2;
  347|    298|  }
  348|       |
  349|    536|  par->addChild(new ZxXMLDecl(version, encoding, standalone));
  350|    536|}
_ZN5ZxDoc16parseDocTypeDeclEP6ZxNode:
  353|  1.48k|void ZxDoc::parseDocTypeDecl(ZxNode *par) {
  354|  1.48k|  GString *name;
  355|  1.48k|  int state;
  356|  1.48k|  char c, quote;
  357|       |
  358|  1.48k|  if (!match("<!DOCTYPE")) {
  ------------------
  |  Branch (358:7): [True: 1.37k, False: 106]
  ------------------
  359|  1.37k|    return;
  360|  1.37k|  }
  361|    106|  parsePtr += 9;
  362|    106|  parseSpace();
  363|       |
  364|    106|  name = parseName();
  365|    106|  parseSpace();
  366|       |
  367|    106|  state = 0;
  368|    106|  quote = '\0';
  369|   290k|  while (parsePtr < parseEnd && state < 4) {
  ------------------
  |  Branch (369:10): [True: 290k, False: 48]
  |  Branch (369:33): [True: 290k, False: 58]
  ------------------
  370|   290k|    c = *parsePtr++;
  371|   290k|    switch (state) {
  ------------------
  |  Branch (371:13): [True: 290k, False: 0]
  ------------------
  372|  23.0k|    case 0: // not in square brackets; not in quotes
  ------------------
  |  Branch (372:5): [True: 23.0k, False: 267k]
  ------------------
  373|  23.0k|      if (c == '>') {
  ------------------
  |  Branch (373:11): [True: 58, False: 22.9k]
  ------------------
  374|     58|	state = 4;
  375|  22.9k|      } else if (c == '"' || c == '\'') {
  ------------------
  |  Branch (375:18): [True: 99, False: 22.8k]
  |  Branch (375:30): [True: 127, False: 22.7k]
  ------------------
  376|    226|	state = 1;
  377|  22.7k|      } else if (c == '[') {
  ------------------
  |  Branch (377:18): [True: 471, False: 22.2k]
  ------------------
  378|    471|	state = 2;
  379|    471|      }
  380|  23.0k|      break;
  381|  10.1k|    case 1: // not in square brackets; in quotes
  ------------------
  |  Branch (381:5): [True: 10.1k, False: 280k]
  ------------------
  382|  10.1k|      if (c == quote) {
  ------------------
  |  Branch (382:11): [True: 216, False: 9.92k]
  ------------------
  383|    216|	state = 0;
  384|    216|      }
  385|  10.1k|      break;
  386|   216k|    case 2: // in square brackets; not in quotes
  ------------------
  |  Branch (386:5): [True: 216k, False: 74.0k]
  ------------------
  387|   216k|      if (c == ']') {
  ------------------
  |  Branch (387:11): [True: 444, False: 215k]
  ------------------
  388|    444|	state = 0;
  389|   215k|      } else if (c == '"' || c == '\'') {
  ------------------
  |  Branch (389:18): [True: 484, False: 215k]
  |  Branch (389:30): [True: 427, False: 214k]
  ------------------
  390|    911|	state = 3;
  391|    911|      }
  392|   216k|      break;
  393|  40.8k|    case 3: // in square brackets; in quotes
  ------------------
  |  Branch (393:5): [True: 40.8k, False: 249k]
  ------------------
  394|  40.8k|      if (c == quote) {
  ------------------
  |  Branch (394:11): [True: 901, False: 39.9k]
  ------------------
  395|    901|	state = 2;
  396|    901|      }
  397|  40.8k|      break;
  398|   290k|    }
  399|   290k|  }
  400|       |
  401|    106|  par->addChild(new ZxDocTypeDecl(name));
  402|    106|}
_ZN5ZxDoc12parseElementEP6ZxNode:
  405|  1.84M|void ZxDoc::parseElement(ZxNode *par) {
  406|  1.84M|  GString *type;
  407|  1.84M|  ZxElement *elem;
  408|  1.84M|  ZxAttr *attr;
  409|       |
  410|  1.84M|  ++parsePtr;
  411|  1.84M|  type = parseName();
  412|  1.84M|  elem = new ZxElement(type);
  413|  1.84M|  parseSpace();
  414|  2.02M|  while ((attr = parseAttr())) {
  ------------------
  |  Branch (414:10): [True: 184k, False: 1.84M]
  ------------------
  415|   184k|    elem->addAttr(attr);
  416|   184k|    parseSpace();
  417|   184k|  }
  418|  1.84M|  if (match("/>")) {
  ------------------
  |  Branch (418:7): [True: 39.4k, False: 1.80M]
  ------------------
  419|  39.4k|    parsePtr += 2;
  420|  1.80M|  } else if (match(">")) {
  ------------------
  |  Branch (420:14): [True: 419k, False: 1.38M]
  ------------------
  421|   419k|    ++parsePtr;
  422|   419k|    parseContent(elem);
  423|   419k|  }
  424|  1.84M|  par->addChild(elem);
  425|  1.84M|}
_ZN5ZxDoc9parseAttrEv:
  427|  2.02M|ZxAttr *ZxDoc::parseAttr() {
  428|  2.02M|  GString *name, *value;
  429|  2.02M|  const char *start;
  430|  2.02M|  char quote, c;
  431|  2.02M|  unsigned int x;
  432|  2.02M|  int n;
  433|       |
  434|  2.02M|  name = parseName();
  435|  2.02M|  parseSpace();
  436|  2.02M|  if (!match("=")) {
  ------------------
  |  Branch (436:7): [True: 1.81M, False: 213k]
  ------------------
  437|  1.81M|    delete name;
  438|  1.81M|    return NULL;
  439|  1.81M|  }
  440|   213k|  ++parsePtr;
  441|   213k|  parseSpace();
  442|   213k|  if (!(parsePtr < parseEnd && (*parsePtr == '"' || *parsePtr == '\''))) {
  ------------------
  |  Branch (442:9): [True: 213k, False: 6]
  |  Branch (442:33): [True: 183k, False: 29.6k]
  |  Branch (442:53): [True: 773, False: 28.8k]
  ------------------
  443|  28.8k|    delete name;
  444|  28.8k|    return NULL;
  445|  28.8k|  }
  446|   184k|  quote = *parsePtr++;
  447|   184k|  value = new GString();
  448|   531k|  while (parsePtr < parseEnd && *parsePtr != quote) {
  ------------------
  |  Branch (448:10): [True: 531k, False: 119]
  |  Branch (448:33): [True: 347k, False: 184k]
  ------------------
  449|   347k|    if (*parsePtr == '&') {
  ------------------
  |  Branch (449:9): [True: 142k, False: 204k]
  ------------------
  450|   142k|      ++parsePtr;
  451|   142k|      if (parsePtr < parseEnd && *parsePtr == '#') {
  ------------------
  |  Branch (451:11): [True: 142k, False: 5]
  |  Branch (451:34): [True: 20.6k, False: 122k]
  ------------------
  452|  20.6k|	++parsePtr;
  453|  20.6k|	if (parsePtr < parseEnd && *parsePtr == 'x') {
  ------------------
  |  Branch (453:6): [True: 20.6k, False: 4]
  |  Branch (453:29): [True: 9.07k, False: 11.5k]
  ------------------
  454|  9.07k|	  ++parsePtr;
  455|  9.07k|	  x = 0;
  456|  17.8k|	  while (parsePtr < parseEnd) {
  ------------------
  |  Branch (456:11): [True: 17.8k, False: 2]
  ------------------
  457|  17.8k|	    c = *parsePtr;
  458|  17.8k|	    if (c >= '0' && c <= '9') {
  ------------------
  |  Branch (458:10): [True: 14.9k, False: 2.87k]
  |  Branch (458:22): [True: 1.10k, False: 13.8k]
  ------------------
  459|  1.10k|	      x = (x << 4) + (c - '0');
  460|  16.7k|	    } else if (c >= 'a' && c <= 'f') {
  ------------------
  |  Branch (460:17): [True: 6.25k, False: 10.4k]
  |  Branch (460:29): [True: 2.31k, False: 3.93k]
  ------------------
  461|  2.31k|	      x = (x << 4) + (10 + c - 'a');
  462|  14.4k|	    } else if (c >= 'A' && c <= 'F') {
  ------------------
  |  Branch (462:17): [True: 10.2k, False: 4.18k]
  |  Branch (462:29): [True: 5.34k, False: 4.89k]
  ------------------
  463|  5.34k|	      x = (x << 4) + (10 + c - 'A');
  464|  9.07k|	    } else {
  465|  9.07k|	      break;
  466|  9.07k|	    }
  467|  8.76k|	    ++parsePtr;
  468|  8.76k|	  }
  469|  9.07k|	  if (parsePtr < parseEnd && *parsePtr == ';') {
  ------------------
  |  Branch (469:8): [True: 9.07k, False: 2]
  |  Branch (469:31): [True: 337, False: 8.74k]
  ------------------
  470|    337|	    ++parsePtr;
  471|    337|	  }
  472|  9.07k|	  appendUTF8(value, x);
  473|  11.5k|	} else {
  474|  11.5k|	  x = 0;
  475|  12.3k|	  while (parsePtr < parseEnd) {
  ------------------
  |  Branch (475:11): [True: 12.3k, False: 5]
  ------------------
  476|  12.3k|	    c = *parsePtr;
  477|  12.3k|	    if (c >= '0' && c <= '9') {
  ------------------
  |  Branch (477:10): [True: 6.80k, False: 5.52k]
  |  Branch (477:22): [True: 762, False: 6.04k]
  ------------------
  478|    762|	      x = x * 10 + (c - '0');
  479|  11.5k|	    } else {
  480|  11.5k|	      break;
  481|  11.5k|	    }
  482|    762|	    ++parsePtr;
  483|    762|	  }
  484|  11.5k|	  if (parsePtr < parseEnd && *parsePtr == ';') {
  ------------------
  |  Branch (484:8): [True: 11.5k, False: 5]
  |  Branch (484:31): [True: 333, False: 11.2k]
  ------------------
  485|    333|	    ++parsePtr;
  486|    333|	  }
  487|  11.5k|	  appendUTF8(value, x);
  488|  11.5k|	}
  489|   122k|      } else {
  490|   122k|	start = parsePtr;
  491|   122k|	for (++parsePtr;
  492|  7.70M|	     parsePtr < parseEnd && *parsePtr != ';' &&
  ------------------
  |  Branch (492:7): [True: 7.70M, False: 34]
  |  Branch (492:30): [True: 7.70M, False: 376]
  ------------------
  493|  7.70M|	       *parsePtr != quote && *parsePtr != '&';
  ------------------
  |  Branch (493:9): [True: 7.70M, False: 7.10k]
  |  Branch (493:31): [True: 7.58M, False: 114k]
  ------------------
  494|  7.58M|	     ++parsePtr) ;
  495|   122k|	n = (int)(parsePtr - start);
  496|   122k|	if (parsePtr < parseEnd && *parsePtr == ';') {
  ------------------
  |  Branch (496:6): [True: 122k, False: 34]
  |  Branch (496:29): [True: 376, False: 121k]
  ------------------
  497|    376|	  ++parsePtr;
  498|    376|	}
  499|   122k|	if (n == 2 && !strncmp(start, "lt", 2)) {
  ------------------
  |  Branch (499:6): [True: 5.54k, False: 116k]
  |  Branch (499:16): [True: 233, False: 5.30k]
  ------------------
  500|    233|	  value->append('<');
  501|   121k|	} else if (n == 2 && !strncmp(start, "gt", 2)) {
  ------------------
  |  Branch (501:13): [True: 5.30k, False: 116k]
  |  Branch (501:23): [True: 280, False: 5.02k]
  ------------------
  502|    280|	  value->append('>');
  503|   121k|	} else if (n == 3 && !strncmp(start, "amp", 3)) {
  ------------------
  |  Branch (503:13): [True: 3.14k, False: 118k]
  |  Branch (503:23): [True: 260, False: 2.88k]
  ------------------
  504|    260|	  value->append('&');
  505|   121k|	} else if (n == 4 && !strncmp(start, "apos", 4)) {
  ------------------
  |  Branch (505:13): [True: 1.28k, False: 120k]
  |  Branch (505:23): [True: 0, False: 1.28k]
  ------------------
  506|      0|	  value->append('\'');
  507|   121k|	} else if (n == 4 && !strncmp(start, "quot", 4)) {
  ------------------
  |  Branch (507:13): [True: 1.28k, False: 120k]
  |  Branch (507:23): [True: 0, False: 1.28k]
  ------------------
  508|      0|	  value->append('"');
  509|   121k|	} else {
  510|   121k|	  value->append(start - 1, (int)(parsePtr - start) + 1);
  511|   121k|	}
  512|   122k|      }
  513|   204k|    } else {
  514|   204k|      start = parsePtr;
  515|   204k|      for (++parsePtr;
  516|  15.1M|	   parsePtr < parseEnd && *parsePtr != quote && *parsePtr != '&';
  ------------------
  |  Branch (516:5): [True: 15.1M, False: 76]
  |  Branch (516:28): [True: 14.9M, False: 176k]
  |  Branch (516:50): [True: 14.9M, False: 27.9k]
  ------------------
  517|  14.9M|	   ++parsePtr) ;
  518|   204k|      value->append(start, (int)(parsePtr - start));
  519|   204k|    }
  520|   347k|  }
  521|   184k|  if (parsePtr < parseEnd && *parsePtr == quote) {
  ------------------
  |  Branch (521:7): [True: 184k, False: 119]
  |  Branch (521:30): [True: 184k, False: 0]
  ------------------
  522|   184k|    ++parsePtr;
  523|   184k|  }
  524|   184k|  return new ZxAttr(name, value);
  525|   213k|}
_ZN5ZxDoc12parseContentEP9ZxElement:
  528|   419k|void ZxDoc::parseContent(ZxElement *par) {
  529|   419k|  GString *endType;
  530|       |
  531|   419k|  endType = (new GString("</"))->append(par->getType());
  532|       |
  533|  3.49M|  while (parsePtr < parseEnd) {
  ------------------
  |  Branch (533:10): [True: 3.15M, False: 336k]
  ------------------
  534|  3.15M|    if (match(endType->getCString())) {
  ------------------
  |  Branch (534:9): [True: 82.6k, False: 3.07M]
  ------------------
  535|  82.6k|      parsePtr += endType->getLength();
  536|  82.6k|      parseSpace();
  537|  82.6k|      if (match(">")) {
  ------------------
  |  Branch (537:11): [True: 51.9k, False: 30.7k]
  ------------------
  538|  51.9k|	++parsePtr;
  539|  51.9k|      }
  540|  82.6k|      break;
  541|  3.07M|    } else if (match("<?")) {
  ------------------
  |  Branch (541:16): [True: 26.4k, False: 3.05M]
  ------------------
  542|  26.4k|      parsePI(par);
  543|  3.05M|    } else if (match("<![CDATA[")) {
  ------------------
  |  Branch (543:16): [True: 52, False: 3.05M]
  ------------------
  544|     52|      parseCDSect(par);
  545|  3.05M|    } else if (match("<!--")) {
  ------------------
  |  Branch (545:16): [True: 3.08k, False: 3.04M]
  ------------------
  546|  3.08k|      parseComment(par);
  547|  3.04M|    } else if (match("<")) {
  ------------------
  |  Branch (547:16): [True: 1.83M, False: 1.20M]
  ------------------
  548|  1.83M|      parseElement(par);
  549|  1.83M|    } else {
  550|  1.20M|      parseCharData(par);
  551|  1.20M|    }
  552|  3.15M|  }
  553|       |
  554|   419k|  delete endType;
  555|   419k|}
_ZN5ZxDoc13parseCharDataEP9ZxElement:
  557|  1.20M|void ZxDoc::parseCharData(ZxElement *par) {
  558|  1.20M|  GString *data;
  559|  1.20M|  const char *start;
  560|  1.20M|  char c;
  561|  1.20M|  unsigned int x;
  562|  1.20M|  int n;
  563|       |
  564|  1.20M|  data = new GString();
  565|  3.31M|  while (parsePtr < parseEnd && *parsePtr != '<') {
  ------------------
  |  Branch (565:10): [True: 3.31M, False: 647]
  |  Branch (565:33): [True: 2.10M, False: 1.20M]
  ------------------
  566|  2.10M|    if (*parsePtr == '&') {
  ------------------
  |  Branch (566:9): [True: 895k, False: 1.21M]
  ------------------
  567|   895k|      ++parsePtr;
  568|   895k|      if (parsePtr < parseEnd && *parsePtr == '#') {
  ------------------
  |  Branch (568:11): [True: 895k, False: 5]
  |  Branch (568:34): [True: 31.2k, False: 864k]
  ------------------
  569|  31.2k|	++parsePtr;
  570|  31.2k|	if (parsePtr < parseEnd && *parsePtr == 'x') {
  ------------------
  |  Branch (570:6): [True: 31.2k, False: 8]
  |  Branch (570:29): [True: 11.7k, False: 19.5k]
  ------------------
  571|  11.7k|	  ++parsePtr;
  572|  11.7k|	  x = 0;
  573|  25.9k|	  while (parsePtr < parseEnd) {
  ------------------
  |  Branch (573:11): [True: 25.9k, False: 7]
  ------------------
  574|  25.9k|	    c = *parsePtr;
  575|  25.9k|	    if (c >= '0' && c <= '9') {
  ------------------
  |  Branch (575:10): [True: 21.0k, False: 4.88k]
  |  Branch (575:22): [True: 1.75k, False: 19.2k]
  ------------------
  576|  1.75k|	      x = (x << 4) + (c - '0');
  577|  24.1k|	    } else if (c >= 'a' && c <= 'f') {
  ------------------
  |  Branch (577:17): [True: 7.85k, False: 16.2k]
  |  Branch (577:29): [True: 3.68k, False: 4.17k]
  ------------------
  578|  3.68k|	      x = (x << 4) + (10 + c - 'a');
  579|  20.4k|	    } else if (c >= 'A' && c <= 'F') {
  ------------------
  |  Branch (579:17): [True: 14.0k, False: 6.39k]
  |  Branch (579:29): [True: 8.75k, False: 5.32k]
  ------------------
  580|  8.75k|	      x = (x << 4) + (10 + c - 'A');
  581|  11.7k|	    } else {
  582|  11.7k|	      break;
  583|  11.7k|	    }
  584|  14.1k|	    ++parsePtr;
  585|  14.1k|	  }
  586|  11.7k|	  if (parsePtr < parseEnd && *parsePtr == ';') {
  ------------------
  |  Branch (586:8): [True: 11.7k, False: 7]
  |  Branch (586:31): [True: 318, False: 11.3k]
  ------------------
  587|    318|	    ++parsePtr;
  588|    318|	  }
  589|  11.7k|	  appendUTF8(data, x);
  590|  19.5k|	} else {
  591|  19.5k|	  x = 0;
  592|  26.7k|	  while (parsePtr < parseEnd) {
  ------------------
  |  Branch (592:11): [True: 26.7k, False: 11]
  ------------------
  593|  26.7k|	    c = *parsePtr;
  594|  26.7k|	    if (c >= '0' && c <= '9') {
  ------------------
  |  Branch (594:10): [True: 17.6k, False: 9.11k]
  |  Branch (594:22): [True: 7.24k, False: 10.3k]
  ------------------
  595|  7.24k|	      x = x * 10 + (c - '0');
  596|  19.5k|	    } else {
  597|  19.5k|	      break;
  598|  19.5k|	    }
  599|  7.24k|	    ++parsePtr;
  600|  7.24k|	  }
  601|  19.5k|	  if (parsePtr < parseEnd && *parsePtr == ';') {
  ------------------
  |  Branch (601:8): [True: 19.5k, False: 11]
  |  Branch (601:31): [True: 406, False: 19.0k]
  ------------------
  602|    406|	    ++parsePtr;
  603|    406|	  }
  604|  19.5k|	  appendUTF8(data, x);
  605|  19.5k|	}
  606|   864k|      } else {
  607|   864k|	start = parsePtr;
  608|   864k|	for (++parsePtr;
  609|  33.7M|	     parsePtr < parseEnd && *parsePtr != ';' &&
  ------------------
  |  Branch (609:7): [True: 33.7M, False: 87]
  |  Branch (609:30): [True: 33.7M, False: 1.17k]
  ------------------
  610|  33.7M|	       *parsePtr != '<' && *parsePtr != '&';
  ------------------
  |  Branch (610:9): [True: 33.6M, False: 106k]
  |  Branch (610:29): [True: 32.9M, False: 756k]
  ------------------
  611|  32.9M|	     ++parsePtr) ;
  612|   864k|	n = (int)(parsePtr - start);
  613|   864k|	if (parsePtr < parseEnd && *parsePtr == ';') {
  ------------------
  |  Branch (613:6): [True: 864k, False: 87]
  |  Branch (613:29): [True: 1.17k, False: 863k]
  ------------------
  614|  1.17k|	  ++parsePtr;
  615|  1.17k|	}
  616|   864k|	if (n == 2 && !strncmp(start, "lt", 2)) {
  ------------------
  |  Branch (616:6): [True: 30.3k, False: 834k]
  |  Branch (616:16): [True: 287, False: 30.0k]
  ------------------
  617|    287|	  data->append('<');
  618|   864k|	} else if (n == 2 && !strncmp(start, "gt", 2)) {
  ------------------
  |  Branch (618:13): [True: 30.0k, False: 834k]
  |  Branch (618:23): [True: 290, False: 29.7k]
  ------------------
  619|    290|	  data->append('>');
  620|   863k|	} else if (n == 3 && !strncmp(start, "amp", 3)) {
  ------------------
  |  Branch (620:13): [True: 55.0k, False: 808k]
  |  Branch (620:23): [True: 109, False: 54.9k]
  ------------------
  621|    109|	  data->append('&');
  622|   863k|	} else if (n == 4 && !strncmp(start, "apos", 4)) {
  ------------------
  |  Branch (622:13): [True: 12.0k, False: 851k]
  |  Branch (622:23): [True: 0, False: 12.0k]
  ------------------
  623|      0|	  data->append('\'');
  624|   863k|	} else if (n == 4 && !strncmp(start, "quot", 4)) {
  ------------------
  |  Branch (624:13): [True: 12.0k, False: 851k]
  |  Branch (624:23): [True: 0, False: 12.0k]
  ------------------
  625|      0|	  data->append('"');
  626|   863k|	} else {
  627|   863k|	  data->append(start - 1, (int)(parsePtr - start) + 1);
  628|   863k|	}
  629|   864k|      }
  630|  1.21M|    } else {
  631|  1.21M|      start = parsePtr;
  632|  1.21M|      for (++parsePtr;
  633|  43.5M|	   parsePtr < parseEnd && *parsePtr != '<' && *parsePtr != '&';
  ------------------
  |  Branch (633:5): [True: 43.5M, False: 540]
  |  Branch (633:28): [True: 42.4M, False: 1.09M]
  |  Branch (633:48): [True: 42.3M, False: 112k]
  ------------------
  634|  42.3M|	   ++parsePtr) ;
  635|  1.21M|      data->append(start, (int)(parsePtr - start));
  636|  1.21M|    }
  637|  2.10M|  }
  638|  1.20M|  par->addChild(new ZxCharData(data, true));
  639|  1.20M|}
_ZN5ZxDoc10appendUTF8EP7GStringj:
  641|  51.8k|void ZxDoc::appendUTF8(GString *s, unsigned int c) {
  642|  51.8k|  if (c <= 0x7f) {
  ------------------
  |  Branch (642:7): [True: 46.0k, False: 5.84k]
  ------------------
  643|  46.0k|    s->append((char)c);
  644|  46.0k|  } else if (c <= 0x7ff) {
  ------------------
  |  Branch (644:14): [True: 1.53k, False: 4.31k]
  ------------------
  645|  1.53k|    s->append((char)(0xc0 + (c >> 6)));
  646|  1.53k|    s->append((char)(0x80 + (c & 0x3f)));
  647|  4.31k|  } else if (c <= 0xffff) {
  ------------------
  |  Branch (647:14): [True: 1.99k, False: 2.32k]
  ------------------
  648|  1.99k|    s->append((char)(0xe0 + (c >> 12)));
  649|  1.99k|    s->append((char)(0x80 + ((c >> 6) & 0x3f)));
  650|  1.99k|    s->append((char)(0x80 + (c & 0x3f)));
  651|  2.32k|  } else if (c <= 0x1fffff) {
  ------------------
  |  Branch (651:14): [True: 1.02k, False: 1.29k]
  ------------------
  652|  1.02k|    s->append((char)(0xf0 + (c >> 18)));
  653|  1.02k|    s->append((char)(0x80 + ((c >> 12) & 0x3f)));
  654|  1.02k|    s->append((char)(0x80 + ((c >> 6) & 0x3f)));
  655|  1.02k|    s->append((char)(0x80 + (c & 0x3f)));
  656|  1.29k|  } else if (c <= 0x3ffffff) {
  ------------------
  |  Branch (656:14): [True: 379, False: 915]
  ------------------
  657|    379|    s->append((char)(0xf8 + (c >> 24)));
  658|    379|    s->append((char)(0x80 + ((c >> 18) & 0x3f)));
  659|    379|    s->append((char)(0x80 + ((c >> 12) & 0x3f)));
  660|    379|    s->append((char)(0x80 + ((c >> 6) & 0x3f)));
  661|    379|    s->append((char)(0x80 + (c & 0x3f)));
  662|    915|  } else if (c <= 0x7fffffff) {
  ------------------
  |  Branch (662:14): [True: 424, False: 491]
  ------------------
  663|    424|    s->append((char)(0xfc + (c >> 30)));
  664|    424|    s->append((char)(0x80 + ((c >> 24) & 0x3f)));
  665|    424|    s->append((char)(0x80 + ((c >> 18) & 0x3f)));
  666|    424|    s->append((char)(0x80 + ((c >> 12) & 0x3f)));
  667|    424|    s->append((char)(0x80 + ((c >> 6) & 0x3f)));
  668|    424|    s->append((char)(0x80 + (c & 0x3f)));
  669|    424|  }
  670|  51.8k|}
_ZN5ZxDoc11parseCDSectEP6ZxNode:
  673|     52|void ZxDoc::parseCDSect(ZxNode *par) {
  674|     52|  const char *start;
  675|       |
  676|     52|  parsePtr += 9;
  677|     52|  start = parsePtr;
  678|   125k|  while (parsePtr < parseEnd - 3) {
  ------------------
  |  Branch (678:10): [True: 125k, False: 12]
  ------------------
  679|   125k|    if (!strncmp(parsePtr, "]]>", 3)) {
  ------------------
  |  Branch (679:9): [True: 40, False: 125k]
  ------------------
  680|     40|      par->addChild(new ZxCharData(new GString(start, (int)(parsePtr - start)),
  681|     40|				   false));
  682|     40|      parsePtr += 3;
  683|     40|      return;
  684|     40|    }
  685|   125k|    ++parsePtr;
  686|   125k|  }
  687|     12|  parsePtr = parseEnd;
  688|     12|  par->addChild(new ZxCharData(new GString(start, (int)(parsePtr - start)),
  689|     12|			       false));
  690|     12|}
_ZN5ZxDoc9parseMiscEP6ZxNode:
  692|  4.44k|void ZxDoc::parseMisc(ZxNode *par) {
  693|  21.7k|  while (1) {
  ------------------
  |  Branch (693:10): [True: 21.7k, Folded]
  ------------------
  694|  21.7k|    if (match("<!--")) {
  ------------------
  |  Branch (694:9): [True: 620, False: 21.1k]
  ------------------
  695|    620|      parseComment(par);
  696|  21.1k|    } else if (match("<?")) {
  ------------------
  |  Branch (696:16): [True: 445, False: 20.6k]
  ------------------
  697|    445|      parsePI(par);
  698|  20.6k|    } else if (parsePtr < parseEnd && (*parsePtr == '\x20' ||
  ------------------
  |  Branch (698:16): [True: 19.4k, False: 1.21k]
  |  Branch (698:40): [True: 4.54k, False: 14.9k]
  ------------------
  699|  14.9k|				       *parsePtr == '\x09' ||
  ------------------
  |  Branch (699:12): [True: 8.93k, False: 5.98k]
  ------------------
  700|  5.98k|				       *parsePtr == '\x0d' ||
  ------------------
  |  Branch (700:12): [True: 666, False: 5.32k]
  ------------------
  701|  16.2k|				       *parsePtr == '\x0a')) {
  ------------------
  |  Branch (701:12): [True: 2.09k, False: 3.22k]
  ------------------
  702|  16.2k|      ++parsePtr;
  703|  16.2k|    } else {
  704|  4.44k|      break;
  705|  4.44k|    }
  706|  21.7k|  }
  707|  4.44k|}
_ZN5ZxDoc12parseCommentEP6ZxNode:
  710|  3.70k|void ZxDoc::parseComment(ZxNode *par) {
  711|  3.70k|  const char *start;
  712|       |
  713|  3.70k|  parsePtr += 4;
  714|  3.70k|  start = parsePtr;
  715|  1.27M|  while (parsePtr <= parseEnd - 3) {
  ------------------
  |  Branch (715:10): [True: 1.27M, False: 33]
  ------------------
  716|  1.27M|    if (!strncmp(parsePtr, "-->", 3)) {
  ------------------
  |  Branch (716:9): [True: 3.66k, False: 1.27M]
  ------------------
  717|  3.66k|      par->addChild(new ZxComment(new GString(start, (int)(parsePtr - start))));
  718|  3.66k|      parsePtr += 3;
  719|  3.66k|      return;
  720|  3.66k|    }
  721|  1.27M|    ++parsePtr;
  722|  1.27M|  }
  723|     33|  parsePtr = parseEnd;
  724|     33|}
_ZN5ZxDoc7parsePIEP6ZxNode:
  727|  26.9k|void ZxDoc::parsePI(ZxNode *par) {
  728|  26.9k|  GString *target;
  729|  26.9k|  const char *start;
  730|       |
  731|  26.9k|  parsePtr += 2;
  732|  26.9k|  target = parseName();
  733|  26.9k|  parseSpace();
  734|  26.9k|  start = parsePtr;
  735|  1.83M|  while (parsePtr <= parseEnd - 2) {
  ------------------
  |  Branch (735:10): [True: 1.83M, False: 83]
  ------------------
  736|  1.83M|    if (!strncmp(parsePtr, "?>", 2)) {
  ------------------
  |  Branch (736:9): [True: 26.8k, False: 1.80M]
  ------------------
  737|  26.8k|      par->addChild(new ZxPI(target, new GString(start,
  738|  26.8k|						 (int)(parsePtr - start))));
  739|  26.8k|      parsePtr += 2;
  740|  26.8k|      return;
  741|  26.8k|    }
  742|  1.80M|    ++parsePtr;
  743|  1.80M|  }
  744|     83|  parsePtr = parseEnd;
  745|     83|  par->addChild(new ZxPI(target, new GString(start, (int)(parsePtr - start))));
  746|     83|}
_ZN5ZxDoc9parseNameEv:
  750|  3.89M|GString *ZxDoc::parseName() {
  751|  3.89M|  GString *name;
  752|       |
  753|  3.89M|  name = new GString();
  754|  3.89M|  if (parsePtr < parseEnd && nameStartChar[*parsePtr & 0xff]) {
  ------------------
  |  Branch (754:7): [True: 3.89M, False: 179]
  |  Branch (754:30): [True: 1.89M, False: 1.99M]
  ------------------
  755|  1.89M|    name->append(*parsePtr++);
  756|  6.85M|    while (parsePtr < parseEnd && nameChar[*parsePtr & 0xff]) {
  ------------------
  |  Branch (756:12): [True: 6.85M, False: 29]
  |  Branch (756:35): [True: 4.96M, False: 1.89M]
  ------------------
  757|  4.96M|      name->append(*parsePtr++);
  758|  4.96M|    }
  759|  1.89M|  }
  760|  3.89M|  return name;
  761|  3.89M|}
_ZN5ZxDoc17parseQuotedStringEv:
  763|    889|GString *ZxDoc::parseQuotedString() {
  764|    889|  GString *s;
  765|    889|  const char *start;
  766|    889|  char quote;
  767|       |
  768|    889|  if (parsePtr < parseEnd && (*parsePtr == '"' || *parsePtr == '\'')) {
  ------------------
  |  Branch (768:7): [True: 886, False: 3]
  |  Branch (768:31): [True: 757, False: 129]
  |  Branch (768:51): [True: 57, False: 72]
  ------------------
  769|    814|    quote = *parsePtr++;
  770|    814|    start = parsePtr;
  771|  35.4k|    while (parsePtr < parseEnd && *parsePtr != quote) {
  ------------------
  |  Branch (771:12): [True: 35.4k, False: 1]
  |  Branch (771:35): [True: 34.6k, False: 813]
  ------------------
  772|  34.6k|      ++parsePtr;
  773|  34.6k|    }
  774|    814|    s = new GString(start, (int)(parsePtr - start));
  775|    814|    if (parsePtr < parseEnd && *parsePtr == quote) {
  ------------------
  |  Branch (775:9): [True: 813, False: 1]
  |  Branch (775:32): [True: 813, False: 0]
  ------------------
  776|    813|      ++parsePtr;
  777|    813|    }
  778|    814|  } else {
  779|     75|    s = new GString();
  780|     75|  }
  781|    889|  return s;
  782|    889|}
_ZN5ZxDoc8parseBOMEv:
  784|  1.48k|void ZxDoc::parseBOM() {
  785|  1.48k|  if (match("\xef\xbb\xbf")) {
  ------------------
  |  Branch (785:7): [True: 22, False: 1.45k]
  ------------------
  786|     22|    parsePtr += 3;
  787|     22|  }
  788|  1.48k|}
_ZN5ZxDoc10parseSpaceEv:
  790|  4.38M|void ZxDoc::parseSpace() {
  791|  6.43M|  while (parsePtr < parseEnd && (*parsePtr == '\x20' ||
  ------------------
  |  Branch (791:10): [True: 6.43M, False: 443]
  |  Branch (791:34): [True: 1.71M, False: 4.71M]
  ------------------
  792|  4.71M|				 *parsePtr == '\x09' ||
  ------------------
  |  Branch (792:6): [True: 19.8k, False: 4.69M]
  ------------------
  793|  4.69M|				 *parsePtr == '\x0d' ||
  ------------------
  |  Branch (793:6): [True: 56.9k, False: 4.63M]
  ------------------
  794|  4.63M|				 *parsePtr == '\x0a')) {
  ------------------
  |  Branch (794:6): [True: 258k, False: 4.37M]
  ------------------
  795|  2.05M|    ++parsePtr;
  796|  2.05M|  }
  797|  4.38M|}
_ZN5ZxDoc5matchEPKc:
  799|  21.1M|bool ZxDoc::match(const char *s) {
  800|  21.1M|  int n;
  801|       |
  802|  21.1M|  n = (int)strlen(s);
  803|  21.1M|  return parseEnd - parsePtr >= n && !strncmp(parsePtr, s, n);
  ------------------
  |  Branch (803:10): [True: 21.1M, False: 4.33k]
  |  Branch (803:38): [True: 2.68M, False: 18.5M]
  ------------------
  804|  21.1M|}
_ZN9ZxXMLDeclC2EP7GStringS1_b:
  822|    536|ZxXMLDecl::ZxXMLDecl(GString *versionA, GString *encodingA, bool standaloneA) {
  823|    536|  version = versionA;
  824|    536|  encoding = encodingA;
  825|    536|  standalone = standaloneA;
  826|    536|}
_ZN9ZxXMLDeclD2Ev:
  828|    536|ZxXMLDecl::~ZxXMLDecl() {
  829|    536|  delete version;
  830|    536|  if (encoding) {
  ------------------
  |  Branch (830:7): [True: 351, False: 185]
  ------------------
  831|    351|    delete encoding;
  832|    351|  }
  833|    536|}
_ZN13ZxDocTypeDeclC2EP7GString:
  858|    106|ZxDocTypeDecl::ZxDocTypeDecl(GString *nameA) {
  859|    106|  name = nameA;
  860|    106|}
_ZN13ZxDocTypeDeclD2Ev:
  862|    106|ZxDocTypeDecl::~ZxDocTypeDecl() {
  863|    106|  delete name;
  864|    106|}
_ZN9ZxCommentC2EP7GString:
  880|  3.66k|ZxComment::ZxComment(GString *textA) {
  881|  3.66k|  text = textA;
  882|  3.66k|}
_ZN9ZxCommentD2Ev:
  884|  3.66k|ZxComment::~ZxComment() {
  885|  3.66k|  delete text;
  886|  3.66k|}
_ZN4ZxPIC2EP7GStringS1_:
  902|  26.9k|ZxPI::ZxPI(GString *targetA, GString *textA) {
  903|  26.9k|  target = targetA;
  904|  26.9k|  text = textA;
  905|  26.9k|}
_ZN4ZxPID2Ev:
  907|  26.9k|ZxPI::~ZxPI() {
  908|  26.9k|  delete target;
  909|  26.9k|  delete text;
  910|  26.9k|}
_ZN9ZxElementC2EP7GString:
  928|  1.84M|ZxElement::ZxElement(GString *typeA) {
  929|  1.84M|  type = typeA;
  930|  1.84M|  attrs = new GHash();
  931|       |  firstAttr = lastAttr = NULL;
  932|  1.84M|}
_ZN9ZxElementD2Ev:
  934|  1.84M|ZxElement::~ZxElement() {
  935|  1.84M|  delete type;
  936|  1.84M|  deleteGHash(attrs, ZxAttr);
  ------------------
  |  |   60|  1.84M|  do {                                             \
  |  |   61|  1.84M|    GHash *_hash = (hash);                         \
  |  |   62|  1.84M|    {                                              \
  |  |   63|  1.84M|      GHashIter *_iter;                            \
  |  |   64|  1.84M|      GString *_key;                               \
  |  |   65|  1.84M|      void *_p;                                    \
  |  |   66|  1.84M|      _hash->startIter(&_iter);                    \
  |  |   67|  2.02M|      while (_hash->getNext(&_iter, &_key, &_p)) { \
  |  |  ------------------
  |  |  |  Branch (67:14): [True: 184k, False: 1.84M]
  |  |  ------------------
  |  |   68|   184k|        delete (T*)_p;                             \
  |  |   69|   184k|      }                                            \
  |  |   70|  1.84M|      delete _hash;                                \
  |  |   71|  1.84M|    }                                              \
  |  |   72|  1.84M|  } while(0)
  |  |  ------------------
  |  |  |  Branch (72:11): [Folded, False: 1.84M]
  |  |  ------------------
  ------------------
  937|  1.84M|}
_ZN9ZxElement9isElementEPKc:
  939|  3.58M|bool ZxElement::isElement(const char *typeA) {
  940|  3.58M|  return !type->cmp(typeA);
  941|  3.58M|}
_ZN9ZxElement8findAttrEPKc:
  943|   753k|ZxAttr *ZxElement::findAttr(const char *attrName) {
  944|   753k|  return (ZxAttr *)attrs->lookup(attrName);
  945|   753k|}
_ZN9ZxElement7addAttrEP6ZxAttr:
  947|   184k|void ZxElement::addAttr(ZxAttr *attr) {
  948|   184k|  attrs->add(attr->getName(), attr);
  949|   184k|  if (lastAttr) {
  ------------------
  |  Branch (949:7): [True: 59.9k, False: 124k]
  ------------------
  950|  59.9k|    lastAttr->next = attr;
  951|  59.9k|    lastAttr= attr;
  952|   124k|  } else {
  953|   124k|    firstAttr = lastAttr = attr;
  954|   124k|  }
  955|   184k|  attr->parent = this;
  956|       |  attr->next = NULL;
  957|   184k|}
_ZN6ZxAttrC2EP7GStringS1_:
 1025|   184k|ZxAttr::ZxAttr(GString *nameA, GString *valueA) {
 1026|   184k|  name = nameA;
 1027|   184k|  value = valueA;
 1028|   184k|  parent = NULL;
 1029|       |  next = NULL;
 1030|   184k|}
_ZN6ZxAttrD2Ev:
 1032|   184k|ZxAttr::~ZxAttr() {
 1033|   184k|  delete name;
 1034|   184k|  delete value;
 1035|   184k|}
_ZN10ZxCharDataC2EP7GStringb:
 1039|  1.20M|ZxCharData::ZxCharData(GString *dataA, bool parsedA) {
 1040|  1.20M|  data = dataA;
 1041|  1.20M|  parsed = parsedA;
 1042|  1.20M|}
_ZN10ZxCharDataD2Ev:
 1044|  1.20M|ZxCharData::~ZxCharData() {
 1045|  1.20M|  delete data;
 1046|  1.20M|}

_ZN5ZxDoc7getRootEv:
   88|  4.09k|  ZxElement *getRoot() { return root; }
_ZN10ZxCharData7getDataEv:
  257|  1.78k|  GString *getData() { return data; }
_ZN6ZxAttr8getValueEv:
  234|  66.3k|  GString *getValue() { return value; }
_ZN9ZxElement7getTypeEv:
  209|   456k|  GString *getType() { return type; }
_ZN6ZxNode9isXMLDeclEv:
   36|  2.16k|  virtual bool isXMLDecl()  { return false; }
_ZN6ZxNode13isDocTypeDeclEv:
   37|  2.06k|  virtual bool isDocTypeDecl() { return false; }
_ZN6ZxNode9isElementEv:
   40|   343k|  virtual bool isElement() { return false; }
_ZN6ZxNode9isElementEPKc:
   41|   511k|  virtual bool isElement(const char *type) { return false; }
_ZN6ZxNode10isCharDataEv:
   42|  1.21k|  virtual bool isCharData() { return false; }
_ZN6ZxNode13getFirstChildEv:
   43|   377k|  virtual ZxNode *getFirstChild() { return firstChild; }
_ZN6ZxNode12getNextChildEv:
   44|   770k|  virtual ZxNode *getNextChild() { return next; }
_ZN9ZxXMLDecl9isXMLDeclEv:
  129|    536|  virtual bool isXMLDecl() { return true; }
_ZN13ZxDocTypeDecl13isDocTypeDeclEv:
  151|    106|  virtual bool isDocTypeDecl() { return true; }
_ZN9ZxElement9isElementEv:
  207|   431k|  virtual bool isElement() { return true; }
_ZN6ZxAttr7getNameEv:
  233|   184k|  GString *getName() { return name; }
_ZN10ZxCharData10isCharDataEv:
  256|  1.78k|  virtual bool isCharData() { return true; }

