LLVMFuzzerTestOneInput:
   21|  3.82k|extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
   22|  3.82k|    char *ss = (char*)malloc(size+1);
   23|  3.82k|    memcpy(ss, data, size);
   24|  3.82k|    ss[size] = '\0';
   25|       |
   26|  3.82k|    ZxDoc Z1;
   27|  3.82k|    ZxDoc *new_doc = Z1.loadMem(ss, size);
   28|  3.82k|    if (new_doc != NULL)
  ------------------
  |  Branch (28:9): [True: 2.48k, False: 1.33k]
  ------------------
   29|  2.48k|        delete new_doc;
   30|       |
   31|  3.82k|    free(ss);
   32|       |
   33|  3.82k|    return 0;  
   34|  3.82k|}

_ZN5GHashC2Ei:
   34|  1.31M|GHash::GHash(GBool deleteKeysA) {
   35|  1.31M|  int h;
   36|       |
   37|  1.31M|  deleteKeys = deleteKeysA;
   38|  1.31M|  size = 7;
   39|  1.31M|  tab = (GHashBucket **)gmallocn(size, sizeof(GHashBucket *));
   40|  10.5M|  for (h = 0; h < size; ++h) {
  ------------------
  |  Branch (40:15): [True: 9.21M, False: 1.31M]
  ------------------
   41|       |    tab[h] = NULL;
   42|  9.21M|  }
   43|  1.31M|  len = 0;
   44|  1.31M|}
_ZN5GHashD2Ev:
   46|  1.31M|GHash::~GHash() {
   47|  1.31M|  GHashBucket *p;
   48|  1.31M|  int h;
   49|       |
   50|  11.9M|  for (h = 0; h < size; ++h) {
  ------------------
  |  Branch (50:15): [True: 10.6M, False: 1.31M]
  ------------------
   51|  11.5M|    while (tab[h]) {
  ------------------
  |  Branch (51:12): [True: 907k, False: 10.6M]
  ------------------
   52|   907k|      p = tab[h];
   53|   907k|      tab[h] = p->next;
   54|   907k|      if (deleteKeys) {
  ------------------
  |  Branch (54:11): [True: 0, False: 907k]
  ------------------
   55|      0|	delete p->key;
   56|      0|      }
   57|   907k|      delete p;
   58|   907k|    }
   59|  10.6M|  }
   60|  1.31M|  gfree(tab);
   61|  1.31M|}
_ZN5GHash3addEP7GStringPv:
   63|   907k|void GHash::add(GString *key, void *val) {
   64|   907k|  GHashBucket *p;
   65|   907k|  int h;
   66|       |
   67|       |  // expand the table if necessary
   68|   907k|  if (len >= size) {
  ------------------
  |  Branch (68:7): [True: 2.01k, False: 905k]
  ------------------
   69|  2.01k|    expand();
   70|  2.01k|  }
   71|       |
   72|       |  // add the new symbol
   73|   907k|  p = new GHashBucket;
   74|   907k|  p->key = key;
   75|   907k|  p->val.p = val;
   76|   907k|  h = hash(key);
   77|   907k|  p->next = tab[h];
   78|   907k|  tab[h] = p;
   79|   907k|  ++len;
   80|   907k|}
_ZN5GHash9startIterEPP9GHashIter:
  261|  1.31M|void GHash::startIter(GHashIter **iter) {
  262|  1.31M|  *iter = new GHashIter;
  263|  1.31M|  (*iter)->h = -1;
  264|       |  (*iter)->p = NULL;
  265|  1.31M|}
_ZN5GHash7getNextEPP9GHashIterPP7GStringPPv:
  267|  2.22M|GBool GHash::getNext(GHashIter **iter, GString **key, void **val) {
  268|  2.22M|  if (!*iter) {
  ------------------
  |  Branch (268:7): [True: 0, False: 2.22M]
  ------------------
  269|      0|    return gFalse;
  ------------------
  |  |   18|      0|#define gFalse 0
  ------------------
  270|      0|  }
  271|  2.22M|  if ((*iter)->p) {
  ------------------
  |  Branch (271:7): [True: 907k, False: 1.31M]
  ------------------
  272|   907k|    (*iter)->p = (*iter)->p->next;
  273|   907k|  }
  274|  12.8M|  while (!(*iter)->p) {
  ------------------
  |  Branch (274:10): [True: 11.9M, False: 907k]
  ------------------
  275|  11.9M|    if (++(*iter)->h == size) {
  ------------------
  |  Branch (275:9): [True: 1.31M, False: 10.6M]
  ------------------
  276|  1.31M|      delete *iter;
  277|  1.31M|      *iter = NULL;
  278|  1.31M|      return gFalse;
  ------------------
  |  |   18|  1.31M|#define gFalse 0
  ------------------
  279|  1.31M|    }
  280|  10.6M|    (*iter)->p = tab[(*iter)->h];
  281|  10.6M|  }
  282|   907k|  *key = (*iter)->p->key;
  283|   907k|  *val = (*iter)->p->val.p;
  284|   907k|  return gTrue;
  ------------------
  |  |   17|   907k|#define gTrue 1
  ------------------
  285|  2.22M|}
_ZN5GHash6expandEv:
  312|  2.01k|void GHash::expand() {
  313|  2.01k|  GHashBucket **oldTab;
  314|  2.01k|  GHashBucket *p;
  315|  2.01k|  int oldSize, h, i;
  316|       |
  317|  2.01k|  oldSize = size;
  318|  2.01k|  oldTab = tab;
  319|  2.01k|  size = 2*size + 1;
  320|  2.01k|  tab = (GHashBucket **)gmallocn(size, sizeof(GHashBucket *));
  321|  2.90M|  for (h = 0; h < size; ++h) {
  ------------------
  |  Branch (321:15): [True: 2.90M, False: 2.01k]
  ------------------
  322|  2.90M|    tab[h] = NULL;
  323|  2.90M|  }
  324|  1.45M|  for (i = 0; i < oldSize; ++i) {
  ------------------
  |  Branch (324:15): [True: 1.45M, False: 2.01k]
  ------------------
  325|  2.90M|    while (oldTab[i]) {
  ------------------
  |  Branch (325:12): [True: 1.45M, False: 1.45M]
  ------------------
  326|  1.45M|      p = oldTab[i];
  327|  1.45M|      oldTab[i] = oldTab[i]->next;
  328|  1.45M|      h = hash(p->key);
  329|  1.45M|      p->next = tab[h];
  330|  1.45M|      tab[h] = p;
  331|  1.45M|    }
  332|  1.45M|  }
  333|  2.01k|  gfree(oldTab);
  334|  2.01k|}
_ZN5GHash4hashEP7GString:
  360|  2.35M|int GHash::hash(GString *key) {
  361|  2.35M|  const char *p;
  362|  2.35M|  unsigned int h;
  363|  2.35M|  int i;
  364|       |
  365|  2.35M|  h = 0;
  366|  2.68M|  for (p = key->getCString(), i = 0; i < key->getLength(); ++p, ++i) {
  ------------------
  |  Branch (366:38): [True: 325k, False: 2.35M]
  ------------------
  367|   325k|    h = 17 * h + (int)(*p & 0xff);
  368|   325k|  }
  369|  2.35M|  return (int)(h % size);
  370|  2.35M|}

_ZN7GStringC2Ev:
  129|  4.59M|GString::GString() {
  130|       |  s = NULL;
  131|  4.59M|  resize(length = 0);
  132|  4.59M|  s[0] = '\0';
  133|  4.59M|}
_ZN7GStringC2EPKc:
  135|  1.19M|GString::GString(const char *sA) {
  136|  1.19M|  int n = (int)strlen(sA);
  137|       |
  138|       |  s = NULL;
  139|  1.19M|  resize(length = n);
  140|  1.19M|  memcpy(s, sA, n + 1);
  141|  1.19M|}
_ZN7GStringC2EPKci:
  143|  20.8k|GString::GString(const char *sA, int lengthA) {
  144|       |  s = NULL;
  145|  20.8k|  resize(length = lengthA);
  146|  20.8k|  memcpy(s, sA, length * sizeof(char));
  147|  20.8k|  s[length] = '\0';
  148|  20.8k|}
