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.47k, False: 1.33k]
  ------------------
   29|  2.47k|        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: 912k, False: 10.7M]
  ------------------
   52|   912k|      p = tab[h];
   53|   912k|      tab[h] = p->next;
   54|   912k|      if (deleteKeys) {
  ------------------
  |  Branch (54:11): [True: 0, False: 912k]
  ------------------
   55|      0|	delete p->key;
   56|      0|      }
   57|   912k|      delete p;
   58|   912k|    }
   59|  10.7M|  }
   60|  1.32M|  gfree(tab);
   61|  1.32M|}
_ZN5GHash3addEP7GStringPv:
   63|   912k|void GHash::add(GString *key, void *val) {
   64|   912k|  GHashBucket *p;
   65|   912k|  int h;
   66|       |
   67|       |  // expand the table if necessary
   68|   912k|  if (len >= size) {
  ------------------
  |  Branch (68:7): [True: 2.02k, False: 910k]
  ------------------
   69|  2.02k|    expand();
   70|  2.02k|  }
   71|       |
   72|       |  // add the new symbol
   73|   912k|  p = new GHashBucket;
   74|   912k|  p->key = key;
   75|   912k|  p->val.p = val;
   76|   912k|  h = hash(key);
   77|   912k|  p->next = tab[h];
   78|   912k|  tab[h] = p;
   79|   912k|  ++len;
   80|   912k|}
_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.24M|GBool GHash::getNext(GHashIter **iter, GString **key, void **val) {
  268|  2.24M|  if (!*iter) {
  ------------------
  |  Branch (268:7): [True: 0, False: 2.24M]
  ------------------
  269|      0|    return gFalse;
  ------------------
  |  |   18|      0|#define gFalse 0
  ------------------
  270|      0|  }
  271|  2.24M|  if ((*iter)->p) {
  ------------------
  |  Branch (271:7): [True: 912k, False: 1.32M]
  ------------------
  272|   912k|    (*iter)->p = (*iter)->p->next;
  273|   912k|  }
  274|  12.9M|  while (!(*iter)->p) {
  ------------------
  |  Branch (274:10): [True: 12.0M, False: 912k]
  ------------------
  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|   912k|  *key = (*iter)->p->key;
  283|   912k|  *val = (*iter)->p->val.p;
  284|   912k|  return gTrue;
  ------------------
  |  |   17|   912k|#define gTrue 1
  ------------------
  285|  2.24M|}
_ZN5GHash6expandEv:
  312|  2.02k|void GHash::expand() {
  313|  2.02k|  GHashBucket **oldTab;
  314|  2.02k|  GHashBucket *p;
  315|  2.02k|  int oldSize, h, i;
  316|       |
  317|  2.02k|  oldSize = size;
  318|  2.02k|  oldTab = tab;
  319|  2.02k|  size = 2*size + 1;
  320|  2.02k|  tab = (GHashBucket **)gmallocn(size, sizeof(GHashBucket *));
  321|  2.91M|  for (h = 0; h < size; ++h) {
  ------------------
  |  Branch (321:15): [True: 2.91M, False: 2.02k]
  ------------------
  322|  2.91M|    tab[h] = NULL;
  323|  2.91M|  }
  324|  1.45M|  for (i = 0; i < oldSize; ++i) {
  ------------------
  |  Branch (324:15): [True: 1.45M, False: 2.02k]
  ------------------
  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.02k|  gfree(oldTab);
  334|  2.02k|}
_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.79M|  for (p = key->getCString(), i = 0; i < key->getLength(); ++p, ++i) {
  ------------------
  |  Branch (366:38): [True: 428k, False: 2.36M]
  ------------------
  367|   428k|    h = 17 * h + (int)(*p & 0xff);
  368|   428k|  }
  369|  2.36M|  return (int)(h % size);
  370|  2.36M|}

_ZN7GStringC2Ev:
  129|  4.63M|GString::GString() {
  130|       |  s = NULL;
  131|  4.63M|  resize(length = 0);
  132|  4.63M|  s[0] = '\0';
  133|  4.63M|}
_ZN7GStringC2EPKc:
  135|  1.20M|GString::GString(const char *sA) {
  136|  1.20M|  int n = (int)strlen(sA);
  137|       |
  138|       |  s = NULL;
  139|  1.20M|  resize(length = n);
  140|  1.20M|  memcpy(s, sA, n + 1);
  141|  1.20M|}
_ZN7GStringC2EPKci:
  143|  20.4k|GString::GString(const char *sA, int lengthA) {
  144|       |  s = NULL;
  145|  20.4k|  resize(length = lengthA);
  146|  20.4k|  memcpy(s, sA, length * sizeof(char));
  147|  20.4k|  s[length] = '\0';
  148|  20.4k|}
_ZN7GStringD2Ev:
  204|  5.86M|GString::~GString() {
  205|  5.86M|  delete[] s;
  206|  5.86M|}
_ZN7GString6appendEc:
  214|  13.7M|GString *GString::append(char c) {
  215|  13.7M|  if (length > INT_MAX - 1) {
  ------------------
  |  Branch (215:7): [True: 0, False: 13.7M]
  ------------------
  216|      0|    gMemError("Integer overflow in GString::append()");
  217|      0|  }
  218|  13.7M|  resize(length + 1);
  219|  13.7M|  s[length++] = c;
  220|  13.7M|  s[length] = '\0';
  221|  13.7M|  return this;
  222|  13.7M|}
_ZN7GString6appendEPS_:
  224|  1.20M|GString *GString::append(GString *str) {
  225|  1.20M|  int n = str->getLength();
  226|       |
  227|  1.20M|  if (length > INT_MAX - n) {
  ------------------
  |  Branch (227:7): [True: 0, False: 1.20M]
  ------------------
  228|      0|    gMemError("Integer overflow in GString::append()");
  229|      0|  }
  230|  1.20M|  resize(length + n);
  231|  1.20M|  memcpy(s + length, str->getCString(), n + 1);
  232|  1.20M|  length += n;
  233|  1.20M|  return this;
  234|  1.20M|}
_ZN7GString6appendEPKci:
  248|   506k|GString *GString::append(const char *str, int lengthA) {
  249|   506k|  if (lengthA < 0 || length > INT_MAX - lengthA) {
  ------------------
  |  Branch (249:7): [True: 0, False: 506k]
  |  Branch (249:22): [True: 0, False: 506k]
  ------------------
  250|      0|    gMemError("Integer overflow in GString::append()");
  251|      0|  }
  252|   506k|  resize(length + lengthA);
  253|   506k|  memcpy(s + length, str, lengthA);
  254|   506k|  length += lengthA;
  255|   506k|  s[length] = '\0';
  256|   506k|  return this;
  257|   506k|}
_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|  21.3M|inline void GString::resize(int length1) {
  109|  21.3M|  char *s1;
  110|       |
  111|  21.3M|  if (length1 < 0) {
  ------------------
  |  Branch (111:7): [True: 0, False: 21.3M]
  ------------------
  112|      0|    gMemError("GString::resize() with negative length");
  113|      0|  }
  114|  21.3M|  if (!s) {
  ------------------
  |  Branch (114:7): [True: 5.86M, False: 15.4M]
  ------------------
  115|  5.86M|    s = new char[size(length1)];
  116|  15.4M|  } else if (size(length1) != size(length)) {
  ------------------
  |  Branch (116:14): [True: 150k, False: 15.2M]
  ------------------
  117|   150k|    s1 = new char[size(length1)];
  118|   150k|    if (length1 < length) {
  ------------------
  |  Branch (118:9): [True: 0, False: 150k]
  ------------------
  119|      0|      memcpy(s1, s, length1);
  120|      0|      s1[length1] = '\0';
  121|   150k|    } else {
  122|   150k|      memcpy(s1, s, length + 1);
  123|   150k|    }
  124|   150k|    delete[] s;
  125|   150k|    s = s1;
  126|   150k|  }
  127|  21.3M|}
GString.cc:_ZL4sizei:
   98|  36.9M|static inline int size(int len) {
   99|  36.9M|  int delta;
  100|   424M|  for (delta = 8; delta < len && delta < 0x100000; delta <<= 1) ;
  ------------------
  |  Branch (100:19): [True: 387M, False: 36.9M]
  |  Branch (100:34): [True: 387M, False: 0]
  ------------------
  101|  36.9M|  if (len > INT_MAX - delta) {
  ------------------
  |  Branch (101:7): [True: 0, False: 36.9M]
  ------------------
  102|      0|    gMemError("Integer overflow in GString::size()");
  103|      0|  }
  104|       |  // this is ((len + 1) + (delta - 1)) & ~(delta - 1)
  105|  36.9M|  return (len + delta) & ~(delta - 1);
  106|  36.9M|}

_ZN7GString10getCStringEv:
   79|  5.06M|  char *getCString() { return s; }
_ZN7GString9getLengthEv:
   76|  4.01M|  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.49M|ZxNode::ZxNode() {
   65|  1.49M|  next = NULL;
   66|  1.49M|  parent = NULL;
   67|       |  firstChild = lastChild = NULL;
   68|  1.49M|}
_ZN6ZxNodeD2Ev:
   70|  1.49M|ZxNode::~ZxNode() {
   71|  1.49M|  ZxNode *child;
   72|       |
   73|  2.98M|  while (firstChild) {
  ------------------
  |  Branch (73:10): [True: 1.48M, False: 1.49M]
  ------------------
   74|  1.48M|    child = firstChild;
   75|  1.48M|    firstChild = firstChild->next;
   76|  1.48M|    delete child;
   77|  1.48M|  }
   78|  1.49M|}
_ZN6ZxNode8addChildEPS_:
  186|  1.48M|void ZxNode::addChild(ZxNode *child) {
  187|  1.48M|  if (lastChild) {
  ------------------
  |  Branch (187:7): [True: 281k, False: 1.20M]
  ------------------
  188|   281k|    lastChild->next = child;
  189|   281k|    lastChild = child;
  190|  1.20M|  } else {
  191|  1.20M|    firstChild = lastChild = child;
  192|  1.20M|  }
  193|  1.48M|  child->parent = this;
  194|       |  child->next = NULL;
  195|  1.48M|}
_ZN5ZxDocC2Ev:
  199|  7.63k|ZxDoc::ZxDoc() {
  200|  7.63k|  xmlDecl = NULL;
  201|  7.63k|  docTypeDecl = NULL;
  202|       |  root = NULL;
  203|  7.63k|}
_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.33k, False: 2.47k]
  ------------------
  210|  1.33k|    delete doc;
  211|  1.33k|    return NULL;
  212|  1.33k|  }
  213|  2.47k|  return doc;
  214|  3.81k|}
