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

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

_ZN7GStringC2Ev:
  129|  4.66M|GString::GString() {
  130|       |  s = NULL;
  131|  4.66M|  resize(length = 0);
  132|  4.66M|  s[0] = '\0';
  133|  4.66M|}
_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|  18.4k|GString::GString(const char *sA, int lengthA) {
  144|       |  s = NULL;
  145|  18.4k|  resize(length = lengthA);
  146|  18.4k|  memcpy(s, sA, length * sizeof(char));
  147|  18.4k|  s[length] = '\0';
  148|  18.4k|}
_ZN7GStringD2Ev:
  204|  5.88M|GString::~GString() {
  205|  5.88M|  delete[] s;
  206|  5.88M|}
_ZN7GString6appendEc:
  214|  13.1M|GString *GString::append(char c) {
  215|  13.1M|  if (length > INT_MAX - 1) {
  ------------------
  |  Branch (215:7): [True: 0, False: 13.1M]
  ------------------
  216|      0|    gMemError("Integer overflow in GString::append()");
  217|      0|  }
  218|  13.1M|  resize(length + 1);
  219|  13.1M|  s[length++] = c;
  220|  13.1M|  s[length] = '\0';
  221|  13.1M|  return this;
  222|  13.1M|}
_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|   502k|GString *GString::append(const char *str, int lengthA) {
  249|   502k|  if (lengthA < 0 || length > INT_MAX - lengthA) {
  ------------------
  |  Branch (249:7): [True: 0, False: 502k]
  |  Branch (249:22): [True: 0, False: 502k]
  ------------------
  250|      0|    gMemError("Integer overflow in GString::append()");
  251|      0|  }
  252|   502k|  resize(length + lengthA);
  253|   502k|  memcpy(s + length, str, lengthA);
  254|   502k|  length += lengthA;
  255|   502k|  s[length] = '\0';
  256|   502k|  return this;
  257|   502k|}
_ZN7GString3cmpEPKc:
  810|    127|int GString::cmp(const char *sA) {
  811|    127|  int n1, i, x;
  812|    127|  const char *p1, *p2;
  813|       |
  814|    127|  n1 = length;
  815|    137|  for (i = 0, p1 = s, p2 = sA; i < n1 && *p2; ++i, ++p1, ++p2) {
  ------------------
  |  Branch (815:32): [True: 31, False: 106]
  |  Branch (815:42): [True: 30, False: 1]
  ------------------
  816|     30|    x = (*p1 & 0xff) - (*p2 & 0xff);
  817|     30|    if (x != 0) {
  ------------------
  |  Branch (817:9): [True: 20, False: 10]
  ------------------
  818|     20|      return x;
  819|     20|    }
  820|     30|  }
  821|    107|  if (i < n1) {
  ------------------
  |  Branch (821:7): [True: 1, False: 106]
  ------------------
  822|      1|    return 1;
  823|      1|  }
  824|    106|  if (*p2) {
  ------------------
  |  Branch (824:7): [True: 105, False: 1]
  ------------------
  825|    105|    return -1;
  826|    105|  }
  827|      1|  return 0;
  828|    106|}
_ZN7GString6resizeEi:
  108|  20.7M|inline void GString::resize(int length1) {
  109|  20.7M|  char *s1;
  110|       |
  111|  20.7M|  if (length1 < 0) {
  ------------------
  |  Branch (111:7): [True: 0, False: 20.7M]
  ------------------
  112|      0|    gMemError("GString::resize() with negative length");
  113|      0|  }
  114|  20.7M|  if (!s) {
  ------------------
  |  Branch (114:7): [True: 5.88M, False: 14.8M]
  ------------------
  115|  5.88M|    s = new char[size(length1)];
  116|  14.8M|  } else if (size(length1) != size(length)) {
  ------------------
  |  Branch (116:14): [True: 145k, False: 14.7M]
  ------------------
  117|   145k|    s1 = new char[size(length1)];
  118|   145k|    if (length1 < length) {
  ------------------
  |  Branch (118:9): [True: 0, False: 145k]
  ------------------
  119|      0|      memcpy(s1, s, length1);
  120|      0|      s1[length1] = '\0';
  121|   145k|    } else {
  122|   145k|      memcpy(s1, s, length + 1);
  123|   145k|    }
  124|   145k|    delete[] s;
  125|   145k|    s = s1;
  126|   145k|  }
  127|  20.7M|}
GString.cc:_ZL4sizei:
   98|  35.7M|static inline int size(int len) {
   99|  35.7M|  int delta;
  100|   398M|  for (delta = 8; delta < len && delta < 0x100000; delta <<= 1) ;
  ------------------
  |  Branch (100:19): [True: 362M, False: 35.7M]
  |  Branch (100:34): [True: 362M, False: 0]
  ------------------
  101|  35.7M|  if (len > INT_MAX - delta) {
  ------------------
  |  Branch (101:7): [True: 0, False: 35.7M]
  ------------------
  102|      0|    gMemError("Integer overflow in GString::size()");
  103|      0|  }
  104|       |  // this is ((len + 1) + (delta - 1)) & ~(delta - 1)
  105|  35.7M|  return (len + delta) & ~(delta - 1);
  106|  35.7M|}

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

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

_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.96M|  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: 278k, False: 1.20M]
  ------------------
  188|   278k|    lastChild->next = child;
  189|   278k|    lastChild = child;
  190|  1.20M|  } else {
  191|  1.20M|    firstChild = lastChild = child;
  192|  1.20M|  }
  193|  1.47M|  child->parent = this;
  194|       |  child->next = NULL;
  195|  1.47M|}
_ZN5ZxDocC2Ev:
  199|  7.62k|ZxDoc::ZxDoc() {
  200|  7.62k|  xmlDecl = NULL;
  201|  7.62k|  docTypeDecl = NULL;
  202|       |  root = NULL;
  203|  7.62k|}
_ZN5ZxDoc7loadMemEPKcj:
  205|  3.81k|ZxDoc *ZxDoc::loadMem(const char *data, Guint dataLen) {
  206|  3.81k|  ZxDoc *doc;
  207|       |
  208|  3.81k|  doc = new ZxDoc();
  209|  3.81k|  if (!doc->parse(data, dataLen)) {
  ------------------
  |  Branch (209:7): [True: 1.31k, False: 2.49k]
  ------------------
  210|  1.31k|    delete doc;
  211|  1.31k|    return NULL;
  212|  1.31k|  }
  213|  2.49k|  return doc;
  214|  3.81k|}