_ZN7GStringD2Ev:
  204|  5.81M|GString::~GString() {
  205|  5.81M|  delete[] s;
  206|  5.81M|}
_ZN7GString6appendEc:
  214|  13.4M|GString *GString::append(char c) {
  215|  13.4M|  if (length > INT_MAX - 1) {
  ------------------
  |  Branch (215:7): [True: 0, False: 13.4M]
  ------------------
  216|      0|    gMemError("Integer overflow in GString::append()");
  217|      0|  }
  218|  13.4M|  resize(length + 1);
  219|  13.4M|  s[length++] = c;
  220|  13.4M|  s[length] = '\0';
  221|  13.4M|  return this;
  222|  13.4M|}
_ZN7GString6appendEPS_:
  224|  1.19M|GString *GString::append(GString *str) {
  225|  1.19M|  int n = str->getLength();
  226|       |
  227|  1.19M|  if (length > INT_MAX - n) {
  ------------------
  |  Branch (227:7): [True: 0, False: 1.19M]
  ------------------
  228|      0|    gMemError("Integer overflow in GString::append()");
  229|      0|  }
  230|  1.19M|  resize(length + n);
  231|  1.19M|  memcpy(s + length, str->getCString(), n + 1);
  232|  1.19M|  length += n;
  233|  1.19M|  return this;
  234|  1.19M|}
_ZN7GString6appendEPKci:
  248|   494k|GString *GString::append(const char *str, int lengthA) {
  249|   494k|  if (lengthA < 0 || length > INT_MAX - lengthA) {
  ------------------
  |  Branch (249:7): [True: 0, False: 494k]
  |  Branch (249:22): [True: 0, False: 494k]
  ------------------
  250|      0|    gMemError("Integer overflow in GString::append()");
  251|      0|  }
  252|   494k|  resize(length + lengthA);
  253|   494k|  memcpy(s + length, str, lengthA);
  254|   494k|  length += lengthA;
  255|   494k|  s[length] = '\0';
  256|   494k|  return this;
  257|   494k|}
_ZN7GString3cmpEPKc:
  810|    134|int GString::cmp(const char *sA) {
  811|    134|  int n1, i, x;
  812|    134|  const char *p1, *p2;
  813|       |
  814|    134|  n1 = length;
  815|    146|  for (i = 0, p1 = s, p2 = sA; i < n1 && *p2; ++i, ++p1, ++p2) {
  ------------------
  |  Branch (815:32): [True: 37, False: 109]
  |  Branch (815:42): [True: 36, False: 1]
  ------------------
  816|     36|    x = (*p1 & 0xff) - (*p2 & 0xff);
  817|     36|    if (x != 0) {
  ------------------
  |  Branch (817:9): [True: 24, False: 12]
  ------------------
  818|     24|      return x;
  819|     24|    }
  820|     36|  }
  821|    110|  if (i < n1) {
  ------------------
  |  Branch (821:7): [True: 1, False: 109]
  ------------------
  822|      1|    return 1;
  823|      1|  }
  824|    109|  if (*p2) {
  ------------------
  |  Branch (824:7): [True: 108, False: 1]
  ------------------
  825|    108|    return -1;
  826|    108|  }
  827|      1|  return 0;
  828|    109|}
_ZN7GString6resizeEi:
  108|  20.9M|inline void GString::resize(int length1) {
  109|  20.9M|  char *s1;
  110|       |
  111|  20.9M|  if (length1 < 0) {
  ------------------
  |  Branch (111:7): [True: 0, False: 20.9M]
  ------------------
  112|      0|    gMemError("GString::resize() with negative length");
  113|      0|  }
  114|  20.9M|  if (!s) {
  ------------------
  |  Branch (114:7): [True: 5.81M, False: 15.0M]
  ------------------
  115|  5.81M|    s = new char[size(length1)];
  116|  15.0M|  } else if (size(length1) != size(length)) {
  ------------------
  |  Branch (116:14): [True: 143k, False: 14.9M]
  ------------------
  117|   143k|    s1 = new char[size(length1)];
  118|   143k|    if (length1 < length) {
  ------------------
  |  Branch (118:9): [True: 0, False: 143k]
  ------------------
  119|      0|      memcpy(s1, s, length1);
  120|      0|      s1[length1] = '\0';
  121|   143k|    } else {
  122|   143k|      memcpy(s1, s, length + 1);
  123|   143k|    }
  124|   143k|    delete[] s;
  125|   143k|    s = s1;
  126|   143k|  }
  127|  20.9M|}
GString.cc:_ZL4sizei:
   98|  36.1M|static inline int size(int len) {
   99|  36.1M|  int delta;
  100|   416M|  for (delta = 8; delta < len && delta < 0x100000; delta <<= 1) ;
  ------------------
  |  Branch (100:19): [True: 380M, False: 36.1M]
  |  Branch (100:34): [True: 380M, False: 0]
  ------------------
  101|  36.1M|  if (len > INT_MAX - delta) {
  ------------------
  |  Branch (101:7): [True: 0, False: 36.1M]
  ------------------
  102|      0|    gMemError("Integer overflow in GString::size()");
  103|      0|  }
  104|       |  // this is ((len + 1) + (delta - 1)) & ~(delta - 1)
  105|  36.1M|  return (len + delta) & ~(delta - 1);
  106|  36.1M|}

_ZN7GString10getCStringEv:
   79|  5.04M|  char *getCString() { return s; }
_ZN7GString9getLengthEv:
   76|  3.90M|  int getLength() { return length; }

_Z7gmalloci:
  139|  1.31M|void *gmalloc(int size) GMEM_EXCEP {
  140|  1.31M|  void *p;
  141|       |
  142|  1.31M|  if (size < 0) {
  ------------------
  |  Branch (142:7): [True: 0, False: 1.31M]
  ------------------
  143|      0|    gMemError("Invalid memory allocation size");
  144|      0|  }
  145|  1.31M|  if (size == 0) {
  ------------------
  |  Branch (145:7): [True: 0, False: 1.31M]
  ------------------
  146|      0|    return NULL;
  147|      0|  }
  148|  1.31M|  if (!(p = malloc(size))) {
  ------------------
  |  Branch (148:7): [True: 0, False: 1.31M]
  ------------------
  149|      0|    gMemError("Out of memory");
  150|      0|  }
  151|  1.31M|  return p;
  152|  1.31M|}
_Z8gmallocnii:
  204|  1.31M|void *gmallocn(int nObjs, int objSize) GMEM_EXCEP {
  205|  1.31M|  int n;
  206|       |
  207|  1.31M|  if (nObjs == 0) {
  ------------------
  |  Branch (207:7): [True: 0, False: 1.31M]
  ------------------
  208|      0|    return NULL;
  209|      0|  }
  210|  1.31M|  if (objSize <= 0 || nObjs < 0 || nObjs >= INT_MAX / objSize) {
  ------------------
  |  Branch (210:7): [True: 0, False: 1.31M]
  |  Branch (210:23): [True: 0, False: 1.31M]
  |  Branch (210:36): [True: 0, False: 1.31M]
  ------------------
  211|      0|    gMemError("Bogus memory allocation size");
  212|      0|  }
  213|  1.31M|  n = nObjs * objSize;
  214|  1.31M|  return gmalloc(n);
  215|  1.31M|}
_Z5gfreePv:
  307|  1.31M|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|  1.31M|  if (p) {
  ------------------
  |  Branch (348:7): [True: 1.31M, False: 0]
  ------------------
  349|  1.31M|    free(p);
  350|  1.31M|  }
  351|  1.31M|#endif
  352|  1.31M|}

_ZN6ZxNodeC2Ev:
   64|  1.48M|ZxNode::ZxNode() {
   65|  1.48M|  next = NULL;
   66|  1.48M|  parent = NULL;
   67|       |  firstChild = lastChild = NULL;
   68|  1.48M|}
_ZN6ZxNodeD2Ev:
   70|  1.48M|ZxNode::~ZxNode() {
   71|  1.48M|  ZxNode *child;
   72|       |
   73|  2.95M|  while (firstChild) {
  ------------------
  |  Branch (73:10): [True: 1.47M, False: 1.48M]
  ------------------
   74|  1.47M|    child = firstChild;
   75|  1.47M|    firstChild = firstChild->next;
   76|  1.47M|    delete child;
   77|  1.47M|  }
   78|  1.48M|}