_ZN5ZxDoc8addChildEP6ZxNode:
  262|  4.92k|void ZxDoc::addChild(ZxNode *node) {
  263|  4.92k|  if (node->isXMLDecl() && !xmlDecl) {
  ------------------
  |  Branch (263:7): [True: 803, False: 4.12k]
  |  Branch (263:28): [True: 803, False: 0]
  ------------------
  264|    803|    xmlDecl = (ZxXMLDecl *)node;
  265|  4.12k|  } else if (node->isDocTypeDecl() && !docTypeDecl) {
  ------------------
  |  Branch (265:14): [True: 253, False: 3.87k]
  |  Branch (265:39): [True: 253, False: 0]
  ------------------
  266|    253|    docTypeDecl = (ZxDocTypeDecl *)node;
  267|  3.87k|  } else if (node->isElement() && !root) {
  ------------------
  |  Branch (267:14): [True: 2.47k, False: 1.39k]
  |  Branch (267:35): [True: 2.47k, False: 0]
  ------------------
  268|  2.47k|    root = (ZxElement *)node;
  269|  2.47k|  }
  270|  4.92k|  ZxNode::addChild(node);
  271|  4.92k|}
_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.47k, False: 1.33k]
  ------------------
  285|  2.47k|    parseElement(this);
  286|  2.47k|  }
  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.01k, False: 803]
  ------------------
  296|  3.01k|    return;
  297|  3.01k|  }
  298|    803|  parsePtr += 5;
  299|    803|  parseSpace();
  300|       |
  301|       |  // version
  302|    803|  version = NULL;
  303|    803|  if (match("version")) {
  ------------------
  |  Branch (303:7): [True: 199, False: 604]
  ------------------
  304|    199|    parsePtr += 7;
  305|    199|    parseSpace();
  306|    199|    if (match("=")) {
  ------------------
  |  Branch (306:9): [True: 126, False: 73]
  ------------------
  307|    126|      ++parsePtr;
  308|    126|      parseSpace();
  309|    126|      version = parseQuotedString();
  310|    126|    }
  311|    199|  }
  312|    803|  if (!version) {
  ------------------
  |  Branch (312:7): [True: 677, False: 126]
  ------------------
  313|    677|    version = new GString("1.0");
  314|    677|  }
  315|    803|  parseSpace();
  316|       |	
  317|       |  // encoding
  318|    803|  encoding = NULL;
  319|    803|  if (match("encoding")) {
  ------------------
  |  Branch (319:7): [True: 182, False: 621]
  ------------------
  320|    182|    parsePtr += 8;
  321|    182|    parseSpace();
  322|    182|    if (match("=")) {
  ------------------
  |  Branch (322:9): [True: 118, False: 64]
  ------------------
  323|    118|      ++parsePtr;
  324|    118|      parseSpace();
  325|    118|      encoding = parseQuotedString();
  326|    118|    }
  327|    182|  }
  328|    803|  parseSpace();
  329|       |
  330|       |  // standalone
  331|    803|  standalone = false;
  332|    803|  if (match("standalone")) {
  ------------------
  |  Branch (332:7): [True: 195, False: 608]
  ------------------
  333|    195|    parsePtr += 10;
  334|    195|    parseSpace();
  335|    195|    if (match("=")) {
  ------------------
  |  Branch (335:9): [True: 127, False: 68]
  ------------------
  336|    127|      ++parsePtr;
  337|    127|      parseSpace();
  338|    127|      s = parseQuotedString();
  339|    127|      standalone = !s->cmp("yes");
  340|    127|      delete s;
  341|    127|    }
  342|    195|  }
  343|    803|  parseSpace();
  344|       |
  345|    803|  if (match("?>")) {
  ------------------
  |  Branch (345:7): [True: 3, False: 800]
  ------------------
  346|      3|    parsePtr += 2;
  347|      3|  }
  348|       |
  349|    803|  par->addChild(new ZxXMLDecl(version, encoding, standalone));
  350|    803|}