_ZN5ZxDoc8addChildEP6ZxNode:
  262|  4.91k|void ZxDoc::addChild(ZxNode *node) {
  263|  4.91k|  if (node->isXMLDecl() && !xmlDecl) {
  ------------------
  |  Branch (263:7): [True: 777, False: 4.14k]
  |  Branch (263:28): [True: 777, False: 0]
  ------------------
  264|    777|    xmlDecl = (ZxXMLDecl *)node;
  265|  4.14k|  } else if (node->isDocTypeDecl() && !docTypeDecl) {
  ------------------
  |  Branch (265:14): [True: 250, False: 3.89k]
  |  Branch (265:39): [True: 250, False: 0]
  ------------------
  266|    250|    docTypeDecl = (ZxDocTypeDecl *)node;
  267|  3.89k|  } else if (node->isElement() && !root) {
  ------------------
  |  Branch (267:14): [True: 2.49k, False: 1.39k]
  |  Branch (267:35): [True: 2.49k, False: 0]
  ------------------
  268|  2.49k|    root = (ZxElement *)node;
  269|  2.49k|  }
  270|  4.91k|  ZxNode::addChild(node);
  271|  4.91k|}
_ZN5ZxDoc5parseEPKcj:
  273|  3.81k|bool ZxDoc::parse(const char *data, Guint dataLen) {
  274|  3.81k|  parsePtr = data;
  275|  3.81k|  parseEnd = data + dataLen;
  276|       |  
  277|  3.81k|  parseSpace();
  278|  3.81k|  parseBOM();
  279|  3.81k|  parseSpace();
  280|  3.81k|  parseXMLDecl(this);
  281|  3.81k|  parseMisc(this);
  282|  3.81k|  parseDocTypeDecl(this);
  283|  3.81k|  parseMisc(this);
  284|  3.81k|  if (match("<")) {
  ------------------
  |  Branch (284:7): [True: 2.49k, False: 1.31k]
  ------------------
  285|  2.49k|    parseElement(this);
  286|  2.49k|  }
  287|  3.81k|  parseMisc(this);
  288|       |  return root != NULL;
  289|  3.81k|}
_ZN5ZxDoc12parseXMLDeclEP6ZxNode:
  291|  3.81k|void ZxDoc::parseXMLDecl(ZxNode *par) {
  292|  3.81k|  GString *version, *encoding, *s;
  293|  3.81k|  bool standalone;
  294|       |
  295|  3.81k|  if (!match("<?xml")) {
  ------------------
  |  Branch (295:7): [True: 3.03k, False: 777]
  ------------------
  296|  3.03k|    return;
  297|  3.03k|  }
  298|    777|  parsePtr += 5;
  299|    777|  parseSpace();
  300|       |
  301|       |  // version
  302|    777|  version = NULL;
  303|    777|  if (match("version")) {
  ------------------
  |  Branch (303:7): [True: 191, False: 586]
  ------------------
  304|    191|    parsePtr += 7;
  305|    191|    parseSpace();
  306|    191|    if (match("=")) {
  ------------------
  |  Branch (306:9): [True: 126, False: 65]
  ------------------
  307|    126|      ++parsePtr;
  308|    126|      parseSpace();
  309|    126|      version = parseQuotedString();
  310|    126|    }
  311|    191|  }
  312|    777|  if (!version) {
  ------------------
  |  Branch (312:7): [True: 651, False: 126]
  ------------------
  313|    651|    version = new GString("1.0");
  314|    651|  }
  315|    777|  parseSpace();
  316|       |	
  317|       |  // encoding
  318|    777|  encoding = NULL;
  319|    777|  if (match("encoding")) {
  ------------------
  |  Branch (319:7): [True: 174, False: 603]
  ------------------
  320|    174|    parsePtr += 8;
  321|    174|    parseSpace();
  322|    174|    if (match("=")) {
  ------------------
  |  Branch (322:9): [True: 112, False: 62]
  ------------------
  323|    112|      ++parsePtr;
  324|    112|      parseSpace();
  325|    112|      encoding = parseQuotedString();
  326|    112|    }
  327|    174|  }
  328|    777|  parseSpace();
  329|       |
  330|       |  // standalone
  331|    777|  standalone = false;
  332|    777|  if (match("standalone")) {
  ------------------
  |  Branch (332:7): [True: 189, False: 588]
  ------------------
  333|    189|    parsePtr += 10;
  334|    189|    parseSpace();
  335|    189|    if (match("=")) {
  ------------------
  |  Branch (335:9): [True: 127, False: 62]
  ------------------
  336|    127|      ++parsePtr;
  337|    127|      parseSpace();
  338|    127|      s = parseQuotedString();
  339|    127|      standalone = !s->cmp("yes");
  340|    127|      delete s;
  341|    127|    }
  342|    189|  }
  343|    777|  parseSpace();
  344|       |
  345|    777|  if (match("?>")) {
  ------------------
  |  Branch (345:7): [True: 3, False: 774]
  ------------------
  346|      3|    parsePtr += 2;
  347|      3|  }
  348|       |
  349|    777|  par->addChild(new ZxXMLDecl(version, encoding, standalone));
  350|    777|}