_ZN6ZxNode8addChildEPS_:
  186|  1.47M|void ZxNode::addChild(ZxNode *child) {
  187|  1.47M|  if (lastChild) {
  ------------------
  |  Branch (187:7): [True: 279k, False: 1.19M]
  ------------------
  188|   279k|    lastChild->next = child;
  189|   279k|    lastChild = child;
  190|  1.19M|  } else {
  191|  1.19M|    firstChild = lastChild = child;
  192|  1.19M|  }
  193|  1.47M|  child->parent = this;
  194|       |  child->next = NULL;
  195|  1.47M|}
_ZN5ZxDocC2Ev:
  199|  7.64k|ZxDoc::ZxDoc() {
  200|  7.64k|  xmlDecl = NULL;
  201|  7.64k|  docTypeDecl = NULL;
  202|       |  root = NULL;
  203|  7.64k|}
_ZN5ZxDoc7loadMemEPKcj:
  205|  3.82k|ZxDoc *ZxDoc::loadMem(const char *data, Guint dataLen) {
  206|  3.82k|  ZxDoc *doc;
  207|       |
  208|  3.82k|  doc = new ZxDoc();
  209|  3.82k|  if (!doc->parse(data, dataLen)) {
  ------------------
  |  Branch (209:7): [True: 1.33k, False: 2.48k]
  ------------------
  210|  1.33k|    delete doc;
  211|  1.33k|    return NULL;
  212|  1.33k|  }
  213|  2.48k|  return doc;
  214|  3.82k|}
_ZN5ZxDoc8addChildEP6ZxNode:
  262|  5.04k|void ZxDoc::addChild(ZxNode *node) {
  263|  5.04k|  if (node->isXMLDecl() && !xmlDecl) {
  ------------------
  |  Branch (263:7): [True: 813, False: 4.23k]
  |  Branch (263:28): [True: 813, False: 0]
  ------------------
  264|    813|    xmlDecl = (ZxXMLDecl *)node;
  265|  4.23k|  } else if (node->isDocTypeDecl() && !docTypeDecl) {
  ------------------
  |  Branch (265:14): [True: 254, False: 3.97k]
  |  Branch (265:39): [True: 254, False: 0]
  ------------------
  266|    254|    docTypeDecl = (ZxDocTypeDecl *)node;
  267|  3.97k|  } else if (node->isElement() && !root) {
  ------------------
  |  Branch (267:14): [True: 2.48k, False: 1.49k]
  |  Branch (267:35): [True: 2.48k, False: 0]
  ------------------
  268|  2.48k|    root = (ZxElement *)node;
  269|  2.48k|  }
  270|  5.04k|  ZxNode::addChild(node);
  271|  5.04k|}
_ZN5ZxDoc5parseEPKcj:
  273|  3.82k|bool ZxDoc::parse(const char *data, Guint dataLen) {
  274|  3.82k|  parsePtr = data;
  275|  3.82k|  parseEnd = data + dataLen;
  276|       |  
  277|  3.82k|  parseSpace();
  278|  3.82k|  parseBOM();
  279|  3.82k|  parseSpace();
  280|  3.82k|  parseXMLDecl(this);
  281|  3.82k|  parseMisc(this);
  282|  3.82k|  parseDocTypeDecl(this);
  283|  3.82k|  parseMisc(this);
  284|  3.82k|  if (match("<")) {
  ------------------
  |  Branch (284:7): [True: 2.48k, False: 1.33k]
  ------------------
  285|  2.48k|    parseElement(this);
  286|  2.48k|  }
  287|  3.82k|  parseMisc(this);
  288|       |  return root != NULL;
  289|  3.82k|}
_ZN5ZxDoc12parseXMLDeclEP6ZxNode:
  291|  3.82k|void ZxDoc::parseXMLDecl(ZxNode *par) {
  292|  3.82k|  GString *version, *encoding, *s;
  293|  3.82k|  bool standalone;
  294|       |
  295|  3.82k|  if (!match("<?xml")) {
  ------------------
  |  Branch (295:7): [True: 3.01k, False: 813]
  ------------------
  296|  3.01k|    return;
  297|  3.01k|  }
  298|    813|  parsePtr += 5;
  299|    813|  parseSpace();
  300|       |
  301|       |  // version
  302|    813|  version = NULL;
  303|    813|  if (match("version")) {
  ------------------
  |  Branch (303:7): [True: 199, False: 614]
  ------------------
  304|    199|    parsePtr += 7;
  305|    199|    parseSpace();
  306|    199|    if (match("=")) {
  ------------------
  |  Branch (306:9): [True: 135, False: 64]
  ------------------
  307|    135|      ++parsePtr;
  308|    135|      parseSpace();
  309|    135|      version = parseQuotedString();
  310|    135|    }
  311|    199|  }
  312|    813|  if (!version) {
  ------------------
  |  Branch (312:7): [True: 678, False: 135]
  ------------------
  313|    678|    version = new GString("1.0");
  314|    678|  }
  315|    813|  parseSpace();
  316|       |	
  317|       |  // encoding
  318|    813|  encoding = NULL;
  319|    813|  if (match("encoding")) {
  ------------------
  |  Branch (319:7): [True: 184, False: 629]
  ------------------
  320|    184|    parsePtr += 8;
  321|    184|    parseSpace();
  322|    184|    if (match("=")) {
  ------------------
  |  Branch (322:9): [True: 118, False: 66]
  ------------------
  323|    118|      ++parsePtr;
  324|    118|      parseSpace();
  325|    118|      encoding = parseQuotedString();
  326|    118|    }
  327|    184|  }
  328|    813|  parseSpace();
  329|       |
  330|       |  // standalone
  331|    813|  standalone = false;
  332|    813|  if (match("standalone")) {
  ------------------
  |  Branch (332:7): [True: 202, False: 611]
  ------------------
  333|    202|    parsePtr += 10;
  334|    202|    parseSpace();
  335|    202|    if (match("=")) {
  ------------------
  |  Branch (335:9): [True: 134, False: 68]
  ------------------
  336|    134|      ++parsePtr;
  337|    134|      parseSpace();
  338|    134|      s = parseQuotedString();
  339|    134|      standalone = !s->cmp("yes");
  340|    134|      delete s;
  341|    134|    }
  342|    202|  }
  343|    813|  parseSpace();
  344|       |
  345|    813|  if (match("?>")) {
  ------------------
  |  Branch (345:7): [True: 4, False: 809]
  ------------------
  346|      4|    parsePtr += 2;
  347|      4|  }
  348|       |
  349|    813|  par->addChild(new ZxXMLDecl(version, encoding, standalone));
  350|    813|}