_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: 253]
  ------------------
  359|  3.56k|    return;
  360|  3.56k|  }
  361|    253|  parsePtr += 9;
  362|    253|  parseSpace();
  363|       |
  364|    253|  name = parseName();
  365|    253|  parseSpace();
  366|       |
  367|    253|  state = 0;
  368|    253|  quote = '\0';
  369|  12.7k|  while (parsePtr < parseEnd && state < 4) {
  ------------------
  |  Branch (369:10): [True: 12.5k, False: 244]
  |  Branch (369:33): [True: 12.5k, False: 9]
  ------------------
  370|  12.5k|    c = *parsePtr++;
  371|  12.5k|    switch (state) {
  ------------------
  |  Branch (371:13): [True: 12.5k, False: 0]
  ------------------
  372|  4.54k|    case 0: // not in square brackets; not in quotes
  ------------------
  |  Branch (372:5): [True: 4.54k, False: 7.96k]
  ------------------
  373|  4.54k|      if (c == '>') {
  ------------------
  |  Branch (373:11): [True: 10, False: 4.53k]
  ------------------
  374|     10|	state = 4;
  375|  4.53k|      } else if (c == '"' || c == '\'') {
  ------------------
  |  Branch (375:18): [True: 272, False: 4.26k]
  |  Branch (375:30): [True: 354, False: 3.90k]
  ------------------
  376|    626|	state = 1;
  377|  3.90k|      } else if (c == '[') {
  ------------------
  |  Branch (377:18): [True: 428, False: 3.48k]
  ------------------
  378|    428|	state = 2;
  379|    428|      }
  380|  4.54k|      break;
  381|  1.04k|    case 1: // not in square brackets; in quotes
  ------------------
  |  Branch (381:5): [True: 1.04k, False: 11.4k]
  ------------------
  382|  1.04k|      if (c == quote) {
  ------------------
  |  Branch (382:11): [True: 593, False: 455]
  ------------------
  383|    593|	state = 0;
  384|    593|      }
  385|  1.04k|      break;
  386|  6.00k|    case 2: // in square brackets; not in quotes
  ------------------
  |  Branch (386:5): [True: 6.00k, False: 6.50k]
  ------------------
  387|  6.00k|      if (c == ']') {
  ------------------
  |  Branch (387:11): [True: 358, False: 5.64k]
  ------------------
  388|    358|	state = 0;
  389|  5.64k|      } else if (c == '"' || c == '\'') {
  ------------------
  |  Branch (389:18): [True: 230, False: 5.41k]
  |  Branch (389:30): [True: 246, False: 5.16k]
  ------------------
  390|    476|	state = 3;
  391|    476|      }
  392|  6.00k|      break;
  393|    911|    case 3: // in square brackets; in quotes
  ------------------
  |  Branch (393:5): [True: 911, False: 11.5k]
  ------------------
  394|    911|      if (c == quote) {
  ------------------
  |  Branch (394:11): [True: 445, False: 466]
  ------------------
  395|    445|	state = 2;
  396|    445|      }
  397|    911|      break;
  398|  12.5k|    }
  399|  12.5k|  }
  400|       |
  401|    253|  par->addChild(new ZxDocTypeDecl(name));
  402|    253|}
_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.24M|  while ((attr = parseAttr())) {
  ------------------
  |  Branch (414:10): [True: 912k, False: 1.32M]
  ------------------
  415|   912k|    elem->addAttr(attr);
  416|   912k|    parseSpace();
  417|   912k|  }
  418|  1.32M|  if (match("/>")) {
  ------------------
  |  Branch (418:7): [True: 36.3k, False: 1.29M]
  ------------------
  419|  36.3k|    parsePtr += 2;
  420|  1.29M|  } else if (match(">")) {
  ------------------
  |  Branch (420:14): [True: 1.20M, False: 85.9k]
  ------------------
  421|  1.20M|    ++parsePtr;
  422|  1.20M|    parseContent(elem);
  423|  1.20M|  }
  424|  1.32M|  par->addChild(elem);
  425|  1.32M|}