_ZN5ZxDoc16parseDocTypeDeclEP6ZxNode:
  353|  3.81k|void ZxDoc::parseDocTypeDecl(ZxNode *par) {
  354|  3.81k|  GString *name;
  355|  3.81k|  int state;
  356|  3.81k|  char c, quote;
  357|       |
  358|  3.81k|  if (!match("<!DOCTYPE")) {
  ------------------
  |  Branch (358:7): [True: 3.56k, False: 250]
  ------------------
  359|  3.56k|    return;
  360|  3.56k|  }
  361|    250|  parsePtr += 9;
  362|    250|  parseSpace();
  363|       |
  364|    250|  name = parseName();
  365|    250|  parseSpace();
  366|       |
  367|    250|  state = 0;
  368|    250|  quote = '\0';
  369|   370k|  while (parsePtr < parseEnd && state < 4) {
  ------------------
  |  Branch (369:10): [True: 370k, False: 240]
  |  Branch (369:33): [True: 370k, False: 10]
  ------------------
  370|   370k|    c = *parsePtr++;
  371|   370k|    switch (state) {
  ------------------
  |  Branch (371:13): [True: 370k, False: 0]
  ------------------
  372|  25.1k|    case 0: // not in square brackets; not in quotes
  ------------------
  |  Branch (372:5): [True: 25.1k, False: 345k]
  ------------------
  373|  25.1k|      if (c == '>') {
  ------------------
  |  Branch (373:11): [True: 11, False: 25.1k]
  ------------------
  374|     11|	state = 4;
  375|  25.1k|      } else if (c == '"' || c == '\'') {
  ------------------
  |  Branch (375:18): [True: 406, False: 24.7k]
  |  Branch (375:30): [True: 374, False: 24.3k]
  ------------------
  376|    780|	state = 1;
  377|  24.3k|      } else if (c == '[') {
  ------------------
  |  Branch (377:18): [True: 512, False: 23.8k]
  ------------------
  378|    512|	state = 2;
  379|    512|      }
  380|  25.1k|      break;
  381|  5.30k|    case 1: // not in square brackets; in quotes
  ------------------
  |  Branch (381:5): [True: 5.30k, False: 365k]
  ------------------
  382|  5.30k|      if (c == quote) {
  ------------------
  |  Branch (382:11): [True: 746, False: 4.56k]
  ------------------
  383|    746|	state = 0;
  384|    746|      }
  385|  5.30k|      break;
  386|   337k|    case 2: // in square brackets; not in quotes
  ------------------
  |  Branch (386:5): [True: 337k, False: 32.8k]
  ------------------
  387|   337k|      if (c == ']') {
  ------------------
  |  Branch (387:11): [True: 438, False: 337k]
  ------------------
  388|    438|	state = 0;
  389|   337k|      } else if (c == '"' || c == '\'') {
  ------------------
  |  Branch (389:18): [True: 358, False: 336k]
  |  Branch (389:30): [True: 284, False: 336k]
  ------------------
  390|    642|	state = 3;
  391|    642|      }
  392|   337k|      break;
  393|  2.41k|    case 3: // in square brackets; in quotes
  ------------------
  |  Branch (393:5): [True: 2.41k, False: 367k]
  ------------------
  394|  2.41k|      if (c == quote) {
  ------------------
  |  Branch (394:11): [True: 610, False: 1.80k]
  ------------------
  395|    610|	state = 2;
  396|    610|      }
  397|  2.41k|      break;
  398|   370k|    }
  399|   370k|  }
  400|       |
  401|    250|  par->addChild(new ZxDocTypeDecl(name));
  402|    250|}
_ZN5ZxDoc12parseElementEP6ZxNode:
  405|  1.32M|void ZxDoc::parseElement(ZxNode *par) {
  406|  1.32M|  GString *type;
  407|  1.32M|  ZxElement *elem;
  408|  1.32M|  ZxAttr *attr;
  409|       |
  410|  1.32M|  ++parsePtr;
  411|  1.32M|  type = parseName();
  412|  1.32M|  elem = new ZxElement(type);
  413|  1.32M|  parseSpace();
  414|  2.25M|  while ((attr = parseAttr())) {
  ------------------
  |  Branch (414:10): [True: 931k, False: 1.32M]
  ------------------
  415|   931k|    elem->addAttr(attr);
  416|   931k|    parseSpace();
  417|   931k|  }
  418|  1.32M|  if (match("/>")) {
  ------------------
  |  Branch (418:7): [True: 49.4k, False: 1.27M]
  ------------------
  419|  49.4k|    parsePtr += 2;
  420|  1.27M|  } else if (match(">")) {
  ------------------
  |  Branch (420:14): [True: 1.19M, False: 79.8k]
  ------------------
  421|  1.19M|    ++parsePtr;
  422|  1.19M|    parseContent(elem);
  423|  1.19M|  }
  424|  1.32M|  par->addChild(elem);
  425|  1.32M|}