_ZN5ZxDoc16parseDocTypeDeclEP6ZxNode:
  353|  3.82k|void ZxDoc::parseDocTypeDecl(ZxNode *par) {
  354|  3.82k|  GString *name;
  355|  3.82k|  int state;
  356|  3.82k|  char c, quote;
  357|       |
  358|  3.82k|  if (!match("<!DOCTYPE")) {
  ------------------
  |  Branch (358:7): [True: 3.56k, False: 254]
  ------------------
  359|  3.56k|    return;
  360|  3.56k|  }
  361|    254|  parsePtr += 9;
  362|    254|  parseSpace();
  363|       |
  364|    254|  name = parseName();
  365|    254|  parseSpace();
  366|       |
  367|    254|  state = 0;
  368|    254|  quote = '\0';
  369|  27.9k|  while (parsePtr < parseEnd && state < 4) {
  ------------------
  |  Branch (369:10): [True: 27.7k, False: 245]
  |  Branch (369:33): [True: 27.7k, False: 9]
  ------------------
  370|  27.7k|    c = *parsePtr++;
  371|  27.7k|    switch (state) {
  ------------------
  |  Branch (371:13): [True: 27.7k, False: 0]
  ------------------
  372|  8.52k|    case 0: // not in square brackets; not in quotes
  ------------------
  |  Branch (372:5): [True: 8.52k, False: 19.1k]
  ------------------
  373|  8.52k|      if (c == '>') {
  ------------------
  |  Branch (373:11): [True: 10, False: 8.51k]
  ------------------
  374|     10|	state = 4;
  375|  8.51k|      } else if (c == '"' || c == '\'') {
  ------------------
  |  Branch (375:18): [True: 266, False: 8.24k]
  |  Branch (375:30): [True: 346, False: 7.89k]
  ------------------
  376|    612|	state = 1;
  377|  7.89k|      } else if (c == '[') {
  ------------------
  |  Branch (377:18): [True: 571, False: 7.32k]
  ------------------
  378|    571|	state = 2;
  379|    571|      }
  380|  8.52k|      break;
  381|  1.78k|    case 1: // not in square brackets; in quotes
  ------------------
  |  Branch (381:5): [True: 1.78k, False: 25.9k]
  ------------------
  382|  1.78k|      if (c == quote) {
  ------------------
  |  Branch (382:11): [True: 579, False: 1.20k]
  ------------------
  383|    579|	state = 0;
  384|    579|      }
  385|  1.78k|      break;
  386|  4.47k|    case 2: // in square brackets; not in quotes
  ------------------
  |  Branch (386:5): [True: 4.47k, False: 23.2k]
  ------------------
  387|  4.47k|      if (c == ']') {
  ------------------
  |  Branch (387:11): [True: 495, False: 3.98k]
  ------------------
  388|    495|	state = 0;
  389|  3.98k|      } else if (c == '"' || c == '\'') {
  ------------------
  |  Branch (389:18): [True: 405, False: 3.57k]
  |  Branch (389:30): [True: 301, False: 3.27k]
  ------------------
  390|    706|	state = 3;
  391|    706|      }
  392|  4.47k|      break;
  393|  12.9k|    case 3: // in square brackets; in quotes
  ------------------
  |  Branch (393:5): [True: 12.9k, False: 14.7k]
  ------------------
  394|  12.9k|      if (c == quote) {
  ------------------
  |  Branch (394:11): [True: 675, False: 12.2k]
  ------------------
  395|    675|	state = 2;
  396|    675|      }
  397|  12.9k|      break;
  398|  27.7k|    }
  399|  27.7k|  }
  400|       |
  401|    254|  par->addChild(new ZxDocTypeDecl(name));
  402|    254|}
_ZN5ZxDoc12parseElementEP6ZxNode:
  405|  1.31M|void ZxDoc::parseElement(ZxNode *par) {
  406|  1.31M|  GString *type;
  407|  1.31M|  ZxElement *elem;
  408|  1.31M|  ZxAttr *attr;
  409|       |
  410|  1.31M|  ++parsePtr;
  411|  1.31M|  type = parseName();
  412|  1.31M|  elem = new ZxElement(type);
  413|  1.31M|  parseSpace();
  414|  2.22M|  while ((attr = parseAttr())) {
  ------------------
  |  Branch (414:10): [True: 907k, False: 1.31M]
  ------------------
  415|   907k|    elem->addAttr(attr);
  416|   907k|    parseSpace();
  417|   907k|  }
  418|  1.31M|  if (match("/>")) {
  ------------------
  |  Branch (418:7): [True: 25.5k, False: 1.29M]
  ------------------
  419|  25.5k|    parsePtr += 2;
  420|  1.29M|  } else if (match(">")) {
  ------------------
  |  Branch (420:14): [True: 1.19M, False: 94.2k]
  ------------------
  421|  1.19M|    ++parsePtr;
  422|  1.19M|    parseContent(elem);
  423|  1.19M|  }
  424|  1.31M|  par->addChild(elem);
  425|  1.31M|}
_ZN5ZxDoc9parseAttrEv:
  427|  2.22M|ZxAttr *ZxDoc::parseAttr() {
  428|  2.22M|  GString *name, *value;
  429|  2.22M|  const char *start;
  430|  2.22M|  char quote, c;
  431|  2.22M|  unsigned int x;
  432|  2.22M|  int n;
  433|       |
  434|  2.22M|  name = parseName();
  435|  2.22M|  parseSpace();
  436|  2.22M|  if (!match("=")) {
  ------------------
  |  Branch (436:7): [True: 1.30M, False: 915k]
  ------------------
  437|  1.30M|    delete name;
  438|  1.30M|    return NULL;
  439|  1.30M|  }
  440|   915k|  ++parsePtr;
  441|   915k|  parseSpace();
  442|   915k|  if (!(parsePtr < parseEnd && (*parsePtr == '"' || *parsePtr == '\''))) {
  ------------------
  |  Branch (442:9): [True: 915k, False: 37]
  |  Branch (442:33): [True: 865k, False: 50.0k]
  |  Branch (442:53): [True: 41.9k, False: 8.13k]
  ------------------
  443|  8.17k|    delete name;
  444|  8.17k|    return NULL;
  445|  8.17k|  }
  446|   907k|  quote = *parsePtr++;
  447|   907k|  value = new GString();
  448|  1.14M|  while (parsePtr < parseEnd && *parsePtr != quote) {
  ------------------
  |  Branch (448:10): [True: 1.14M, False: 611]
  |  Branch (448:33): [True: 237k, False: 907k]
  ------------------
  449|   237k|    if (*parsePtr == '&') {
  ------------------
  |  Branch (449:9): [True: 150k, False: 87.2k]
  ------------------
  450|   150k|      ++parsePtr;
  451|   150k|      if (parsePtr < parseEnd && *parsePtr == '#') {
  ------------------
  |  Branch (451:11): [True: 150k, False: 27]
  |  Branch (451:34): [True: 33.6k, False: 116k]
  ------------------
  452|  33.6k|	++parsePtr;
  453|  33.6k|	if (parsePtr < parseEnd && *parsePtr == 'x') {
  ------------------
  |  Branch (453:6): [True: 33.6k, False: 8]
  |  Branch (453:29): [True: 12.8k, False: 20.7k]
  ------------------
  454|  12.8k|	  ++parsePtr;
  455|  12.8k|	  x = 0;
  456|  70.2k|	  while (parsePtr < parseEnd) {
  ------------------
  |  Branch (456:11): [True: 70.2k, False: 40]
  ------------------
  457|  70.2k|	    c = *parsePtr;
  458|  70.2k|	    if (c >= '0' && c <= '9') {
  ------------------
  |  Branch (458:10): [True: 63.0k, False: 7.12k]
  |  Branch (458:22): [True: 8.96k, False: 54.1k]
  ------------------
  459|  8.96k|	      x = (x << 4) + (c - '0');
  460|  61.2k|	    } else if (c >= 'a' && c <= 'f') {
  ------------------
  |  Branch (460:17): [True: 25.9k, False: 35.3k]
  |  Branch (460:29): [True: 25.2k, False: 665]
  ------------------
  461|  25.2k|	      x = (x << 4) + (10 + c - 'a');
  462|  36.0k|	    } else if (c >= 'A' && c <= 'F') {
  ------------------
  |  Branch (462:17): [True: 25.0k, False: 11.0k]
  |  Branch (462:29): [True: 23.1k, False: 1.82k]
  ------------------
  463|  23.1k|	      x = (x << 4) + (10 + c - 'A');
  464|  23.1k|	    } else {
  465|  12.8k|	      break;
  466|  12.8k|	    }
  467|  57.3k|	    ++parsePtr;
  468|  57.3k|	  }
  469|  12.8k|	  if (parsePtr < parseEnd && *parsePtr == ';') {
  ------------------
  |  Branch (469:8): [True: 12.8k, False: 40]
  |  Branch (469:31): [True: 2.58k, False: 10.2k]
  ------------------
  470|  2.58k|	    ++parsePtr;
  471|  2.58k|	  }
  472|  12.8k|	  appendUTF8(value, x);
  473|  20.7k|	} else {
  474|  20.7k|	  x = 0;
  475|  80.3k|	  while (parsePtr < parseEnd) {
  ------------------
  |  Branch (475:11): [True: 80.3k, False: 14]
  ------------------
  476|  80.3k|	    c = *parsePtr;
  477|  80.3k|	    if (c >= '0' && c <= '9') {
  ------------------
  |  Branch (477:10): [True: 65.8k, False: 14.4k]
  |  Branch (477:22): [True: 59.5k, False: 6.34k]
  ------------------
  478|  59.5k|	      x = x * 10 + (c - '0');
  479|  59.5k|	    } else {
  480|  20.7k|	      break;
  481|  20.7k|	    }
  482|  59.5k|	    ++parsePtr;
  483|  59.5k|	  }
  484|  20.7k|	  if (parsePtr < parseEnd && *parsePtr == ';') {
  ------------------
  |  Branch (484:8): [True: 20.7k, False: 14]
  |  Branch (484:31): [True: 2.08k, False: 18.6k]
  ------------------
  485|  2.08k|	    ++parsePtr;
  486|  2.08k|	  }
  487|  20.7k|	  appendUTF8(value, x);
  488|  20.7k|	}
  489|   116k|      } else {
  490|   116k|	start = parsePtr;
  491|   116k|	for (++parsePtr;
  492|  18.1M|	     parsePtr < parseEnd && *parsePtr != ';' &&
  ------------------
  |  Branch (492:7): [True: 18.1M, False: 297]
  |  Branch (492:30): [True: 18.1M, False: 3.35k]
  ------------------
  493|  18.1M|	       *parsePtr != quote && *parsePtr != '&';
  ------------------
  |  Branch (493:9): [True: 18.1M, False: 4.72k]
  |  Branch (493:31): [True: 18.0M, False: 108k]
  ------------------
  494|  18.0M|	     ++parsePtr) ;
  495|   116k|	n = (int)(parsePtr - start);
  496|   116k|	if (parsePtr < parseEnd && *parsePtr == ';') {
  ------------------
  |  Branch (496:6): [True: 116k, False: 297]
  |  Branch (496:29): [True: 3.35k, False: 113k]
  ------------------
  497|  3.35k|	  ++parsePtr;
  498|  3.35k|	}
  499|   116k|	if (n == 2 && !strncmp(start, "lt", 2)) {
  ------------------
  |  Branch (499:6): [True: 21.5k, False: 95.3k]
  |  Branch (499:16): [True: 1.22k, False: 20.3k]
  ------------------
  500|  1.22k|	  value->append('<');
  501|   115k|	} else if (n == 2 && !strncmp(start, "gt", 2)) {
  ------------------
  |  Branch (501:13): [True: 20.3k, False: 95.3k]
  |  Branch (501:23): [True: 14.3k, False: 6.00k]
  ------------------
  502|  14.3k|	  value->append('>');
  503|   101k|	} else if (n == 3 && !strncmp(start, "amp", 3)) {
  ------------------
  |  Branch (503:13): [True: 22.2k, False: 79.1k]
  |  Branch (503:23): [True: 17.7k, False: 4.55k]
  ------------------
  504|  17.7k|	  value->append('&');
  505|  83.6k|	} else if (n == 4 && !strncmp(start, "apos", 4)) {
  ------------------
  |  Branch (505:13): [True: 13.8k, False: 69.7k]
  |  Branch (505:23): [True: 1.43k, False: 12.4k]
  ------------------
  506|  1.43k|	  value->append('\'');
  507|  82.2k|	} else if (n == 4 && !strncmp(start, "quot", 4)) {
  ------------------
  |  Branch (507:13): [True: 12.4k, False: 69.7k]
  |  Branch (507:23): [True: 3.49k, False: 8.95k]
  ------------------
  508|  3.49k|	  value->append('"');
  509|  78.7k|	} else {
  510|  78.7k|	  value->append(start - 1, (int)(parsePtr - start) + 1);
  511|  78.7k|	}
  512|   116k|      }
  513|   150k|    } else {
  514|  87.2k|      start = parsePtr;
  515|  87.2k|      for (++parsePtr;
  516|  5.34M|	   parsePtr < parseEnd && *parsePtr != quote && *parsePtr != '&';
  ------------------
  |  Branch (516:5): [True: 5.34M, False: 137]
  |  Branch (516:28): [True: 5.27M, False: 69.9k]
  |  Branch (516:50): [True: 5.26M, False: 17.1k]
  ------------------
  517|  5.26M|	   ++parsePtr) ;
  518|  87.2k|      value->append(start, (int)(parsePtr - start));
  519|  87.2k|    }
  520|   237k|  }
  521|   907k|  if (parsePtr < parseEnd && *parsePtr == quote) {
  ------------------
  |  Branch (521:7): [True: 907k, False: 611]
  |  Branch (521:30): [True: 907k, False: 0]
  ------------------
  522|   907k|    ++parsePtr;
  523|   907k|  }
  524|   907k|  return new ZxAttr(name, value);
  525|   915k|}