_ZN5ZxDoc9parseAttrEv:
  427|  2.24M|ZxAttr *ZxDoc::parseAttr() {
  428|  2.24M|  GString *name, *value;
  429|  2.24M|  const char *start;
  430|  2.24M|  char quote, c;
  431|  2.24M|  unsigned int x;
  432|  2.24M|  int n;
  433|       |
  434|  2.24M|  name = parseName();
  435|  2.24M|  parseSpace();
  436|  2.24M|  if (!match("=")) {
  ------------------
  |  Branch (436:7): [True: 1.32M, False: 919k]
  ------------------
  437|  1.32M|    delete name;
  438|  1.32M|    return NULL;
  439|  1.32M|  }
  440|   919k|  ++parsePtr;
  441|   919k|  parseSpace();
  442|   919k|  if (!(parsePtr < parseEnd && (*parsePtr == '"' || *parsePtr == '\''))) {
  ------------------
  |  Branch (442:9): [True: 919k, False: 39]
  |  Branch (442:33): [True: 869k, False: 49.8k]
  |  Branch (442:53): [True: 42.4k, False: 7.42k]
  ------------------
  443|  7.46k|    delete name;
  444|  7.46k|    return NULL;
  445|  7.46k|  }
  446|   912k|  quote = *parsePtr++;
  447|   912k|  value = new GString();
  448|  1.12M|  while (parsePtr < parseEnd && *parsePtr != quote) {
  ------------------
  |  Branch (448:10): [True: 1.12M, False: 604]
  |  Branch (448:33): [True: 215k, False: 911k]
  ------------------
  449|   215k|    if (*parsePtr == '&') {
  ------------------
  |  Branch (449:9): [True: 111k, False: 103k]
  ------------------
  450|   111k|      ++parsePtr;
  451|   111k|      if (parsePtr < parseEnd && *parsePtr == '#') {
  ------------------
  |  Branch (451:11): [True: 111k, False: 23]
  |  Branch (451:34): [True: 24.5k, False: 86.7k]
  ------------------
  452|  24.5k|	++parsePtr;
  453|  24.5k|	if (parsePtr < parseEnd && *parsePtr == 'x') {
  ------------------
  |  Branch (453:6): [True: 24.5k, False: 4]
  |  Branch (453:29): [True: 9.43k, False: 15.1k]
  ------------------
  454|  9.43k|	  ++parsePtr;
  455|  9.43k|	  x = 0;
  456|  44.8k|	  while (parsePtr < parseEnd) {
  ------------------
  |  Branch (456:11): [True: 44.8k, False: 37]
  ------------------
  457|  44.8k|	    c = *parsePtr;
  458|  44.8k|	    if (c >= '0' && c <= '9') {
  ------------------
  |  Branch (458:10): [True: 40.4k, False: 4.41k]
  |  Branch (458:22): [True: 5.07k, False: 35.3k]
  ------------------
  459|  5.07k|	      x = (x << 4) + (c - '0');
  460|  39.7k|	    } else if (c >= 'a' && c <= 'f') {
  ------------------
  |  Branch (460:17): [True: 15.2k, False: 24.4k]
  |  Branch (460:29): [True: 14.7k, False: 499]
  ------------------
  461|  14.7k|	      x = (x << 4) + (10 + c - 'a');
  462|  24.9k|	    } else if (c >= 'A' && c <= 'F') {
  ------------------
  |  Branch (462:17): [True: 16.8k, False: 8.15k]
  |  Branch (462:29): [True: 15.5k, False: 1.25k]
  ------------------
  463|  15.5k|	      x = (x << 4) + (10 + c - 'A');
  464|  15.5k|	    } else {
  465|  9.40k|	      break;
  466|  9.40k|	    }
  467|  35.4k|	    ++parsePtr;
  468|  35.4k|	  }
  469|  9.43k|	  if (parsePtr < parseEnd && *parsePtr == ';') {
  ------------------
  |  Branch (469:8): [True: 9.40k, False: 37]
  |  Branch (469:31): [True: 2.61k, False: 6.78k]
  ------------------
  470|  2.61k|	    ++parsePtr;
  471|  2.61k|	  }
  472|  9.43k|	  appendUTF8(value, x);
  473|  15.1k|	} else {
  474|  15.1k|	  x = 0;
  475|  63.6k|	  while (parsePtr < parseEnd) {
  ------------------
  |  Branch (475:11): [True: 63.6k, False: 12]
  ------------------
  476|  63.6k|	    c = *parsePtr;
  477|  63.6k|	    if (c >= '0' && c <= '9') {
  ------------------
  |  Branch (477:10): [True: 52.7k, False: 10.8k]
  |  Branch (477:22): [True: 48.4k, False: 4.31k]
  ------------------
  478|  48.4k|	      x = x * 10 + (c - '0');
  479|  48.4k|	    } else {
  480|  15.1k|	      break;
  481|  15.1k|	    }
  482|  48.4k|	    ++parsePtr;
  483|  48.4k|	  }
  484|  15.1k|	  if (parsePtr < parseEnd && *parsePtr == ';') {
  ------------------
  |  Branch (484:8): [True: 15.1k, False: 12]
  |  Branch (484:31): [True: 1.20k, False: 13.9k]
  ------------------
  485|  1.20k|	    ++parsePtr;
  486|  1.20k|	  }
  487|  15.1k|	  appendUTF8(value, x);
  488|  15.1k|	}
  489|  86.7k|      } else {
  490|  86.7k|	start = parsePtr;
  491|  86.7k|	for (++parsePtr;
  492|  17.6M|	     parsePtr < parseEnd && *parsePtr != ';' &&
  ------------------
  |  Branch (492:7): [True: 17.6M, False: 308]
  |  Branch (492:30): [True: 17.6M, False: 2.68k]
  ------------------
  493|  17.6M|	       *parsePtr != quote && *parsePtr != '&';
  ------------------
  |  Branch (493:9): [True: 17.6M, False: 5.20k]
  |  Branch (493:31): [True: 17.5M, False: 78.5k]
  ------------------
  494|  17.5M|	     ++parsePtr) ;
  495|  86.7k|	n = (int)(parsePtr - start);
  496|  86.7k|	if (parsePtr < parseEnd && *parsePtr == ';') {
  ------------------
  |  Branch (496:6): [True: 86.4k, False: 308]
  |  Branch (496:29): [True: 2.68k, False: 83.7k]
  ------------------
  497|  2.68k|	  ++parsePtr;
  498|  2.68k|	}
  499|  86.7k|	if (n == 2 && !strncmp(start, "lt", 2)) {
  ------------------
  |  Branch (499:6): [True: 12.1k, False: 74.6k]
  |  Branch (499:16): [True: 1.26k, False: 10.8k]
  ------------------
  500|  1.26k|	  value->append('<');
  501|  85.4k|	} else if (n == 2 && !strncmp(start, "gt", 2)) {
  ------------------
  |  Branch (501:13): [True: 10.8k, False: 74.6k]
  |  Branch (501:23): [True: 4.32k, False: 6.54k]
  ------------------
  502|  4.32k|	  value->append('>');
  503|  81.1k|	} else if (n == 3 && !strncmp(start, "amp", 3)) {
  ------------------
  |  Branch (503:13): [True: 17.0k, False: 64.0k]
  |  Branch (503:23): [True: 13.5k, False: 3.53k]
  ------------------
  504|  13.5k|	  value->append('&');
  505|  67.6k|	} else if (n == 4 && !strncmp(start, "apos", 4)) {
  ------------------
  |  Branch (505:13): [True: 11.6k, False: 56.0k]
  |  Branch (505:23): [True: 1.30k, False: 10.3k]
  ------------------
  506|  1.30k|	  value->append('\'');
  507|  66.3k|	} else if (n == 4 && !strncmp(start, "quot", 4)) {
  ------------------
  |  Branch (507:13): [True: 10.3k, False: 56.0k]
  |  Branch (507:23): [True: 2.96k, False: 7.35k]
  ------------------
  508|  2.96k|	  value->append('"');
  509|  63.3k|	} else {
  510|  63.3k|	  value->append(start - 1, (int)(parsePtr - start) + 1);
  511|  63.3k|	}
  512|  86.7k|      }
  513|   111k|    } else {
  514|   103k|      start = parsePtr;
  515|   103k|      for (++parsePtr;
  516|  4.85M|	   parsePtr < parseEnd && *parsePtr != quote && *parsePtr != '&';
  ------------------
  |  Branch (516:5): [True: 4.85M, False: 126]
  |  Branch (516:28): [True: 4.76M, False: 91.2k]
  |  Branch (516:50): [True: 4.75M, False: 12.5k]
  ------------------
  517|  4.75M|	   ++parsePtr) ;
  518|   103k|      value->append(start, (int)(parsePtr - start));
  519|   103k|    }
  520|   215k|  }
  521|   912k|  if (parsePtr < parseEnd && *parsePtr == quote) {
  ------------------
  |  Branch (521:7): [True: 911k, False: 604]
  |  Branch (521:30): [True: 911k, False: 0]
  ------------------
  522|   911k|    ++parsePtr;
  523|   911k|  }
  524|   912k|  return new ZxAttr(name, value);
  525|   919k|}