_ZN5ZxDoc9parseAttrEv:
  427|  2.25M|ZxAttr *ZxDoc::parseAttr() {
  428|  2.25M|  GString *name, *value;
  429|  2.25M|  const char *start;
  430|  2.25M|  char quote, c;
  431|  2.25M|  unsigned int x;
  432|  2.25M|  int n;
  433|       |
  434|  2.25M|  name = parseName();
  435|  2.25M|  parseSpace();
  436|  2.25M|  if (!match("=")) {
  ------------------
  |  Branch (436:7): [True: 1.32M, False: 938k]
  ------------------
  437|  1.32M|    delete name;
  438|  1.32M|    return NULL;
  439|  1.32M|  }
  440|   938k|  ++parsePtr;
  441|   938k|  parseSpace();
  442|   938k|  if (!(parsePtr < parseEnd && (*parsePtr == '"' || *parsePtr == '\''))) {
  ------------------
  |  Branch (442:9): [True: 938k, False: 33]
  |  Branch (442:33): [True: 889k, False: 48.8k]
  |  Branch (442:53): [True: 41.8k, False: 7.00k]
  ------------------
  443|  7.04k|    delete name;
  444|  7.04k|    return NULL;
  445|  7.04k|  }
  446|   931k|  quote = *parsePtr++;
  447|   931k|  value = new GString();
  448|  1.19M|  while (parsePtr < parseEnd && *parsePtr != quote) {
  ------------------
  |  Branch (448:10): [True: 1.19M, False: 618]
  |  Branch (448:33): [True: 267k, False: 930k]
  ------------------
  449|   267k|    if (*parsePtr == '&') {
  ------------------
  |  Branch (449:9): [True: 134k, False: 132k]
  ------------------
  450|   134k|      ++parsePtr;
  451|   134k|      if (parsePtr < parseEnd && *parsePtr == '#') {
  ------------------
  |  Branch (451:11): [True: 134k, False: 30]
  |  Branch (451:34): [True: 26.2k, False: 108k]
  ------------------
  452|  26.2k|	++parsePtr;
  453|  26.2k|	if (parsePtr < parseEnd && *parsePtr == 'x') {
  ------------------
  |  Branch (453:6): [True: 26.2k, False: 5]
  |  Branch (453:29): [True: 10.2k, False: 15.9k]
  ------------------
  454|  10.2k|	  ++parsePtr;
  455|  10.2k|	  x = 0;
  456|  55.0k|	  while (parsePtr < parseEnd) {
  ------------------
  |  Branch (456:11): [True: 54.9k, False: 37]
  ------------------
  457|  54.9k|	    c = *parsePtr;
  458|  54.9k|	    if (c >= '0' && c <= '9') {
  ------------------
  |  Branch (458:10): [True: 49.8k, False: 5.13k]
  |  Branch (458:22): [True: 6.83k, False: 42.9k]
  ------------------
  459|  6.83k|	      x = (x << 4) + (c - '0');
  460|  48.1k|	    } else if (c >= 'a' && c <= 'f') {
  ------------------
  |  Branch (460:17): [True: 21.6k, False: 26.4k]
  |  Branch (460:29): [True: 21.1k, False: 531]
  ------------------
  461|  21.1k|	      x = (x << 4) + (10 + c - 'a');
  462|  27.0k|	    } else if (c >= 'A' && c <= 'F') {
  ------------------
  |  Branch (462:17): [True: 18.2k, False: 8.74k]
  |  Branch (462:29): [True: 16.7k, False: 1.48k]
  ------------------
  463|  16.7k|	      x = (x << 4) + (10 + c - 'A');
  464|  16.7k|	    } else {
  465|  10.2k|	      break;
  466|  10.2k|	    }
  467|  44.7k|	    ++parsePtr;
  468|  44.7k|	  }
  469|  10.2k|	  if (parsePtr < parseEnd && *parsePtr == ';') {
  ------------------
  |  Branch (469:8): [True: 10.2k, False: 37]
  |  Branch (469:31): [True: 2.51k, False: 7.70k]
  ------------------
  470|  2.51k|	    ++parsePtr;
  471|  2.51k|	  }
  472|  10.2k|	  appendUTF8(value, x);
  473|  15.9k|	} else {
  474|  15.9k|	  x = 0;
  475|  67.3k|	  while (parsePtr < parseEnd) {
  ------------------
  |  Branch (475:11): [True: 67.3k, False: 15]
  ------------------
  476|  67.3k|	    c = *parsePtr;
  477|  67.3k|	    if (c >= '0' && c <= '9') {
  ------------------
  |  Branch (477:10): [True: 55.8k, False: 11.4k]
  |  Branch (477:22): [True: 51.3k, False: 4.48k]
  ------------------
  478|  51.3k|	      x = x * 10 + (c - '0');
  479|  51.3k|	    } else {
  480|  15.9k|	      break;
  481|  15.9k|	    }
  482|  51.3k|	    ++parsePtr;
  483|  51.3k|	  }
  484|  15.9k|	  if (parsePtr < parseEnd && *parsePtr == ';') {
  ------------------
  |  Branch (484:8): [True: 15.9k, False: 15]
  |  Branch (484:31): [True: 950, False: 14.9k]
  ------------------
  485|    950|	    ++parsePtr;
  486|    950|	  }
  487|  15.9k|	  appendUTF8(value, x);
  488|  15.9k|	}
  489|   108k|      } else {
  490|   108k|	start = parsePtr;
  491|   108k|	for (++parsePtr;
  492|  19.1M|	     parsePtr < parseEnd && *parsePtr != ';' &&
  ------------------
  |  Branch (492:7): [True: 19.1M, False: 303]
  |  Branch (492:30): [True: 19.1M, False: 2.51k]
  ------------------
  493|  19.1M|	       *parsePtr != quote && *parsePtr != '&';
  ------------------
  |  Branch (493:9): [True: 19.1M, False: 3.81k]
  |  Branch (493:31): [True: 19.0M, False: 101k]
  ------------------
  494|  19.0M|	     ++parsePtr) ;
  495|   108k|	n = (int)(parsePtr - start);
  496|   108k|	if (parsePtr < parseEnd && *parsePtr == ';') {
  ------------------
  |  Branch (496:6): [True: 108k, False: 303]
  |  Branch (496:29): [True: 2.51k, False: 105k]
  ------------------
  497|  2.51k|	  ++parsePtr;
  498|  2.51k|	}
  499|   108k|	if (n == 2 && !strncmp(start, "lt", 2)) {
  ------------------
  |  Branch (499:6): [True: 25.7k, False: 82.6k]
  |  Branch (499:16): [True: 1.17k, False: 24.6k]
  ------------------
  500|  1.17k|	  value->append('<');
  501|   107k|	} else if (n == 2 && !strncmp(start, "gt", 2)) {
  ------------------
  |  Branch (501:13): [True: 24.6k, False: 82.6k]
  |  Branch (501:23): [True: 18.4k, False: 6.11k]
  ------------------
  502|  18.4k|	  value->append('>');
  503|  88.7k|	} else if (n == 3 && !strncmp(start, "amp", 3)) {
  ------------------
  |  Branch (503:13): [True: 20.2k, False: 68.5k]
  |  Branch (503:23): [True: 15.0k, False: 5.18k]
  ------------------
  504|  15.0k|	  value->append('&');
  505|  73.7k|	} else if (n == 4 && !strncmp(start, "apos", 4)) {
  ------------------
  |  Branch (505:13): [True: 12.5k, False: 61.2k]
  |  Branch (505:23): [True: 993, False: 11.5k]
  ------------------
  506|    993|	  value->append('\'');
  507|  72.7k|	} else if (n == 4 && !strncmp(start, "quot", 4)) {
  ------------------
  |  Branch (507:13): [True: 11.5k, False: 61.2k]
  |  Branch (507:23): [True: 3.24k, False: 8.31k]
  ------------------
  508|  3.24k|	  value->append('"');
  509|  69.5k|	} else {
  510|  69.5k|	  value->append(start - 1, (int)(parsePtr - start) + 1);
  511|  69.5k|	}
  512|   108k|      }
  513|   134k|    } else {
  514|   132k|      start = parsePtr;
  515|   132k|      for (++parsePtr;
  516|  6.14M|	   parsePtr < parseEnd && *parsePtr != quote && *parsePtr != '&';
  ------------------
  |  Branch (516:5): [True: 6.14M, False: 136]
  |  Branch (516:28): [True: 6.02M, False: 119k]
  |  Branch (516:50): [True: 6.01M, False: 13.5k]
  ------------------
  517|  6.01M|	   ++parsePtr) ;
  518|   132k|      value->append(start, (int)(parsePtr - start));
  519|   132k|    }
  520|   267k|  }
  521|   931k|  if (parsePtr < parseEnd && *parsePtr == quote) {
  ------------------
  |  Branch (521:7): [True: 930k, False: 618]
  |  Branch (521:30): [True: 930k, False: 0]
  ------------------
  522|   930k|    ++parsePtr;
  523|   930k|  }
  524|   931k|  return new ZxAttr(name, value);
  525|   938k|}
_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.67M|  while (parsePtr < parseEnd) {
  ------------------
  |  Branch (533:10): [True: 1.48M, False: 1.18M]
  ------------------
  534|  1.48M|    if (match(endType->getCString())) {
  ------------------
  |  Branch (534:9): [True: 12.3k, False: 1.47M]
  ------------------
  535|  12.3k|      parsePtr += endType->getLength();
  536|  12.3k|      parseSpace();
  537|  12.3k|      if (match(">")) {
  ------------------
  |  Branch (537:11): [True: 3.66k, False: 8.66k]
  ------------------
  538|  3.66k|	++parsePtr;
  539|  3.66k|      }
  540|  12.3k|      break;
  541|  1.47M|    } else if (match("<?")) {
  ------------------
  |  Branch (541:16): [True: 12.7k, False: 1.46M]
  ------------------
  542|  12.7k|      parsePI(par);
  543|  1.46M|    } else if (match("<![CDATA[")) {
  ------------------
  |  Branch (543:16): [True: 3.61k, False: 1.45M]
  ------------------
  544|  3.61k|      parseCDSect(par);
  545|  1.45M|    } else if (match("<!--")) {
  ------------------
  |  Branch (545:16): [True: 600, False: 1.45M]
  ------------------
  546|    600|      parseComment(par);
  547|  1.45M|    } else if (match("<")) {
  ------------------
  |  Branch (547:16): [True: 1.32M, False: 131k]
  ------------------
  548|  1.32M|      parseElement(par);
  549|  1.32M|    } else {
  550|   131k|      parseCharData(par);
  551|   131k|    }
  552|  1.48M|  }
  553|       |
  554|  1.19M|  delete endType;
  555|  1.19M|}