_ZN5ZxDoc12parseContentEP9ZxElement:
  528|  1.19M|void ZxDoc::parseContent(ZxElement *par) {
  529|  1.19M|  GString *endType;
  530|       |
  531|  1.19M|  endType = (new GString("</"))->append(par->getType());
  532|       |
  533|  2.66M|  while (parsePtr < parseEnd) {
  ------------------
  |  Branch (533:10): [True: 1.48M, False: 1.17M]
  ------------------
  534|  1.48M|    if (match(endType->getCString())) {
  ------------------
  |  Branch (534:9): [True: 19.0k, False: 1.46M]
  ------------------
  535|  19.0k|      parsePtr += endType->getLength();
  536|  19.0k|      parseSpace();
  537|  19.0k|      if (match(">")) {
  ------------------
  |  Branch (537:11): [True: 4.97k, False: 14.0k]
  ------------------
  538|  4.97k|	++parsePtr;
  539|  4.97k|      }
  540|  19.0k|      break;
  541|  1.46M|    } else if (match("<?")) {
  ------------------
  |  Branch (541:16): [True: 13.4k, False: 1.45M]
  ------------------
  542|  13.4k|      parsePI(par);
  543|  1.45M|    } else if (match("<![CDATA[")) {
  ------------------
  |  Branch (543:16): [True: 4.98k, False: 1.45M]
  ------------------
  544|  4.98k|      parseCDSect(par);
  545|  1.45M|    } else if (match("<!--")) {
  ------------------
  |  Branch (545:16): [True: 746, False: 1.44M]
  ------------------
  546|    746|      parseComment(par);
  547|  1.44M|    } else if (match("<")) {
  ------------------
  |  Branch (547:16): [True: 1.31M, False: 135k]
  ------------------
  548|  1.31M|      parseElement(par);
  549|  1.31M|    } else {
  550|   135k|      parseCharData(par);
  551|   135k|    }
  552|  1.48M|  }
  553|       |
  554|  1.19M|  delete endType;
  555|  1.19M|}