_ZN5ZxDoc12parseContentEP9ZxElement:
  528|  1.20M|void ZxDoc::parseContent(ZxElement *par) {
  529|  1.20M|  GString *endType;
  530|       |
  531|  1.20M|  endType = (new GString("</"))->append(par->getType());
  532|       |
  533|  2.68M|  while (parsePtr < parseEnd) {
  ------------------
  |  Branch (533:10): [True: 1.49M, False: 1.19M]
  ------------------
  534|  1.49M|    if (match(endType->getCString())) {
  ------------------
  |  Branch (534:9): [True: 13.8k, False: 1.48M]
  ------------------
  535|  13.8k|      parsePtr += endType->getLength();
  536|  13.8k|      parseSpace();
  537|  13.8k|      if (match(">")) {
  ------------------
  |  Branch (537:11): [True: 4.29k, False: 9.53k]
  ------------------
  538|  4.29k|	++parsePtr;
  539|  4.29k|      }
  540|  13.8k|      break;
  541|  1.48M|    } else if (match("<?")) {
  ------------------
  |  Branch (541:16): [True: 14.1k, False: 1.46M]
  ------------------
  542|  14.1k|      parsePI(par);
  543|  1.46M|    } else if (match("<![CDATA[")) {
  ------------------
  |  Branch (543:16): [True: 4.01k, False: 1.46M]
  ------------------
  544|  4.01k|      parseCDSect(par);
  545|  1.46M|    } else if (match("<!--")) {
  ------------------
  |  Branch (545:16): [True: 741, False: 1.46M]
  ------------------
  546|    741|      parseComment(par);
  547|  1.46M|    } else if (match("<")) {
  ------------------
  |  Branch (547:16): [True: 1.32M, False: 138k]
  ------------------
  548|  1.32M|      parseElement(par);
  549|  1.32M|    } else {
  550|   138k|      parseCharData(par);
  551|   138k|    }
  552|  1.49M|  }
  553|       |
  554|  1.20M|  delete endType;
  555|  1.20M|}