_ZN5ZxDoc13parseCharDataEP9ZxElement:
  557|   131k|void ZxDoc::parseCharData(ZxElement *par) {
  558|   131k|  GString *data;
  559|   131k|  const char *start;
  560|   131k|  char c;
  561|   131k|  unsigned int x;
  562|   131k|  int n;
  563|       |
  564|   131k|  data = new GString();
  565|   645k|  while (parsePtr < parseEnd && *parsePtr != '<') {
  ------------------
  |  Branch (565:10): [True: 645k, False: 980]
  |  Branch (565:33): [True: 514k, False: 130k]
  ------------------
  566|   514k|    if (*parsePtr == '&') {
  ------------------
  |  Branch (566:9): [True: 388k, False: 125k]
  ------------------
  567|   388k|      ++parsePtr;
  568|   388k|      if (parsePtr < parseEnd && *parsePtr == '#') {
  ------------------
  |  Branch (568:11): [True: 388k, False: 51]
  |  Branch (568:34): [True: 69.7k, False: 318k]
  ------------------
  569|  69.7k|	++parsePtr;
  570|  69.7k|	if (parsePtr < parseEnd && *parsePtr == 'x') {
  ------------------
  |  Branch (570:6): [True: 69.7k, False: 8]
  |  Branch (570:29): [True: 20.3k, False: 49.4k]
  ------------------
  571|  20.3k|	  ++parsePtr;
  572|  20.3k|	  x = 0;
  573|   111k|	  while (parsePtr < parseEnd) {
  ------------------
  |  Branch (573:11): [True: 111k, False: 183]
  ------------------
  574|   111k|	    c = *parsePtr;
  575|   111k|	    if (c >= '0' && c <= '9') {
  ------------------
  |  Branch (575:10): [True: 100k, False: 10.4k]
  |  Branch (575:22): [True: 45.4k, False: 55.5k]
  ------------------
  576|  45.4k|	      x = (x << 4) + (c - '0');
  577|  65.9k|	    } else if (c >= 'a' && c <= 'f') {
  ------------------
  |  Branch (577:17): [True: 24.5k, False: 41.4k]
  |  Branch (577:29): [True: 23.3k, False: 1.21k]
  ------------------
  578|  23.3k|	      x = (x << 4) + (10 + c - 'a');
  579|  42.6k|	    } else if (c >= 'A' && c <= 'F') {
  ------------------
  |  Branch (579:17): [True: 24.3k, False: 18.2k]
  |  Branch (579:29): [True: 22.5k, False: 1.85k]
  ------------------
  580|  22.5k|	      x = (x << 4) + (10 + c - 'A');
  581|  22.5k|	    } else {
  582|  20.1k|	      break;
  583|  20.1k|	    }
  584|  91.3k|	    ++parsePtr;
  585|  91.3k|	  }
  586|  20.3k|	  if (parsePtr < parseEnd && *parsePtr == ';') {
  ------------------
  |  Branch (586:8): [True: 20.1k, False: 183]
  |  Branch (586:31): [True: 5.55k, False: 14.5k]
  ------------------
  587|  5.55k|	    ++parsePtr;
  588|  5.55k|	  }
  589|  20.3k|	  appendUTF8(data, x);
  590|  49.4k|	} else {
  591|  49.4k|	  x = 0;
  592|   278k|	  while (parsePtr < parseEnd) {
  ------------------
  |  Branch (592:11): [True: 278k, False: 95]
  ------------------
  593|   278k|	    c = *parsePtr;
  594|   278k|	    if (c >= '0' && c <= '9') {
  ------------------
  |  Branch (594:10): [True: 246k, False: 32.1k]
  |  Branch (594:22): [True: 229k, False: 17.2k]
  ------------------
  595|   229k|	      x = x * 10 + (c - '0');
  596|   229k|	    } else {
  597|  49.3k|	      break;
  598|  49.3k|	    }
  599|   229k|	    ++parsePtr;
  600|   229k|	  }
  601|  49.4k|	  if (parsePtr < parseEnd && *parsePtr == ';') {
  ------------------
  |  Branch (601:8): [True: 49.3k, False: 95]
  |  Branch (601:31): [True: 6.08k, False: 43.2k]
  ------------------
  602|  6.08k|	    ++parsePtr;
  603|  6.08k|	  }
  604|  49.4k|	  appendUTF8(data, x);
  605|  49.4k|	}
  606|   318k|      } else {
  607|   318k|	start = parsePtr;
  608|   318k|	for (++parsePtr;
  609|  15.8M|	     parsePtr < parseEnd && *parsePtr != ';' &&
  ------------------
  |  Branch (609:7): [True: 15.8M, False: 314]
  |  Branch (609:30): [True: 15.8M, False: 4.95k]
  ------------------
  610|  15.8M|	       *parsePtr != '<' && *parsePtr != '&';
  ------------------
  |  Branch (610:9): [True: 15.8M, False: 46.6k]
  |  Branch (610:29): [True: 15.5M, False: 267k]
  ------------------
  611|  15.5M|	     ++parsePtr) ;
  612|   318k|	n = (int)(parsePtr - start);
  613|   318k|	if (parsePtr < parseEnd && *parsePtr == ';') {
  ------------------
  |  Branch (613:6): [True: 318k, False: 314]
  |  Branch (613:29): [True: 4.95k, False: 313k]
  ------------------
  614|  4.95k|	  ++parsePtr;
  615|  4.95k|	}
  616|   318k|	if (n == 2 && !strncmp(start, "lt", 2)) {
  ------------------
  |  Branch (616:6): [True: 124k, False: 194k]
  |  Branch (616:16): [True: 3.31k, False: 120k]
  ------------------
  617|  3.31k|	  data->append('<');
  618|   315k|	} else if (n == 2 && !strncmp(start, "gt", 2)) {
  ------------------
  |  Branch (618:13): [True: 120k, False: 194k]
  |  Branch (618:23): [True: 90.7k, False: 30.1k]
  ------------------
  619|  90.7k|	  data->append('>');
  620|   224k|	} else if (n == 3 && !strncmp(start, "amp", 3)) {
  ------------------
  |  Branch (620:13): [True: 53.7k, False: 171k]
  |  Branch (620:23): [True: 32.1k, False: 21.6k]
  ------------------
  621|  32.1k|	  data->append('&');
  622|   192k|	} else if (n == 4 && !strncmp(start, "apos", 4)) {
  ------------------
  |  Branch (622:13): [True: 53.5k, False: 139k]
  |  Branch (622:23): [True: 1.22k, False: 52.2k]
  ------------------
  623|  1.22k|	  data->append('\'');
  624|   191k|	} else if (n == 4 && !strncmp(start, "quot", 4)) {
  ------------------
  |  Branch (624:13): [True: 52.2k, False: 139k]
  |  Branch (624:23): [True: 17.2k, False: 35.0k]
  ------------------
  625|  17.2k|	  data->append('"');
  626|   174k|	} else {
  627|   174k|	  data->append(start - 1, (int)(parsePtr - start) + 1);
  628|   174k|	}
  629|   318k|      }
  630|   388k|    } else {
  631|   125k|      start = parsePtr;
  632|   125k|      for (++parsePtr;
  633|  14.1M|	   parsePtr < parseEnd && *parsePtr != '<' && *parsePtr != '&';
  ------------------
  |  Branch (633:5): [True: 14.1M, False: 364]
  |  Branch (633:28): [True: 14.1M, False: 80.9k]
  |  Branch (633:48): [True: 14.0M, False: 44.4k]
  ------------------
  634|  14.0M|	   ++parsePtr) ;
  635|   125k|      data->append(start, (int)(parsePtr - start));
  636|   125k|    }
  637|   514k|  }
  638|   131k|  par->addChild(new ZxCharData(data, true));
  639|   131k|}