_ZN5ZxDoc13parseCharDataEP9ZxElement:
  557|   135k|void ZxDoc::parseCharData(ZxElement *par) {
  558|   135k|  GString *data;
  559|   135k|  const char *start;
  560|   135k|  char c;
  561|   135k|  unsigned int x;
  562|   135k|  int n;
  563|       |
  564|   135k|  data = new GString();
  565|   705k|  while (parsePtr < parseEnd && *parsePtr != '<') {
  ------------------
  |  Branch (565:10): [True: 704k, False: 949]
  |  Branch (565:33): [True: 570k, False: 134k]
  ------------------
  566|   570k|    if (*parsePtr == '&') {
  ------------------
  |  Branch (566:9): [True: 433k, False: 137k]
  ------------------
  567|   433k|      ++parsePtr;
  568|   433k|      if (parsePtr < parseEnd && *parsePtr == '#') {
  ------------------
  |  Branch (568:11): [True: 433k, False: 52]
  |  Branch (568:34): [True: 88.2k, False: 345k]
  ------------------
  569|  88.2k|	++parsePtr;
  570|  88.2k|	if (parsePtr < parseEnd && *parsePtr == 'x') {
  ------------------
  |  Branch (570:6): [True: 88.2k, False: 8]
  |  Branch (570:29): [True: 20.8k, False: 67.3k]
  ------------------
  571|  20.8k|	  ++parsePtr;
  572|  20.8k|	  x = 0;
  573|   119k|	  while (parsePtr < parseEnd) {
  ------------------
  |  Branch (573:11): [True: 119k, False: 196]
  ------------------
  574|   119k|	    c = *parsePtr;
  575|   119k|	    if (c >= '0' && c <= '9') {
  ------------------
  |  Branch (575:10): [True: 107k, False: 11.7k]
  |  Branch (575:22): [True: 34.2k, False: 73.0k]
  ------------------
  576|  34.2k|	      x = (x << 4) + (c - '0');
  577|  84.8k|	    } else if (c >= 'a' && c <= 'f') {
  ------------------
  |  Branch (577:17): [True: 27.9k, False: 56.8k]
  |  Branch (577:29): [True: 26.9k, False: 1.05k]
  ------------------
  578|  26.9k|	      x = (x << 4) + (10 + c - 'a');
  579|  57.9k|	    } else if (c >= 'A' && c <= 'F') {
  ------------------
  |  Branch (579:17): [True: 39.1k, False: 18.7k]
  |  Branch (579:29): [True: 37.2k, False: 1.91k]
  ------------------
  580|  37.2k|	      x = (x << 4) + (10 + c - 'A');
  581|  37.2k|	    } else {
  582|  20.6k|	      break;
  583|  20.6k|	    }
  584|  98.4k|	    ++parsePtr;
  585|  98.4k|	  }
  586|  20.8k|	  if (parsePtr < parseEnd && *parsePtr == ';') {
  ------------------
  |  Branch (586:8): [True: 20.6k, False: 196]
  |  Branch (586:31): [True: 4.50k, False: 16.1k]
  ------------------
  587|  4.50k|	    ++parsePtr;
  588|  4.50k|	  }
  589|  20.8k|	  appendUTF8(data, x);
  590|  67.3k|	} else {
  591|  67.3k|	  x = 0;
  592|   272k|	  while (parsePtr < parseEnd) {
  ------------------
  |  Branch (592:11): [True: 272k, False: 68]
  ------------------
  593|   272k|	    c = *parsePtr;
  594|   272k|	    if (c >= '0' && c <= '9') {
  ------------------
  |  Branch (594:10): [True: 236k, False: 35.9k]
  |  Branch (594:22): [True: 204k, False: 31.3k]
  ------------------
  595|   204k|	      x = x * 10 + (c - '0');
  596|   204k|	    } else {
  597|  67.2k|	      break;
  598|  67.2k|	    }
  599|   204k|	    ++parsePtr;
  600|   204k|	  }
  601|  67.3k|	  if (parsePtr < parseEnd && *parsePtr == ';') {
  ------------------
  |  Branch (601:8): [True: 67.2k, False: 68]
  |  Branch (601:31): [True: 18.4k, False: 48.8k]
  ------------------
  602|  18.4k|	    ++parsePtr;
  603|  18.4k|	  }
  604|  67.3k|	  appendUTF8(data, x);
  605|  67.3k|	}
  606|   345k|      } else {
  607|   345k|	start = parsePtr;
  608|   345k|	for (++parsePtr;
  609|  19.5M|	     parsePtr < parseEnd && *parsePtr != ';' &&
  ------------------
  |  Branch (609:7): [True: 19.5M, False: 332]
  |  Branch (609:30): [True: 19.5M, False: 7.05k]
  ------------------
  610|  19.5M|	       *parsePtr != '<' && *parsePtr != '&';
  ------------------
  |  Branch (610:9): [True: 19.5M, False: 49.3k]
  |  Branch (610:29): [True: 19.2M, False: 288k]
  ------------------
  611|  19.2M|	     ++parsePtr) ;
  612|   345k|	n = (int)(parsePtr - start);
  613|   345k|	if (parsePtr < parseEnd && *parsePtr == ';') {
  ------------------
  |  Branch (613:6): [True: 344k, False: 332]
  |  Branch (613:29): [True: 7.05k, False: 337k]
  ------------------
  614|  7.05k|	  ++parsePtr;
  615|  7.05k|	}
  616|   345k|	if (n == 2 && !strncmp(start, "lt", 2)) {
  ------------------
  |  Branch (616:6): [True: 134k, False: 210k]
  |  Branch (616:16): [True: 3.27k, False: 131k]
  ------------------
  617|  3.27k|	  data->append('<');
  618|   341k|	} else if (n == 2 && !strncmp(start, "gt", 2)) {
  ------------------
  |  Branch (618:13): [True: 131k, False: 210k]
  |  Branch (618:23): [True: 100k, False: 30.8k]
  ------------------
  619|   100k|	  data->append('>');
  620|   241k|	} else if (n == 3 && !strncmp(start, "amp", 3)) {
  ------------------
  |  Branch (620:13): [True: 54.5k, False: 187k]
  |  Branch (620:23): [True: 32.3k, False: 22.1k]
  ------------------
  621|  32.3k|	  data->append('&');
  622|   209k|	} else if (n == 4 && !strncmp(start, "apos", 4)) {
  ------------------
  |  Branch (622:13): [True: 60.9k, False: 148k]
  |  Branch (622:23): [True: 1.48k, False: 59.5k]
  ------------------
  623|  1.48k|	  data->append('\'');
  624|   207k|	} else if (n == 4 && !strncmp(start, "quot", 4)) {
  ------------------
  |  Branch (624:13): [True: 59.5k, False: 148k]
  |  Branch (624:23): [True: 16.8k, False: 42.6k]
  ------------------
  625|  16.8k|	  data->append('"');
  626|   190k|	} else {
  627|   190k|	  data->append(start - 1, (int)(parsePtr - start) + 1);
  628|   190k|	}
  629|   345k|      }
  630|   433k|    } else {
  631|   137k|      start = parsePtr;
  632|   137k|      for (++parsePtr;
  633|  13.8M|	   parsePtr < parseEnd && *parsePtr != '<' && *parsePtr != '&';
  ------------------
  |  Branch (633:5): [True: 13.8M, False: 330]
  |  Branch (633:28): [True: 13.7M, False: 81.3k]
  |  Branch (633:48): [True: 13.6M, False: 55.4k]
  ------------------
  634|  13.6M|	   ++parsePtr) ;
  635|   137k|      data->append(start, (int)(parsePtr - start));
  636|   137k|    }
  637|   570k|  }
  638|   135k|  par->addChild(new ZxCharData(data, true));
  639|   135k|}
_ZN5ZxDoc10appendUTF8EP7GStringj:
  641|   121k|void ZxDoc::appendUTF8(GString *s, unsigned int c) {
  642|   121k|  if (c <= 0x7f) {
  ------------------
  |  Branch (642:7): [True: 61.1k, False: 60.7k]
  ------------------
  643|  61.1k|    s->append((char)c);
  644|  61.1k|  } else if (c <= 0x7ff) {
  ------------------
  |  Branch (644:14): [True: 7.78k, False: 52.9k]
  ------------------
  645|  7.78k|    s->append((char)(0xc0 + (c >> 6)));
  646|  7.78k|    s->append((char)(0x80 + (c & 0x3f)));
  647|  52.9k|  } else if (c <= 0xffff) {
  ------------------
  |  Branch (647:14): [True: 14.6k, False: 38.2k]
  ------------------
  648|  14.6k|    s->append((char)(0xe0 + (c >> 12)));
  649|  14.6k|    s->append((char)(0x80 + ((c >> 6) & 0x3f)));
  650|  14.6k|    s->append((char)(0x80 + (c & 0x3f)));
  651|  38.2k|  } else if (c <= 0x1fffff) {
  ------------------
  |  Branch (651:14): [True: 14.9k, False: 23.3k]
  ------------------
  652|  14.9k|    s->append((char)(0xf0 + (c >> 18)));
  653|  14.9k|    s->append((char)(0x80 + ((c >> 12) & 0x3f)));
  654|  14.9k|    s->append((char)(0x80 + ((c >> 6) & 0x3f)));
  655|  14.9k|    s->append((char)(0x80 + (c & 0x3f)));
  656|  23.3k|  } else if (c <= 0x3ffffff) {
  ------------------
  |  Branch (656:14): [True: 5.33k, False: 17.9k]
  ------------------
  657|  5.33k|    s->append((char)(0xf8 + (c >> 24)));
  658|  5.33k|    s->append((char)(0x80 + ((c >> 18) & 0x3f)));
  659|  5.33k|    s->append((char)(0x80 + ((c >> 12) & 0x3f)));
  660|  5.33k|    s->append((char)(0x80 + ((c >> 6) & 0x3f)));
  661|  5.33k|    s->append((char)(0x80 + (c & 0x3f)));
  662|  17.9k|  } else if (c <= 0x7fffffff) {
  ------------------
  |  Branch (662:14): [True: 12.2k, False: 5.71k]
  ------------------
  663|  12.2k|    s->append((char)(0xfc + (c >> 30)));
  664|  12.2k|    s->append((char)(0x80 + ((c >> 24) & 0x3f)));
  665|  12.2k|    s->append((char)(0x80 + ((c >> 18) & 0x3f)));
  666|  12.2k|    s->append((char)(0x80 + ((c >> 12) & 0x3f)));
  667|  12.2k|    s->append((char)(0x80 + ((c >> 6) & 0x3f)));
  668|  12.2k|    s->append((char)(0x80 + (c & 0x3f)));
  669|  12.2k|  }
  670|   121k|}