_ZN5ZxDoc13parseCharDataEP9ZxElement:
  557|   138k|void ZxDoc::parseCharData(ZxElement *par) {
  558|   138k|  GString *data;
  559|   138k|  const char *start;
  560|   138k|  char c;
  561|   138k|  unsigned int x;
  562|   138k|  int n;
  563|       |
  564|   138k|  data = new GString();
  565|   711k|  while (parsePtr < parseEnd && *parsePtr != '<') {
  ------------------
  |  Branch (565:10): [True: 710k, False: 990]
  |  Branch (565:33): [True: 572k, False: 137k]
  ------------------
  566|   572k|    if (*parsePtr == '&') {
  ------------------
  |  Branch (566:9): [True: 440k, False: 132k]
  ------------------
  567|   440k|      ++parsePtr;
  568|   440k|      if (parsePtr < parseEnd && *parsePtr == '#') {
  ------------------
  |  Branch (568:11): [True: 440k, False: 48]
  |  Branch (568:34): [True: 75.9k, False: 364k]
  ------------------
  569|  75.9k|	++parsePtr;
  570|  75.9k|	if (parsePtr < parseEnd && *parsePtr == 'x') {
  ------------------
  |  Branch (570:6): [True: 75.9k, False: 13]
  |  Branch (570:29): [True: 20.9k, False: 54.9k]
  ------------------
  571|  20.9k|	  ++parsePtr;
  572|  20.9k|	  x = 0;
  573|   129k|	  while (parsePtr < parseEnd) {
  ------------------
  |  Branch (573:11): [True: 128k, False: 212]
  ------------------
  574|   128k|	    c = *parsePtr;
  575|   128k|	    if (c >= '0' && c <= '9') {
  ------------------
  |  Branch (575:10): [True: 118k, False: 10.8k]
  |  Branch (575:22): [True: 46.7k, False: 71.3k]
  ------------------
  576|  46.7k|	      x = (x << 4) + (c - '0');
  577|  82.1k|	    } else if (c >= 'a' && c <= 'f') {
  ------------------
  |  Branch (577:17): [True: 34.5k, False: 47.5k]
  |  Branch (577:29): [True: 33.3k, False: 1.20k]
  ------------------
  578|  33.3k|	      x = (x << 4) + (10 + c - 'a');
  579|  48.7k|	    } else if (c >= 'A' && c <= 'F') {
  ------------------
  |  Branch (579:17): [True: 29.9k, False: 18.8k]
  |  Branch (579:29): [True: 28.0k, False: 1.91k]
  ------------------
  580|  28.0k|	      x = (x << 4) + (10 + c - 'A');
  581|  28.0k|	    } else {
  582|  20.7k|	      break;
  583|  20.7k|	    }
  584|   108k|	    ++parsePtr;
  585|   108k|	  }
  586|  20.9k|	  if (parsePtr < parseEnd && *parsePtr == ';') {
  ------------------
  |  Branch (586:8): [True: 20.7k, False: 212]
  |  Branch (586:31): [True: 5.64k, False: 15.1k]
  ------------------
  587|  5.64k|	    ++parsePtr;
  588|  5.64k|	  }
  589|  20.9k|	  appendUTF8(data, x);
  590|  54.9k|	} else {
  591|  54.9k|	  x = 0;
  592|   303k|	  while (parsePtr < parseEnd) {
  ------------------
  |  Branch (592:11): [True: 303k, False: 75]
  ------------------
  593|   303k|	    c = *parsePtr;
  594|   303k|	    if (c >= '0' && c <= '9') {
  ------------------
  |  Branch (594:10): [True: 268k, False: 34.7k]
  |  Branch (594:22): [True: 248k, False: 20.1k]
  ------------------
  595|   248k|	      x = x * 10 + (c - '0');
  596|   248k|	    } else {
  597|  54.9k|	      break;
  598|  54.9k|	    }
  599|   248k|	    ++parsePtr;
  600|   248k|	  }
  601|  54.9k|	  if (parsePtr < parseEnd && *parsePtr == ';') {
  ------------------
  |  Branch (601:8): [True: 54.9k, False: 75]
  |  Branch (601:31): [True: 7.80k, False: 47.1k]
  ------------------
  602|  7.80k|	    ++parsePtr;
  603|  7.80k|	  }
  604|  54.9k|	  appendUTF8(data, x);
  605|  54.9k|	}
  606|   364k|      } else {
  607|   364k|	start = parsePtr;
  608|   364k|	for (++parsePtr;
  609|  19.1M|	     parsePtr < parseEnd && *parsePtr != ';' &&
  ------------------
  |  Branch (609:7): [True: 19.1M, False: 325]
  |  Branch (609:30): [True: 19.1M, False: 5.99k]
  ------------------
  610|  19.1M|	       *parsePtr != '<' && *parsePtr != '&';
  ------------------
  |  Branch (610:9): [True: 19.0M, False: 53.7k]
  |  Branch (610:29): [True: 18.7M, False: 304k]
  ------------------
  611|  18.7M|	     ++parsePtr) ;
  612|   364k|	n = (int)(parsePtr - start);
  613|   364k|	if (parsePtr < parseEnd && *parsePtr == ';') {
  ------------------
  |  Branch (613:6): [True: 364k, False: 325]
  |  Branch (613:29): [True: 5.99k, False: 358k]
  ------------------
  614|  5.99k|	  ++parsePtr;
  615|  5.99k|	}
  616|   364k|	if (n == 2 && !strncmp(start, "lt", 2)) {
  ------------------
  |  Branch (616:6): [True: 135k, False: 229k]
  |  Branch (616:16): [True: 3.74k, False: 131k]
  ------------------
  617|  3.74k|	  data->append('<');
  618|   361k|	} else if (n == 2 && !strncmp(start, "gt", 2)) {
  ------------------
  |  Branch (618:13): [True: 131k, False: 229k]
  |  Branch (618:23): [True: 98.2k, False: 33.6k]
  ------------------
  619|  98.2k|	  data->append('>');
  620|   262k|	} else if (n == 3 && !strncmp(start, "amp", 3)) {
  ------------------
  |  Branch (620:13): [True: 56.2k, False: 206k]
  |  Branch (620:23): [True: 34.7k, False: 21.5k]
  ------------------
  621|  34.7k|	  data->append('&');
  622|   228k|	} else if (n == 4 && !strncmp(start, "apos", 4)) {
  ------------------
  |  Branch (622:13): [True: 73.2k, False: 154k]
  |  Branch (622:23): [True: 1.79k, False: 71.4k]
  ------------------
  623|  1.79k|	  data->append('\'');
  624|   226k|	} else if (n == 4 && !strncmp(start, "quot", 4)) {
  ------------------
  |  Branch (624:13): [True: 71.4k, False: 154k]
  |  Branch (624:23): [True: 18.9k, False: 52.4k]
  ------------------
  625|  18.9k|	  data->append('"');
  626|   207k|	} else {
  627|   207k|	  data->append(start - 1, (int)(parsePtr - start) + 1);
  628|   207k|	}
  629|   364k|      }
  630|   440k|    } else {
  631|   132k|      start = parsePtr;
  632|   132k|      for (++parsePtr;
  633|  13.4M|	   parsePtr < parseEnd && *parsePtr != '<' && *parsePtr != '&';
  ------------------
  |  Branch (633:5): [True: 13.4M, False: 357]
  |  Branch (633:28): [True: 13.3M, False: 80.9k]
  |  Branch (633:48): [True: 13.3M, False: 50.7k]
  ------------------
  634|  13.3M|	   ++parsePtr) ;
  635|   132k|      data->append(start, (int)(parsePtr - start));
  636|   132k|    }
  637|   572k|  }
  638|   138k|  par->addChild(new ZxCharData(data, true));
  639|   138k|}
_ZN5ZxDoc10appendUTF8EP7GStringj:
  641|   100k|void ZxDoc::appendUTF8(GString *s, unsigned int c) {
  642|   100k|  if (c <= 0x7f) {
  ------------------
  |  Branch (642:7): [True: 38.1k, False: 62.3k]
  ------------------
  643|  38.1k|    s->append((char)c);
  644|  62.3k|  } else if (c <= 0x7ff) {
  ------------------
  |  Branch (644:14): [True: 8.19k, False: 54.1k]
  ------------------
  645|  8.19k|    s->append((char)(0xc0 + (c >> 6)));
  646|  8.19k|    s->append((char)(0x80 + (c & 0x3f)));
  647|  54.1k|  } else if (c <= 0xffff) {
  ------------------
  |  Branch (647:14): [True: 13.2k, False: 40.9k]
  ------------------
  648|  13.2k|    s->append((char)(0xe0 + (c >> 12)));
  649|  13.2k|    s->append((char)(0x80 + ((c >> 6) & 0x3f)));
  650|  13.2k|    s->append((char)(0x80 + (c & 0x3f)));
  651|  40.9k|  } else if (c <= 0x1fffff) {
  ------------------
  |  Branch (651:14): [True: 12.3k, False: 28.6k]
  ------------------
  652|  12.3k|    s->append((char)(0xf0 + (c >> 18)));
  653|  12.3k|    s->append((char)(0x80 + ((c >> 12) & 0x3f)));
  654|  12.3k|    s->append((char)(0x80 + ((c >> 6) & 0x3f)));
  655|  12.3k|    s->append((char)(0x80 + (c & 0x3f)));
  656|  28.6k|  } else if (c <= 0x3ffffff) {
  ------------------
  |  Branch (656:14): [True: 4.73k, False: 23.8k]
  ------------------
  657|  4.73k|    s->append((char)(0xf8 + (c >> 24)));
  658|  4.73k|    s->append((char)(0x80 + ((c >> 18) & 0x3f)));
  659|  4.73k|    s->append((char)(0x80 + ((c >> 12) & 0x3f)));
  660|  4.73k|    s->append((char)(0x80 + ((c >> 6) & 0x3f)));
  661|  4.73k|    s->append((char)(0x80 + (c & 0x3f)));
  662|  23.8k|  } else if (c <= 0x7fffffff) {
  ------------------
  |  Branch (662:14): [True: 18.8k, False: 5.02k]
  ------------------
  663|  18.8k|    s->append((char)(0xfc + (c >> 30)));
  664|  18.8k|    s->append((char)(0x80 + ((c >> 24) & 0x3f)));
  665|  18.8k|    s->append((char)(0x80 + ((c >> 18) & 0x3f)));
  666|  18.8k|    s->append((char)(0x80 + ((c >> 12) & 0x3f)));
  667|  18.8k|    s->append((char)(0x80 + ((c >> 6) & 0x3f)));
  668|  18.8k|    s->append((char)(0x80 + (c & 0x3f)));
  669|  18.8k|  }
  670|   100k|}