_ZN5ZxDoc10appendUTF8EP7GStringj:
  641|  95.9k|void ZxDoc::appendUTF8(GString *s, unsigned int c) {
  642|  95.9k|  if (c <= 0x7f) {
  ------------------
  |  Branch (642:7): [True: 36.5k, False: 59.4k]
  ------------------
  643|  36.5k|    s->append((char)c);
  644|  59.4k|  } else if (c <= 0x7ff) {
  ------------------
  |  Branch (644:14): [True: 7.37k, False: 52.0k]
  ------------------
  645|  7.37k|    s->append((char)(0xc0 + (c >> 6)));
  646|  7.37k|    s->append((char)(0x80 + (c & 0x3f)));
  647|  52.0k|  } else if (c <= 0xffff) {
  ------------------
  |  Branch (647:14): [True: 13.4k, False: 38.5k]
  ------------------
  648|  13.4k|    s->append((char)(0xe0 + (c >> 12)));
  649|  13.4k|    s->append((char)(0x80 + ((c >> 6) & 0x3f)));
  650|  13.4k|    s->append((char)(0x80 + (c & 0x3f)));
  651|  38.5k|  } else if (c <= 0x1fffff) {
  ------------------
  |  Branch (651:14): [True: 11.2k, False: 27.2k]
  ------------------
  652|  11.2k|    s->append((char)(0xf0 + (c >> 18)));
  653|  11.2k|    s->append((char)(0x80 + ((c >> 12) & 0x3f)));
  654|  11.2k|    s->append((char)(0x80 + ((c >> 6) & 0x3f)));
  655|  11.2k|    s->append((char)(0x80 + (c & 0x3f)));
  656|  27.2k|  } else if (c <= 0x3ffffff) {
  ------------------
  |  Branch (656:14): [True: 3.92k, False: 23.3k]
  ------------------
  657|  3.92k|    s->append((char)(0xf8 + (c >> 24)));
  658|  3.92k|    s->append((char)(0x80 + ((c >> 18) & 0x3f)));
  659|  3.92k|    s->append((char)(0x80 + ((c >> 12) & 0x3f)));
  660|  3.92k|    s->append((char)(0x80 + ((c >> 6) & 0x3f)));
  661|  3.92k|    s->append((char)(0x80 + (c & 0x3f)));
  662|  23.3k|  } else if (c <= 0x7fffffff) {
  ------------------
  |  Branch (662:14): [True: 18.5k, False: 4.81k]
  ------------------
  663|  18.5k|    s->append((char)(0xfc + (c >> 30)));
  664|  18.5k|    s->append((char)(0x80 + ((c >> 24) & 0x3f)));
  665|  18.5k|    s->append((char)(0x80 + ((c >> 18) & 0x3f)));
  666|  18.5k|    s->append((char)(0x80 + ((c >> 12) & 0x3f)));
  667|  18.5k|    s->append((char)(0x80 + ((c >> 6) & 0x3f)));
  668|  18.5k|    s->append((char)(0x80 + (c & 0x3f)));
  669|  18.5k|  }
  670|  95.9k|}
_ZN5ZxDoc11parseCDSectEP6ZxNode:
  673|  3.61k|void ZxDoc::parseCDSect(ZxNode *par) {
  674|  3.61k|  const char *start;
  675|       |
  676|  3.61k|  parsePtr += 9;
  677|  3.61k|  start = parsePtr;
  678|   273k|  while (parsePtr < parseEnd - 3) {
  ------------------
  |  Branch (678:10): [True: 273k, False: 43]
  ------------------
  679|   273k|    if (!strncmp(parsePtr, "]]>", 3)) {
  ------------------
  |  Branch (679:9): [True: 3.57k, False: 270k]
  ------------------
  680|  3.57k|      par->addChild(new ZxCharData(new GString(start, (int)(parsePtr - start)),
  681|  3.57k|				   false));
  682|  3.57k|      parsePtr += 3;
  683|  3.57k|      return;
  684|  3.57k|    }
  685|   270k|    ++parsePtr;
  686|   270k|  }
  687|     43|  parsePtr = parseEnd;
  688|     43|  par->addChild(new ZxCharData(new GString(start, (int)(parsePtr - start)),
  689|     43|			       false));
  690|     43|}