_ZN5ZxDoc11parseCDSectEP6ZxNode:
  673|  4.98k|void ZxDoc::parseCDSect(ZxNode *par) {
  674|  4.98k|  const char *start;
  675|       |
  676|  4.98k|  parsePtr += 9;
  677|  4.98k|  start = parsePtr;
  678|   502k|  while (parsePtr < parseEnd - 3) {
  ------------------
  |  Branch (678:10): [True: 502k, False: 46]
  ------------------
  679|   502k|    if (!strncmp(parsePtr, "]]>", 3)) {
  ------------------
  |  Branch (679:9): [True: 4.94k, False: 497k]
  ------------------
  680|  4.94k|      par->addChild(new ZxCharData(new GString(start, (int)(parsePtr - start)),
  681|  4.94k|				   false));
  682|  4.94k|      parsePtr += 3;
  683|  4.94k|      return;
  684|  4.94k|    }
  685|   497k|    ++parsePtr;
  686|   497k|  }
  687|     46|  parsePtr = parseEnd;
  688|     46|  par->addChild(new ZxCharData(new GString(start, (int)(parsePtr - start)),
  689|     46|			       false));
  690|     46|}
_ZN5ZxDoc9parseMiscEP6ZxNode:
  692|  11.4k|void ZxDoc::parseMisc(ZxNode *par) {
  693|  14.7k|  while (1) {
  ------------------
  |  Branch (693:10): [True: 14.7k, Folded]
  ------------------
  694|  14.7k|    if (match("<!--")) {
  ------------------
  |  Branch (694:9): [True: 653, False: 14.0k]
  ------------------
  695|    653|      parseComment(par);
  696|  14.0k|    } else if (match("<?")) {
  ------------------
  |  Branch (696:16): [True: 881, False: 13.2k]
  ------------------
  697|    881|      parsePI(par);
  698|  13.2k|    } else if (parsePtr < parseEnd && (*parsePtr == '\x20' ||
  ------------------
  |  Branch (698:16): [True: 8.59k, False: 4.62k]
  |  Branch (698:40): [True: 1.00k, False: 7.58k]
  ------------------
  699|  7.58k|				       *parsePtr == '\x09' ||
  ------------------
  |  Branch (699:12): [True: 437, False: 7.15k]
  ------------------
  700|  7.15k|				       *parsePtr == '\x0d' ||
  ------------------
  |  Branch (700:12): [True: 192, False: 6.95k]
  ------------------
  701|  6.95k|				       *parsePtr == '\x0a')) {
  ------------------
  |  Branch (701:12): [True: 111, False: 6.84k]
  ------------------
  702|  1.74k|      ++parsePtr;
  703|  11.4k|    } else {
  704|  11.4k|      break;
  705|  11.4k|    }
  706|  14.7k|  }
  707|  11.4k|}
_ZN5ZxDoc12parseCommentEP6ZxNode:
  710|  1.39k|void ZxDoc::parseComment(ZxNode *par) {
  711|  1.39k|  const char *start;
  712|       |
  713|  1.39k|  parsePtr += 4;
  714|  1.39k|  start = parsePtr;
  715|   162k|  while (parsePtr <= parseEnd - 3) {
  ------------------
  |  Branch (715:10): [True: 162k, False: 59]
  ------------------
  716|   162k|    if (!strncmp(parsePtr, "-->", 3)) {
  ------------------
  |  Branch (716:9): [True: 1.34k, False: 160k]
  ------------------
  717|  1.34k|      par->addChild(new ZxComment(new GString(start, (int)(parsePtr - start))));
  718|  1.34k|      parsePtr += 3;
  719|  1.34k|      return;
  720|  1.34k|    }
  721|   160k|    ++parsePtr;
  722|   160k|  }
  723|     59|  parsePtr = parseEnd;
  724|     59|}
_ZN5ZxDoc7parsePIEP6ZxNode:
  727|  14.2k|void ZxDoc::parsePI(ZxNode *par) {
  728|  14.2k|  GString *target;
  729|  14.2k|  const char *start;
  730|       |
  731|  14.2k|  parsePtr += 2;
  732|  14.2k|  target = parseName();
  733|  14.2k|  parseSpace();
  734|  14.2k|  start = parsePtr;
  735|  6.91M|  while (parsePtr <= parseEnd - 2) {
  ------------------
  |  Branch (735:10): [True: 6.91M, False: 209]
  ------------------
  736|  6.91M|    if (!strncmp(parsePtr, "?>", 2)) {
  ------------------
  |  Branch (736:9): [True: 14.0k, False: 6.90M]
  ------------------
  737|  14.0k|      par->addChild(new ZxPI(target, new GString(start,
  738|  14.0k|						 (int)(parsePtr - start))));
  739|  14.0k|      parsePtr += 2;
  740|  14.0k|      return;
  741|  14.0k|    }
  742|  6.90M|    ++parsePtr;
  743|  6.90M|  }
  744|    209|  parsePtr = parseEnd;
  745|    209|  par->addChild(new ZxPI(target, new GString(start, (int)(parsePtr - start))));
  746|    209|}
_ZN5ZxDoc9parseNameEv:
  750|  3.55M|GString *ZxDoc::parseName() {
  751|  3.55M|  GString *name;
  752|       |
  753|  3.55M|  name = new GString();
  754|  3.55M|  if (parsePtr < parseEnd && nameStartChar[*parsePtr & 0xff]) {
  ------------------
  |  Branch (754:7): [True: 3.55M, False: 1.16k]
  |  Branch (754:30): [True: 107k, False: 3.44M]
  ------------------
  755|   107k|    name->append(*parsePtr++);
  756|  12.9M|    while (parsePtr < parseEnd && nameChar[*parsePtr & 0xff]) {
  ------------------
  |  Branch (756:12): [True: 12.9M, False: 107]
  |  Branch (756:35): [True: 12.8M, False: 107k]
  ------------------
  757|  12.8M|      name->append(*parsePtr++);
  758|  12.8M|    }
  759|   107k|  }
  760|  3.55M|  return name;
  761|  3.55M|}
_ZN5ZxDoc17parseQuotedStringEv:
  763|    387|GString *ZxDoc::parseQuotedString() {
  764|    387|  GString *s;
  765|    387|  const char *start;
  766|    387|  char quote;
  767|       |
  768|    387|  if (parsePtr < parseEnd && (*parsePtr == '"' || *parsePtr == '\'')) {
  ------------------
  |  Branch (768:7): [True: 290, False: 97]
  |  Branch (768:31): [True: 84, False: 206]
  |  Branch (768:51): [True: 91, False: 115]
  ------------------
  769|    175|    quote = *parsePtr++;
  770|    175|    start = parsePtr;
  771|    676|    while (parsePtr < parseEnd && *parsePtr != quote) {
  ------------------
  |  Branch (771:12): [True: 629, False: 47]
  |  Branch (771:35): [True: 501, False: 128]
  ------------------
  772|    501|      ++parsePtr;
  773|    501|    }
  774|    175|    s = new GString(start, (int)(parsePtr - start));
  775|    175|    if (parsePtr < parseEnd && *parsePtr == quote) {
  ------------------
  |  Branch (775:9): [True: 128, False: 47]
  |  Branch (775:32): [True: 128, False: 0]
  ------------------
  776|    128|      ++parsePtr;
  777|    128|    }
  778|    212|  } else {
  779|    212|    s = new GString();
  780|    212|  }
  781|    387|  return s;
  782|    387|}