_ZN5ZxDoc11parseCDSectEP6ZxNode:
  673|  4.01k|void ZxDoc::parseCDSect(ZxNode *par) {
  674|  4.01k|  const char *start;
  675|       |
  676|  4.01k|  parsePtr += 9;
  677|  4.01k|  start = parsePtr;
  678|   340k|  while (parsePtr < parseEnd - 3) {
  ------------------
  |  Branch (678:10): [True: 340k, False: 45]
  ------------------
  679|   340k|    if (!strncmp(parsePtr, "]]>", 3)) {
  ------------------
  |  Branch (679:9): [True: 3.97k, False: 336k]
  ------------------
  680|  3.97k|      par->addChild(new ZxCharData(new GString(start, (int)(parsePtr - start)),
  681|  3.97k|				   false));
  682|  3.97k|      parsePtr += 3;
  683|  3.97k|      return;
  684|  3.97k|    }
  685|   336k|    ++parsePtr;
  686|   336k|  }
  687|     45|  parsePtr = parseEnd;
  688|     45|  par->addChild(new ZxCharData(new GString(start, (int)(parsePtr - start)),
  689|     45|			       false));
  690|     45|}
_ZN5ZxDoc9parseMiscEP6ZxNode:
  692|  11.4k|void ZxDoc::parseMisc(ZxNode *par) {
  693|  13.5k|  while (1) {
  ------------------
  |  Branch (693:10): [True: 13.5k, Folded]
  ------------------
  694|  13.5k|    if (match("<!--")) {
  ------------------
  |  Branch (694:9): [True: 566, False: 12.9k]
  ------------------
  695|    566|      parseComment(par);
  696|  12.9k|    } else if (match("<?")) {
  ------------------
  |  Branch (696:16): [True: 869, False: 12.1k]
  ------------------
  697|    869|      parsePI(par);
  698|  12.1k|    } else if (parsePtr < parseEnd && (*parsePtr == '\x20' ||
  ------------------
  |  Branch (698:16): [True: 7.48k, False: 4.64k]
  |  Branch (698:40): [True: 247, False: 7.23k]
  ------------------
  699|  7.23k|				       *parsePtr == '\x09' ||
  ------------------
  |  Branch (699:12): [True: 207, False: 7.02k]
  ------------------
  700|  7.02k|				       *parsePtr == '\x0d' ||
  ------------------
  |  Branch (700:12): [True: 152, False: 6.87k]
  ------------------
  701|  6.87k|				       *parsePtr == '\x0a')) {
  ------------------
  |  Branch (701:12): [True: 77, False: 6.80k]
  ------------------
  702|    683|      ++parsePtr;
  703|  11.4k|    } else {
  704|  11.4k|      break;
  705|  11.4k|    }
  706|  13.5k|  }
  707|  11.4k|}
_ZN5ZxDoc12parseCommentEP6ZxNode:
  710|  1.30k|void ZxDoc::parseComment(ZxNode *par) {
  711|  1.30k|  const char *start;
  712|       |
  713|  1.30k|  parsePtr += 4;
  714|  1.30k|  start = parsePtr;
  715|   515k|  while (parsePtr <= parseEnd - 3) {
  ------------------
  |  Branch (715:10): [True: 515k, False: 62]
  ------------------
  716|   515k|    if (!strncmp(parsePtr, "-->", 3)) {
  ------------------
  |  Branch (716:9): [True: 1.24k, False: 514k]
  ------------------
  717|  1.24k|      par->addChild(new ZxComment(new GString(start, (int)(parsePtr - start))));
  718|  1.24k|      parsePtr += 3;
  719|  1.24k|      return;
  720|  1.24k|    }
  721|   514k|    ++parsePtr;
  722|   514k|  }
  723|     62|  parsePtr = parseEnd;
  724|     62|}
_ZN5ZxDoc7parsePIEP6ZxNode:
  727|  15.0k|void ZxDoc::parsePI(ZxNode *par) {
  728|  15.0k|  GString *target;
  729|  15.0k|  const char *start;
  730|       |
  731|  15.0k|  parsePtr += 2;
  732|  15.0k|  target = parseName();
  733|  15.0k|  parseSpace();
  734|  15.0k|  start = parsePtr;
  735|  6.43M|  while (parsePtr <= parseEnd - 2) {
  ------------------
  |  Branch (735:10): [True: 6.43M, False: 208]
  ------------------
  736|  6.43M|    if (!strncmp(parsePtr, "?>", 2)) {
  ------------------
  |  Branch (736:9): [True: 14.8k, False: 6.42M]
  ------------------
  737|  14.8k|      par->addChild(new ZxPI(target, new GString(start,
  738|  14.8k|						 (int)(parsePtr - start))));
  739|  14.8k|      parsePtr += 2;
  740|  14.8k|      return;
  741|  14.8k|    }
  742|  6.42M|    ++parsePtr;
  743|  6.42M|  }
  744|    208|  parsePtr = parseEnd;
  745|    208|  par->addChild(new ZxPI(target, new GString(start, (int)(parsePtr - start))));
  746|    208|}
_ZN5ZxDoc9parseNameEv:
  750|  3.58M|GString *ZxDoc::parseName() {
  751|  3.58M|  GString *name;
  752|       |
  753|  3.58M|  name = new GString();
  754|  3.58M|  if (parsePtr < parseEnd && nameStartChar[*parsePtr & 0xff]) {
  ------------------
  |  Branch (754:7): [True: 3.58M, False: 1.11k]
  |  Branch (754:30): [True: 140k, False: 3.44M]
  ------------------
  755|   140k|    name->append(*parsePtr++);
  756|  13.2M|    while (parsePtr < parseEnd && nameChar[*parsePtr & 0xff]) {
  ------------------
  |  Branch (756:12): [True: 13.2M, False: 111]
  |  Branch (756:35): [True: 13.1M, False: 140k]
  ------------------
  757|  13.1M|      name->append(*parsePtr++);
  758|  13.1M|    }
  759|   140k|  }
  760|  3.58M|  return name;
  761|  3.58M|}
_ZN5ZxDoc17parseQuotedStringEv:
  763|    371|GString *ZxDoc::parseQuotedString() {
  764|    371|  GString *s;
  765|    371|  const char *start;
  766|    371|  char quote;
  767|       |
  768|    371|  if (parsePtr < parseEnd && (*parsePtr == '"' || *parsePtr == '\'')) {
  ------------------
  |  Branch (768:7): [True: 276, False: 95]
  |  Branch (768:31): [True: 78, False: 198]
  |  Branch (768:51): [True: 91, False: 107]
  ------------------
  769|    169|    quote = *parsePtr++;
  770|    169|    start = parsePtr;
  771|    564|    while (parsePtr < parseEnd && *parsePtr != quote) {
  ------------------
  |  Branch (771:12): [True: 519, False: 45]
  |  Branch (771:35): [True: 395, False: 124]
  ------------------
  772|    395|      ++parsePtr;
  773|    395|    }
  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|    202|  } else {
  779|    202|    s = new GString();
  780|    202|  }
  781|    371|  return s;
  782|    371|}