_ZN5ZxDoc9parseMiscEP6ZxNode:
  692|  11.4k|void ZxDoc::parseMisc(ZxNode *par) {
  693|  13.6k|  while (1) {
  ------------------
  |  Branch (693:10): [True: 13.6k, Folded]
  ------------------
  694|  13.6k|    if (match("<!--")) {
  ------------------
  |  Branch (694:9): [True: 551, False: 13.0k]
  ------------------
  695|    551|      parseComment(par);
  696|  13.0k|    } else if (match("<?")) {
  ------------------
  |  Branch (696:16): [True: 885, False: 12.1k]
  ------------------
  697|    885|      parsePI(par);
  698|  12.1k|    } else if (parsePtr < parseEnd && (*parsePtr == '\x20' ||
  ------------------
  |  Branch (698:16): [True: 7.55k, False: 4.62k]
  |  Branch (698:40): [True: 241, False: 7.31k]
  ------------------
  699|  7.31k|				       *parsePtr == '\x09' ||
  ------------------
  |  Branch (699:12): [True: 243, False: 7.06k]
  ------------------
  700|  7.06k|				       *parsePtr == '\x0d' ||
  ------------------
  |  Branch (700:12): [True: 157, False: 6.91k]
  ------------------
  701|  6.91k|				       *parsePtr == '\x0a')) {
  ------------------
  |  Branch (701:12): [True: 100, False: 6.81k]
  ------------------
  702|    741|      ++parsePtr;
  703|  11.4k|    } else {
  704|  11.4k|      break;
  705|  11.4k|    }
  706|  13.6k|  }
  707|  11.4k|}
_ZN5ZxDoc12parseCommentEP6ZxNode:
  710|  1.15k|void ZxDoc::parseComment(ZxNode *par) {
  711|  1.15k|  const char *start;
  712|       |
  713|  1.15k|  parsePtr += 4;
  714|  1.15k|  start = parsePtr;
  715|   712k|  while (parsePtr <= parseEnd - 3) {
  ------------------
  |  Branch (715:10): [True: 712k, False: 55]
  ------------------
  716|   712k|    if (!strncmp(parsePtr, "-->", 3)) {
  ------------------
  |  Branch (716:9): [True: 1.09k, False: 711k]
  ------------------
  717|  1.09k|      par->addChild(new ZxComment(new GString(start, (int)(parsePtr - start))));
  718|  1.09k|      parsePtr += 3;
  719|  1.09k|      return;
  720|  1.09k|    }
  721|   711k|    ++parsePtr;
  722|   711k|  }
  723|     55|  parsePtr = parseEnd;
  724|     55|}
_ZN5ZxDoc7parsePIEP6ZxNode:
  727|  13.6k|void ZxDoc::parsePI(ZxNode *par) {
  728|  13.6k|  GString *target;
  729|  13.6k|  const char *start;
  730|       |
  731|  13.6k|  parsePtr += 2;
  732|  13.6k|  target = parseName();
  733|  13.6k|  parseSpace();
  734|  13.6k|  start = parsePtr;
  735|  6.69M|  while (parsePtr <= parseEnd - 2) {
  ------------------
  |  Branch (735:10): [True: 6.69M, False: 217]
  ------------------
  736|  6.69M|    if (!strncmp(parsePtr, "?>", 2)) {
  ------------------
  |  Branch (736:9): [True: 13.3k, False: 6.67M]
  ------------------
  737|  13.3k|      par->addChild(new ZxPI(target, new GString(start,
  738|  13.3k|						 (int)(parsePtr - start))));
  739|  13.3k|      parsePtr += 2;
  740|  13.3k|      return;
  741|  13.3k|    }
  742|  6.67M|    ++parsePtr;
  743|  6.67M|  }
  744|    217|  parsePtr = parseEnd;
  745|    217|  par->addChild(new ZxPI(target, new GString(start, (int)(parsePtr - start))));
  746|    217|}
_ZN5ZxDoc9parseNameEv:
  750|  3.60M|GString *ZxDoc::parseName() {
  751|  3.60M|  GString *name;
  752|       |
  753|  3.60M|  name = new GString();
  754|  3.60M|  if (parsePtr < parseEnd && nameStartChar[*parsePtr & 0xff]) {
  ------------------
  |  Branch (754:7): [True: 3.60M, False: 1.14k]
  |  Branch (754:30): [True: 182k, False: 3.41M]
  ------------------
  755|   182k|    name->append(*parsePtr++);
  756|  12.6M|    while (parsePtr < parseEnd && nameChar[*parsePtr & 0xff]) {
  ------------------
  |  Branch (756:12): [True: 12.6M, False: 120]
  |  Branch (756:35): [True: 12.5M, False: 182k]
  ------------------
  757|  12.5M|      name->append(*parsePtr++);
  758|  12.5M|    }
  759|   182k|  }
  760|  3.60M|  return name;
  761|  3.60M|}
_ZN5ZxDoc17parseQuotedStringEv:
  763|    365|GString *ZxDoc::parseQuotedString() {
  764|    365|  GString *s;
  765|    365|  const char *start;
  766|    365|  char quote;
  767|       |
  768|    365|  if (parsePtr < parseEnd && (*parsePtr == '"' || *parsePtr == '\'')) {
  ------------------
  |  Branch (768:7): [True: 276, False: 89]
  |  Branch (768:31): [True: 82, False: 194]
  |  Branch (768:51): [True: 87, False: 107]
  ------------------
  769|    169|    quote = *parsePtr++;
  770|    169|    start = parsePtr;
  771|  3.59k|    while (parsePtr < parseEnd && *parsePtr != quote) {
  ------------------
  |  Branch (771:12): [True: 3.55k, False: 45]
  |  Branch (771:35): [True: 3.42k, False: 124]
  ------------------
  772|  3.42k|      ++parsePtr;
  773|  3.42k|    }
  774|    169|    s = new GString(start, (int)(parsePtr - start));
  775|    169|    if (parsePtr < parseEnd && *parsePtr == quote) {
  ------------------
  |  Branch (775:9): [True: 124, False: 45]
  |  Branch (775:32): [True: 124, False: 0]
  ------------------
  776|    124|      ++parsePtr;
  777|    124|    }
  778|    196|  } else {
  779|    196|    s = new GString();
  780|    196|  }
  781|    365|  return s;
  782|    365|}
_ZN5ZxDoc8parseBOMEv:
  784|  3.81k|void ZxDoc::parseBOM() {
  785|  3.81k|  if (match("\xef\xbb\xbf")) {
  ------------------
  |  Branch (785:7): [True: 36, False: 3.77k]
  ------------------
  786|     36|    parsePtr += 3;
  787|     36|  }
  788|  3.81k|}
_ZN5ZxDoc10parseSpaceEv:
  790|  5.49M|void ZxDoc::parseSpace() {
  791|  5.83M|  while (parsePtr < parseEnd && (*parsePtr == '\x20' ||
  ------------------
  |  Branch (791:10): [True: 5.83M, False: 3.17k]
  |  Branch (791:34): [True: 177k, False: 5.65M]
  ------------------
  792|  5.65M|				 *parsePtr == '\x09' ||
  ------------------
  |  Branch (792:6): [True: 59.9k, False: 5.59M]
  ------------------
  793|  5.59M|				 *parsePtr == '\x0d' ||
  ------------------
  |  Branch (793:6): [True: 54.8k, False: 5.53M]
  ------------------
  794|  5.53M|				 *parsePtr == '\x0a')) {
  ------------------
  |  Branch (794:6): [True: 47.3k, False: 5.49M]
  ------------------
  795|   339k|    ++parsePtr;
  796|   339k|  }
  797|  5.49M|}