_ZN5ZxDoc8parseBOMEv:
  784|  3.82k|void ZxDoc::parseBOM() {
  785|  3.82k|  if (match("\xef\xbb\xbf")) {
  ------------------
  |  Branch (785:7): [True: 35, False: 3.78k]
  ------------------
  786|     35|    parsePtr += 3;
  787|     35|  }
  788|  3.82k|}
_ZN5ZxDoc10parseSpaceEv:
  790|  5.41M|void ZxDoc::parseSpace() {
  791|  5.68M|  while (parsePtr < parseEnd && (*parsePtr == '\x20' ||
  ------------------
  |  Branch (791:10): [True: 5.68M, False: 3.20k]
  |  Branch (791:34): [True: 104k, False: 5.57M]
  ------------------
  792|  5.57M|				 *parsePtr == '\x09' ||
  ------------------
  |  Branch (792:6): [True: 63.2k, False: 5.51M]
  ------------------
  793|  5.51M|				 *parsePtr == '\x0d' ||
  ------------------
  |  Branch (793:6): [True: 58.9k, False: 5.45M]
  ------------------
  794|  5.45M|				 *parsePtr == '\x0a')) {
  ------------------
  |  Branch (794:6): [True: 48.1k, False: 5.40M]
  ------------------
  795|   274k|    ++parsePtr;
  796|   274k|  }
  797|  5.41M|}
_ZN5ZxDoc5matchEPKc:
  799|  12.2M|bool ZxDoc::match(const char *s) {
  800|  12.2M|  int n;
  801|       |
  802|  12.2M|  n = (int)strlen(s);
  803|  12.2M|  return parseEnd - parsePtr >= n && !strncmp(parsePtr, s, n);
  ------------------
  |  Branch (803:10): [True: 12.1M, False: 22.1k]
  |  Branch (803:38): [True: 3.50M, False: 8.68M]
  ------------------
  804|  12.2M|}
_ZN9ZxXMLDeclC2EP7GStringS1_b:
  822|    813|ZxXMLDecl::ZxXMLDecl(GString *versionA, GString *encodingA, bool standaloneA) {
  823|    813|  version = versionA;
  824|    813|  encoding = encodingA;
  825|    813|  standalone = standaloneA;
  826|    813|}
_ZN9ZxXMLDeclD2Ev:
  828|    813|ZxXMLDecl::~ZxXMLDecl() {
  829|    813|  delete version;
  830|    813|  if (encoding) {
  ------------------
  |  Branch (830:7): [True: 118, False: 695]
  ------------------
  831|    118|    delete encoding;
  832|    118|  }
  833|    813|}
_ZN13ZxDocTypeDeclC2EP7GString:
  858|    254|ZxDocTypeDecl::ZxDocTypeDecl(GString *nameA) {
  859|    254|  name = nameA;
  860|    254|}
_ZN13ZxDocTypeDeclD2Ev:
  862|    254|ZxDocTypeDecl::~ZxDocTypeDecl() {
  863|    254|  delete name;
  864|    254|}
_ZN9ZxCommentC2EP7GString:
  880|  1.34k|ZxComment::ZxComment(GString *textA) {
  881|  1.34k|  text = textA;
  882|  1.34k|}
_ZN9ZxCommentD2Ev:
  884|  1.34k|ZxComment::~ZxComment() {
  885|  1.34k|  delete text;
  886|  1.34k|}
_ZN4ZxPIC2EP7GStringS1_:
  902|  14.2k|ZxPI::ZxPI(GString *targetA, GString *textA) {
  903|  14.2k|  target = targetA;
  904|  14.2k|  text = textA;
  905|  14.2k|}
_ZN4ZxPID2Ev:
  907|  14.2k|ZxPI::~ZxPI() {
  908|  14.2k|  delete target;
  909|  14.2k|  delete text;
  910|  14.2k|}
_ZN9ZxElementC2EP7GString:
  928|  1.31M|ZxElement::ZxElement(GString *typeA) {
  929|  1.31M|  type = typeA;
  930|  1.31M|  attrs = new GHash();
  931|       |  firstAttr = lastAttr = NULL;
  932|  1.31M|}
_ZN9ZxElementD2Ev:
  934|  1.31M|ZxElement::~ZxElement() {
  935|  1.31M|  delete type;
  936|  1.31M|  deleteGHash(attrs, ZxAttr);
  ------------------
  |  |   60|  1.31M|  do {                                             \
  |  |   61|  1.31M|    GHash *_hash = (hash);                         \
  |  |   62|  1.31M|    {                                              \
  |  |   63|  1.31M|      GHashIter *_iter;                            \
  |  |   64|  1.31M|      GString *_key;                               \
  |  |   65|  1.31M|      void *_p;                                    \
  |  |   66|  1.31M|      _hash->startIter(&_iter);                    \
  |  |   67|  2.22M|      while (_hash->getNext(&_iter, &_key, &_p)) { \
  |  |  ------------------
  |  |  |  Branch (67:14): [True: 907k, False: 1.31M]
  |  |  ------------------
  |  |   68|   907k|        delete (T*)_p;                             \
  |  |   69|   907k|      }                                            \
  |  |   70|  1.31M|      delete _hash;                                \
  |  |   71|  1.31M|    }                                              \
  |  |   72|  1.31M|  } while(0)
  |  |  ------------------
  |  |  |  Branch (72:11): [Folded, False: 1.31M]
  |  |  ------------------
  ------------------
  937|  1.31M|}
_ZN9ZxElement7addAttrEP6ZxAttr:
  947|   907k|void ZxElement::addAttr(ZxAttr *attr) {
  948|   907k|  attrs->add(attr->getName(), attr);
  949|   907k|  if (lastAttr) {
  ------------------
  |  Branch (949:7): [True: 869k, False: 38.6k]
  ------------------
  950|   869k|    lastAttr->next = attr;
  951|   869k|    lastAttr= attr;
  952|   869k|  } else {
  953|  38.6k|    firstAttr = lastAttr = attr;
  954|  38.6k|  }
  955|   907k|  attr->parent = this;
  956|       |  attr->next = NULL;
  957|   907k|}
_ZN6ZxAttrC2EP7GStringS1_:
 1025|   907k|ZxAttr::ZxAttr(GString *nameA, GString *valueA) {
 1026|   907k|  name = nameA;
 1027|   907k|  value = valueA;
 1028|   907k|  parent = NULL;
 1029|       |  next = NULL;
 1030|   907k|}
_ZN6ZxAttrD2Ev:
 1032|   907k|ZxAttr::~ZxAttr() {
 1033|   907k|  delete name;
 1034|   907k|  delete value;
 1035|   907k|}
_ZN10ZxCharDataC2EP7GStringb:
 1039|   140k|ZxCharData::ZxCharData(GString *dataA, bool parsedA) {
 1040|   140k|  data = dataA;
 1041|   140k|  parsed = parsedA;
 1042|   140k|}
_ZN10ZxCharDataD2Ev:
 1044|   140k|ZxCharData::~ZxCharData() {
 1045|   140k|  delete data;
 1046|   140k|}

_ZN6ZxNode9isXMLDeclEv:
   36|  4.23k|  virtual bool isXMLDecl()  { return false; }
_ZN6ZxNode13isDocTypeDeclEv:
   37|  3.97k|  virtual bool isDocTypeDecl() { return false; }
_ZN6ZxNode9isElementEv:
   40|  1.49k|  virtual bool isElement() { return false; }
_ZN9ZxXMLDecl9isXMLDeclEv:
  129|    813|  virtual bool isXMLDecl() { return true; }
_ZN13ZxDocTypeDecl13isDocTypeDeclEv:
  151|    254|  virtual bool isDocTypeDecl() { return true; }
_ZN9ZxElement9isElementEv:
  207|  2.48k|  virtual bool isElement() { return true; }
_ZN9ZxElement7getTypeEv:
  209|  1.19M|  GString *getType() { return type; }
_ZN6ZxAttr7getNameEv:
  233|   907k|  GString *getName() { return name; }