_ZN5ZxDoc8parseBOMEv:
  784|  3.81k|void ZxDoc::parseBOM() {
  785|  3.81k|  if (match("\xef\xbb\xbf")) {
  ------------------
  |  Branch (785:7): [True: 37, False: 3.77k]
  ------------------
  786|     37|    parsePtr += 3;
  787|     37|  }
  788|  3.81k|}
_ZN5ZxDoc10parseSpaceEv:
  790|  5.44M|void ZxDoc::parseSpace() {
  791|  5.75M|  while (parsePtr < parseEnd && (*parsePtr == '\x20' ||
  ------------------
  |  Branch (791:10): [True: 5.75M, False: 3.15k]
  |  Branch (791:34): [True: 137k, False: 5.61M]
  ------------------
  792|  5.61M|				 *parsePtr == '\x09' ||
  ------------------
  |  Branch (792:6): [True: 67.5k, False: 5.55M]
  ------------------
  793|  5.55M|				 *parsePtr == '\x0d' ||
  ------------------
  |  Branch (793:6): [True: 61.2k, False: 5.48M]
  ------------------
  794|  5.48M|				 *parsePtr == '\x0a')) {
  ------------------
  |  Branch (794:6): [True: 51.2k, False: 5.43M]
  ------------------
  795|   318k|    ++parsePtr;
  796|   318k|  }
  797|  5.44M|}
_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.9k]
  |  Branch (803:38): [True: 3.53M, False: 8.74M]
  ------------------
  804|  12.2M|}
_ZN9ZxXMLDeclC2EP7GStringS1_b:
  822|    803|ZxXMLDecl::ZxXMLDecl(GString *versionA, GString *encodingA, bool standaloneA) {
  823|    803|  version = versionA;
  824|    803|  encoding = encodingA;
  825|    803|  standalone = standaloneA;
  826|    803|}
_ZN9ZxXMLDeclD2Ev:
  828|    803|ZxXMLDecl::~ZxXMLDecl() {
  829|    803|  delete version;
  830|    803|  if (encoding) {
  ------------------
  |  Branch (830:7): [True: 118, False: 685]
  ------------------
  831|    118|    delete encoding;
  832|    118|  }
  833|    803|}
_ZN13ZxDocTypeDeclC2EP7GString:
  858|    253|ZxDocTypeDecl::ZxDocTypeDecl(GString *nameA) {
  859|    253|  name = nameA;
  860|    253|}
_ZN13ZxDocTypeDeclD2Ev:
  862|    253|ZxDocTypeDecl::~ZxDocTypeDecl() {
  863|    253|  delete name;
  864|    253|}
_ZN9ZxCommentC2EP7GString:
  880|  1.24k|ZxComment::ZxComment(GString *textA) {
  881|  1.24k|  text = textA;
  882|  1.24k|}
_ZN9ZxCommentD2Ev:
  884|  1.24k|ZxComment::~ZxComment() {
  885|  1.24k|  delete text;
  886|  1.24k|}
_ZN4ZxPIC2EP7GStringS1_:
  902|  15.0k|ZxPI::ZxPI(GString *targetA, GString *textA) {
  903|  15.0k|  target = targetA;
  904|  15.0k|  text = textA;
  905|  15.0k|}
_ZN4ZxPID2Ev:
  907|  15.0k|ZxPI::~ZxPI() {
  908|  15.0k|  delete target;
  909|  15.0k|  delete text;
  910|  15.0k|}
_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.24M|      while (_hash->getNext(&_iter, &_key, &_p)) { \
  |  |  ------------------
  |  |  |  Branch (67:14): [True: 912k, False: 1.32M]
  |  |  ------------------
  |  |   68|   912k|        delete (T*)_p;                             \
  |  |   69|   912k|      }                                            \
  |  |   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|   912k|void ZxElement::addAttr(ZxAttr *attr) {
  948|   912k|  attrs->add(attr->getName(), attr);
  949|   912k|  if (lastAttr) {
  ------------------
  |  Branch (949:7): [True: 863k, False: 48.5k]
  ------------------
  950|   863k|    lastAttr->next = attr;
  951|   863k|    lastAttr= attr;
  952|   863k|  } else {
  953|  48.5k|    firstAttr = lastAttr = attr;
  954|  48.5k|  }
  955|   912k|  attr->parent = this;
  956|       |  attr->next = NULL;
  957|   912k|}
_ZN6ZxAttrC2EP7GStringS1_:
 1025|   912k|ZxAttr::ZxAttr(GString *nameA, GString *valueA) {
 1026|   912k|  name = nameA;
 1027|   912k|  value = valueA;
 1028|   912k|  parent = NULL;
 1029|       |  next = NULL;
 1030|   912k|}
_ZN6ZxAttrD2Ev:
 1032|   912k|ZxAttr::~ZxAttr() {
 1033|   912k|  delete name;
 1034|   912k|  delete value;
 1035|   912k|}
_ZN10ZxCharDataC2EP7GStringb:
 1039|   142k|ZxCharData::ZxCharData(GString *dataA, bool parsedA) {
 1040|   142k|  data = dataA;
 1041|   142k|  parsed = parsedA;
 1042|   142k|}
_ZN10ZxCharDataD2Ev:
 1044|   142k|ZxCharData::~ZxCharData() {
 1045|   142k|  delete data;
 1046|   142k|}

_ZN6ZxNode9isXMLDeclEv:
   36|  4.12k|  virtual bool isXMLDecl()  { return false; }
_ZN6ZxNode13isDocTypeDeclEv:
   37|  3.87k|  virtual bool isDocTypeDecl() { return false; }
_ZN6ZxNode9isElementEv:
   40|  1.39k|  virtual bool isElement() { return false; }
_ZN9ZxXMLDecl9isXMLDeclEv:
  129|    803|  virtual bool isXMLDecl() { return true; }
_ZN13ZxDocTypeDecl13isDocTypeDeclEv:
  151|    253|  virtual bool isDocTypeDecl() { return true; }
_ZN9ZxElement9isElementEv:
  207|  2.47k|  virtual bool isElement() { return true; }
_ZN9ZxElement7getTypeEv:
  209|  1.20M|  GString *getType() { return type; }
_ZN6ZxAttr7getNameEv:
  233|   912k|  GString *getName() { return name; }