_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.2M, False: 21.8k]
  |  Branch (803:38): [True: 3.55M, False: 8.68M]
  ------------------
  804|  12.2M|}
_ZN9ZxXMLDeclC2EP7GStringS1_b:
  822|    777|ZxXMLDecl::ZxXMLDecl(GString *versionA, GString *encodingA, bool standaloneA) {
  823|    777|  version = versionA;
  824|    777|  encoding = encodingA;
  825|    777|  standalone = standaloneA;
  826|    777|}
_ZN9ZxXMLDeclD2Ev:
  828|    777|ZxXMLDecl::~ZxXMLDecl() {
  829|    777|  delete version;
  830|    777|  if (encoding) {
  ------------------
  |  Branch (830:7): [True: 112, False: 665]
  ------------------
  831|    112|    delete encoding;
  832|    112|  }
  833|    777|}
_ZN13ZxDocTypeDeclC2EP7GString:
  858|    250|ZxDocTypeDecl::ZxDocTypeDecl(GString *nameA) {
  859|    250|  name = nameA;
  860|    250|}
_ZN13ZxDocTypeDeclD2Ev:
  862|    250|ZxDocTypeDecl::~ZxDocTypeDecl() {
  863|    250|  delete name;
  864|    250|}
_ZN9ZxCommentC2EP7GString:
  880|  1.09k|ZxComment::ZxComment(GString *textA) {
  881|  1.09k|  text = textA;
  882|  1.09k|}
_ZN9ZxCommentD2Ev:
  884|  1.09k|ZxComment::~ZxComment() {
  885|  1.09k|  delete text;
  886|  1.09k|}
_ZN4ZxPIC2EP7GStringS1_:
  902|  13.6k|ZxPI::ZxPI(GString *targetA, GString *textA) {
  903|  13.6k|  target = targetA;
  904|  13.6k|  text = textA;
  905|  13.6k|}
_ZN4ZxPID2Ev:
  907|  13.6k|ZxPI::~ZxPI() {
  908|  13.6k|  delete target;
  909|  13.6k|  delete text;
  910|  13.6k|}
_ZN9ZxElementC2EP7GString:
  928|  1.32M|ZxElement::ZxElement(GString *typeA) {
  929|  1.32M|  type = typeA;
  930|  1.32M|  attrs = new GHash();
  931|       |  firstAttr = lastAttr = NULL;
  932|  1.32M|}
_ZN9ZxElementD2Ev:
  934|  1.32M|ZxElement::~ZxElement() {
  935|  1.32M|  delete type;
  936|  1.32M|  deleteGHash(attrs, ZxAttr);
  ------------------
  |  |   60|  1.32M|  do {                                             \
  |  |   61|  1.32M|    GHash *_hash = (hash);                         \
  |  |   62|  1.32M|    {                                              \
  |  |   63|  1.32M|      GHashIter *_iter;                            \
  |  |   64|  1.32M|      GString *_key;                               \
  |  |   65|  1.32M|      void *_p;                                    \
  |  |   66|  1.32M|      _hash->startIter(&_iter);                    \
  |  |   67|  2.25M|      while (_hash->getNext(&_iter, &_key, &_p)) { \
  |  |  ------------------
  |  |  |  Branch (67:14): [True: 931k, False: 1.32M]
  |  |  ------------------
  |  |   68|   931k|        delete (T*)_p;                             \
  |  |   69|   931k|      }                                            \
  |  |   70|  1.32M|      delete _hash;                                \
  |  |   71|  1.32M|    }                                              \
  |  |   72|  1.32M|  } while(0)
  |  |  ------------------
  |  |  |  Branch (72:11): [Folded, False: 1.32M]
  |  |  ------------------
  ------------------
  937|  1.32M|}
_ZN9ZxElement7addAttrEP6ZxAttr:
  947|   931k|void ZxElement::addAttr(ZxAttr *attr) {
  948|   931k|  attrs->add(attr->getName(), attr);
  949|   931k|  if (lastAttr) {
  ------------------
  |  Branch (949:7): [True: 868k, False: 63.1k]
  ------------------
  950|   868k|    lastAttr->next = attr;
  951|   868k|    lastAttr= attr;
  952|   868k|  } else {
  953|  63.1k|    firstAttr = lastAttr = attr;
  954|  63.1k|  }
  955|   931k|  attr->parent = this;
  956|       |  attr->next = NULL;
  957|   931k|}
_ZN6ZxAttrC2EP7GStringS1_:
 1025|   931k|ZxAttr::ZxAttr(GString *nameA, GString *valueA) {
 1026|   931k|  name = nameA;
 1027|   931k|  value = valueA;
 1028|   931k|  parent = NULL;
 1029|       |  next = NULL;
 1030|   931k|}
_ZN6ZxAttrD2Ev:
 1032|   931k|ZxAttr::~ZxAttr() {
 1033|   931k|  delete name;
 1034|   931k|  delete value;
 1035|   931k|}
_ZN10ZxCharDataC2EP7GStringb:
 1039|   135k|ZxCharData::ZxCharData(GString *dataA, bool parsedA) {
 1040|   135k|  data = dataA;
 1041|   135k|  parsed = parsedA;
 1042|   135k|}
_ZN10ZxCharDataD2Ev:
 1044|   135k|ZxCharData::~ZxCharData() {
 1045|   135k|  delete data;
 1046|   135k|}

_ZN6ZxNode9isXMLDeclEv:
   36|  4.14k|  virtual bool isXMLDecl()  { return false; }
_ZN6ZxNode13isDocTypeDeclEv:
   37|  3.89k|  virtual bool isDocTypeDecl() { return false; }
_ZN6ZxNode9isElementEv:
   40|  1.39k|  virtual bool isElement() { return false; }
_ZN9ZxXMLDecl9isXMLDeclEv:
  129|    777|  virtual bool isXMLDecl() { return true; }
_ZN13ZxDocTypeDecl13isDocTypeDeclEv:
  151|    250|  virtual bool isDocTypeDecl() { return true; }
_ZN9ZxElement9isElementEv:
  207|  2.49k|  virtual bool isElement() { return true; }
_ZN9ZxElement7getTypeEv:
  209|  1.19M|  GString *getType() { return type; }
_ZN6ZxAttr7getNameEv:
  233|   931k|  GString *getName() { return name; }

