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

_ZN5GHashC2Ei:
   38|  1.18M|GHash::GHash(GBool deleteKeysA) {
   39|  1.18M|  int h;
   40|       |
   41|  1.18M|  deleteKeys = deleteKeysA;
   42|  1.18M|  size = 7;
   43|  1.18M|  tab = (GHashBucket **)gmallocn(size, sizeof(GHashBucket *));
   44|  9.50M|  for (h = 0; h < size; ++h) {
  ------------------
  |  Branch (44:15): [True: 8.32M, False: 1.18M]
  ------------------
   45|  8.32M|    tab[h] = NULL;
   46|  8.32M|  }
   47|  1.18M|  len = 0;
   48|  1.18M|}
_ZN5GHashD2Ev:
   50|  1.18M|GHash::~GHash() {
   51|  1.18M|  GHashBucket *p;
   52|  1.18M|  int h;
   53|       |
   54|  10.9M|  for (h = 0; h < size; ++h) {
  ------------------
  |  Branch (54:15): [True: 9.74M, False: 1.18M]
  ------------------
   55|  10.5M|    while (tab[h]) {
  ------------------
  |  Branch (55:12): [True: 851k, False: 9.74M]
  ------------------
   56|   851k|      p = tab[h];
   57|   851k|      tab[h] = p->next;
   58|   851k|      if (deleteKeys) {
  ------------------
  |  Branch (58:11): [True: 0, False: 851k]
  ------------------
   59|      0|	delete p->key;
   60|      0|      }
   61|   851k|      delete p;
   62|   851k|    }
   63|  9.74M|  }
   64|  1.18M|  gfree(tab);
   65|  1.18M|}
_ZN5GHash3addEP7GStringPv:
   67|   851k|void GHash::add(GString *key, void *val) {
   68|   851k|  GHashBucket *p;
   69|   851k|  int h;
   70|       |
   71|       |  // expand the table if necessary
   72|   851k|  if (len >= size) {
  ------------------
  |  Branch (72:7): [True: 3.63k, False: 847k]
  ------------------
   73|  3.63k|    expand();
   74|  3.63k|  }
   75|       |
   76|       |  // add the new symbol
   77|   851k|  p = new GHashBucket;
   78|   851k|  p->key = key;
   79|   851k|  p->val.p = val;
   80|   851k|  h = hash(key);
   81|   851k|  p->next = tab[h];
   82|   851k|  tab[h] = p;
   83|   851k|  ++len;
   84|   851k|}
_ZN5GHash9startIterEPP9GHashIter:
  265|  1.18M|void GHash::startIter(GHashIter **iter) {
  266|  1.18M|  *iter = new GHashIter;
  267|  1.18M|  (*iter)->h = -1;
  268|  1.18M|  (*iter)->p = NULL;
  269|  1.18M|}
_ZN5GHash7getNextEPP9GHashIterPP7GStringPPv:
  271|  2.04M|GBool GHash::getNext(GHashIter **iter, GString **key, void **val) {
  272|  2.04M|  if (!*iter) {
  ------------------
  |  Branch (272:7): [True: 0, False: 2.04M]
  ------------------
  273|      0|    return gFalse;
  ------------------
  |  |   18|      0|#define gFalse 0
  ------------------
  274|      0|  }
  275|  2.04M|  if ((*iter)->p) {
  ------------------
  |  Branch (275:7): [True: 851k, False: 1.18M]
  ------------------
  276|   851k|    (*iter)->p = (*iter)->p->next;
  277|   851k|  }
  278|  11.7M|  while (!(*iter)->p) {
  ------------------
  |  Branch (278:10): [True: 10.9M, False: 851k]
  ------------------
  279|  10.9M|    if (++(*iter)->h == size) {
  ------------------
  |  Branch (279:9): [True: 1.18M, False: 9.74M]
  ------------------
  280|  1.18M|      delete *iter;
  281|  1.18M|      *iter = NULL;
  282|  1.18M|      return gFalse;
  ------------------
  |  |   18|  1.18M|#define gFalse 0
  ------------------
  283|  1.18M|    }
  284|  9.74M|    (*iter)->p = tab[(*iter)->h];
  285|  9.74M|  }
  286|   851k|  *key = (*iter)->p->key;
  287|   851k|  *val = (*iter)->p->val.p;
  288|   851k|  return gTrue;
  ------------------
  |  |   17|   851k|#define gTrue 1
  ------------------
  289|  2.04M|}
_ZN5GHash6expandEv:
  316|  3.63k|void GHash::expand() {
  317|  3.63k|  GHashBucket **oldTab;
  318|  3.63k|  GHashBucket *p;
  319|  3.63k|  int oldSize, h, i;
  320|       |
  321|  3.63k|  oldSize = size;
  322|  3.63k|  oldTab = tab;
  323|  3.63k|  size = 2*size + 1;
  324|  3.63k|  tab = (GHashBucket **)gmallocn(size, sizeof(GHashBucket *));
  325|  2.84M|  for (h = 0; h < size; ++h) {
  ------------------
  |  Branch (325:15): [True: 2.84M, False: 3.63k]
  ------------------
  326|  2.84M|    tab[h] = NULL;
  327|  2.84M|  }
  328|  1.42M|  for (i = 0; i < oldSize; ++i) {
  ------------------
  |  Branch (328:15): [True: 1.42M, False: 3.63k]
  ------------------
  329|  2.84M|    while (oldTab[i]) {
  ------------------
  |  Branch (329:12): [True: 1.42M, False: 1.42M]
  ------------------
  330|  1.42M|      p = oldTab[i];
  331|  1.42M|      oldTab[i] = oldTab[i]->next;
  332|  1.42M|      h = hash(p->key);
  333|  1.42M|      p->next = tab[h];
  334|  1.42M|      tab[h] = p;
  335|  1.42M|    }
  336|  1.42M|  }
  337|  3.63k|  gfree(oldTab);
  338|  3.63k|}
_ZN5GHash4hashEP7GString:
  364|  2.27M|int GHash::hash(GString *key) {
  365|  2.27M|  const char *p;
  366|  2.27M|  unsigned int h;
  367|  2.27M|  int i;
  368|       |
  369|  2.27M|  h = 0;
  370|  4.43M|  for (p = key->getCString(), i = 0; i < key->getLength(); ++p, ++i) {
  ------------------
  |  Branch (370:38): [True: 2.16M, False: 2.27M]
  ------------------
  371|  2.16M|    h = 17 * h + (int)(*p & 0xff);
  372|  2.16M|  }
  373|  2.27M|  return (int)(h % size);
  374|  2.27M|}

_ZN7GStringC2Ev:
  133|  4.19M|GString::GString() {
  134|  4.19M|  s = NULL;
  135|  4.19M|  resize(length = 0);
  136|  4.19M|  s[0] = '\0';
  137|  4.19M|}
_ZN7GStringC2EPKc:
  139|  1.09M|GString::GString(const char *sA) {
  140|  1.09M|  int n = (int)strlen(sA);
  141|       |
  142|  1.09M|  s = NULL;
  143|  1.09M|  resize(length = n);
  144|  1.09M|  memcpy(s, sA, n + 1);
  145|  1.09M|}
_ZN7GStringC2EPKci:
  147|  27.0k|GString::GString(const char *sA, int lengthA) {
  148|  27.0k|  s = NULL;
  149|  27.0k|  resize(length = lengthA);
  150|  27.0k|  memcpy(s, sA, length * sizeof(char));
  151|  27.0k|  s[length] = '\0';
  152|  27.0k|}
_ZN7GStringD2Ev:
  208|  5.31M|GString::~GString() {
  209|  5.31M|  delete[] s;
  210|  5.31M|}
_ZN7GString6appendEc:
  218|  11.1M|GString *GString::append(char c) {
  219|  11.1M|  if (length > INT_MAX - 1) {
  ------------------
  |  Branch (219:7): [True: 0, False: 11.1M]
  ------------------
  220|      0|    gMemError("Integer overflow in GString::append()");
  221|      0|  }
  222|  11.1M|  resize(length + 1);
  223|  11.1M|  s[length++] = c;
  224|  11.1M|  s[length] = '\0';
  225|  11.1M|  return this;
  226|  11.1M|}
_ZN7GString6appendEPS_:
  228|  1.09M|GString *GString::append(GString *str) {
  229|  1.09M|  int n = str->getLength();
  230|       |
  231|  1.09M|  if (length > INT_MAX - n) {
  ------------------
  |  Branch (231:7): [True: 0, False: 1.09M]
  ------------------
  232|      0|    gMemError("Integer overflow in GString::append()");
  233|      0|  }
  234|  1.09M|  resize(length + n);
  235|  1.09M|  memcpy(s + length, str->getCString(), n + 1);
  236|  1.09M|  length += n;
  237|  1.09M|  return this;
  238|  1.09M|}
_ZN7GString6appendEPKci:
  252|   227k|GString *GString::append(const char *str, int lengthA) {
  253|   227k|  if (lengthA < 0 || length > INT_MAX - lengthA) {
  ------------------
  |  Branch (253:7): [True: 0, False: 227k]
  |  Branch (253:22): [True: 0, False: 227k]
  ------------------
  254|      0|    gMemError("Integer overflow in GString::append()");
  255|      0|  }
  256|   227k|  resize(length + lengthA);
  257|   227k|  memcpy(s + length, str, lengthA);
  258|   227k|  length += lengthA;
  259|   227k|  s[length] = '\0';
  260|   227k|  return this;
  261|   227k|}
_ZN7GString3cmpEPKc:
  812|    131|int GString::cmp(const char *sA) {
  813|    131|  int n1, i, x;
  814|    131|  const char *p1, *p2;
  815|       |
  816|    131|  n1 = length;
  817|    181|  for (i = 0, p1 = s, p2 = sA; i < n1 && *p2; ++i, ++p1, ++p2) {
  ------------------
  |  Branch (817:32): [True: 87, False: 94]
  |  Branch (817:42): [True: 78, False: 9]
  ------------------
  818|     78|    x = (*p1 & 0xff) - (*p2 & 0xff);
  819|     78|    if (x != 0) {
  ------------------
  |  Branch (819:9): [True: 28, False: 50]
  ------------------
  820|     28|      return x;
  821|     28|    }
  822|     78|  }
  823|    103|  if (i < n1) {
  ------------------
  |  Branch (823:7): [True: 9, False: 94]
  ------------------
  824|      9|    return 1;
  825|      9|  }
  826|     94|  if (*p2) {
  ------------------
  |  Branch (826:7): [True: 93, False: 1]
  ------------------
  827|     93|    return -1;
  828|     93|  }
  829|      1|  return 0;
  830|     94|}
_ZN7GString6resizeEi:
  112|  17.7M|inline void GString::resize(int length1) {
  113|  17.7M|  char *s1;
  114|       |
  115|  17.7M|  if (length1 < 0) {
  ------------------
  |  Branch (115:7): [True: 0, False: 17.7M]
  ------------------
  116|      0|    gMemError("GString::resize() with negative length");
  117|      0|  }
  118|  17.7M|  if (!s) {
  ------------------
  |  Branch (118:7): [True: 5.31M, False: 12.4M]
  ------------------
  119|  5.31M|    s = new char[size(length1)];
  120|  12.4M|  } else if (size(length1) != size(length)) {
  ------------------
  |  Branch (120:14): [True: 105k, False: 12.3M]
  ------------------
  121|   105k|    s1 = new char[size(length1)];
  122|   105k|    if (length1 < length) {
  ------------------
  |  Branch (122:9): [True: 0, False: 105k]
  ------------------
  123|      0|      memcpy(s1, s, length1);
  124|      0|      s1[length1] = '\0';
  125|   105k|    } else {
  126|   105k|      memcpy(s1, s, length + 1);
  127|   105k|    }
  128|   105k|    delete[] s;
  129|   105k|    s = s1;
  130|   105k|  }
  131|  17.7M|}
GString.cc:_ZL4sizei:
  102|  30.3M|static inline int size(int len) {
  103|  30.3M|  int delta;
  104|   344M|  for (delta = 8; delta < len && delta < 0x100000; delta <<= 1) ;
  ------------------
  |  Branch (104:19): [True: 313M, False: 30.3M]
  |  Branch (104:34): [True: 313M, False: 0]
  ------------------
  105|  30.3M|  if (len > INT_MAX - delta) {
  ------------------
  |  Branch (105:7): [True: 0, False: 30.3M]
  ------------------
  106|      0|    gMemError("Integer overflow in GString::size()");
  107|      0|  }
  108|       |  // this is ((len + 1) + (delta - 1)) & ~(delta - 1)
  109|  30.3M|  return (len + delta) & ~(delta - 1);
  110|  30.3M|}

_ZN7GString10getCStringEv:
   83|  4.69M|  char *getCString() { return s; }
_ZN7GString9getLengthEv:
   80|  5.55M|  int getLength() { return length; }

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

_ZN6ZxNodeC2Ev:
   68|  1.32M|ZxNode::ZxNode() {
   69|  1.32M|  next = NULL;
   70|  1.32M|  parent = NULL;
   71|  1.32M|  firstChild = lastChild = NULL;
   72|  1.32M|}
_ZN6ZxNodeD2Ev:
   74|  1.32M|ZxNode::~ZxNode() {
   75|  1.32M|  ZxNode *child;
   76|       |
   77|  2.63M|  while (firstChild) {
  ------------------
  |  Branch (77:10): [True: 1.31M, False: 1.32M]
  ------------------
   78|  1.31M|    child = firstChild;
   79|  1.31M|    firstChild = firstChild->next;
   80|  1.31M|    delete child;
   81|  1.31M|  }
   82|  1.32M|}
_ZN6ZxNode8addChildEPS_:
  190|  1.31M|void ZxNode::addChild(ZxNode *child) {
  191|  1.31M|  if (lastChild) {
  ------------------
  |  Branch (191:7): [True: 217k, False: 1.09M]
  ------------------
  192|   217k|    lastChild->next = child;
  193|   217k|    lastChild = child;
  194|  1.09M|  } else {
  195|  1.09M|    firstChild = lastChild = child;
  196|  1.09M|  }
  197|  1.31M|  child->parent = this;
  198|  1.31M|  child->next = NULL;
  199|  1.31M|}
_ZN5ZxDocC2Ev:
  203|  7.80k|ZxDoc::ZxDoc() {
  204|  7.80k|  xmlDecl = NULL;
  205|  7.80k|  docTypeDecl = NULL;
  206|  7.80k|  root = NULL;
  207|  7.80k|}
_ZN5ZxDoc7loadMemEPKcj:
  209|  3.90k|ZxDoc *ZxDoc::loadMem(const char *data, Guint dataLen) {
  210|  3.90k|  ZxDoc *doc;
  211|       |
  212|  3.90k|  doc = new ZxDoc();
  213|  3.90k|  if (!doc->parse(data, dataLen)) {
  ------------------
  |  Branch (213:7): [True: 1.33k, False: 2.56k]
  ------------------
  214|  1.33k|    delete doc;
  215|  1.33k|    return NULL;
  216|  1.33k|  }
  217|  2.56k|  return doc;
  218|  3.90k|}
_ZN5ZxDoc8addChildEP6ZxNode:
  266|  4.92k|void ZxDoc::addChild(ZxNode *node) {
  267|  4.92k|  if (node->isXMLDecl() && !xmlDecl) {
  ------------------
  |  Branch (267:7): [True: 829, False: 4.09k]
  |  Branch (267:28): [True: 829, False: 0]
  ------------------
  268|    829|    xmlDecl = (ZxXMLDecl *)node;
  269|  4.09k|  } else if (node->isDocTypeDecl() && !docTypeDecl) {
  ------------------
  |  Branch (269:14): [True: 253, False: 3.84k]
  |  Branch (269:39): [True: 253, False: 0]
  ------------------
  270|    253|    docTypeDecl = (ZxDocTypeDecl *)node;
  271|  3.84k|  } else if (node->isElement() && !root) {
  ------------------
  |  Branch (271:14): [True: 2.56k, False: 1.27k]
  |  Branch (271:35): [True: 2.56k, False: 0]
  ------------------
  272|  2.56k|    root = (ZxElement *)node;
  273|  2.56k|  }
  274|  4.92k|  ZxNode::addChild(node);
  275|  4.92k|}
_ZN5ZxDoc5parseEPKcj:
  277|  3.90k|bool ZxDoc::parse(const char *data, Guint dataLen) {
  278|  3.90k|  parsePtr = data;
  279|  3.90k|  parseEnd = data + dataLen;
  280|       |  
  281|  3.90k|  parseSpace();
  282|  3.90k|  parseXMLDecl(this);
  283|  3.90k|  parseMisc(this);
  284|  3.90k|  parseDocTypeDecl(this);
  285|  3.90k|  parseMisc(this);
  286|  3.90k|  if (match("<")) {
  ------------------
  |  Branch (286:7): [True: 2.56k, False: 1.33k]
  ------------------
  287|  2.56k|    parseElement(this);
  288|  2.56k|  }
  289|  3.90k|  parseMisc(this);
  290|  3.90k|  return root != NULL;
  291|  3.90k|}
_ZN5ZxDoc12parseXMLDeclEP6ZxNode:
  293|  3.90k|void ZxDoc::parseXMLDecl(ZxNode *par) {
  294|  3.90k|  GString *version, *encoding, *s;
  295|  3.90k|  bool standalone;
  296|       |
  297|  3.90k|  if (!match("<?xml")) {
  ------------------
  |  Branch (297:7): [True: 3.07k, False: 829]
  ------------------
  298|  3.07k|    return;
  299|  3.07k|  }
  300|    829|  parsePtr += 5;
  301|    829|  parseSpace();
  302|       |
  303|       |  // version
  304|    829|  version = NULL;
  305|    829|  if (match("version")) {
  ------------------
  |  Branch (305:7): [True: 180, False: 649]
  ------------------
  306|    180|    parsePtr += 7;
  307|    180|    parseSpace();
  308|    180|    if (match("=")) {
  ------------------
  |  Branch (308:9): [True: 119, False: 61]
  ------------------
  309|    119|      ++parsePtr;
  310|    119|      parseSpace();
  311|    119|      version = parseQuotedString();
  312|    119|    }
  313|    180|  }
  314|    829|  if (!version) {
  ------------------
  |  Branch (314:7): [True: 710, False: 119]
  ------------------
  315|    710|    version = new GString("1.0");
  316|    710|  }
  317|    829|  parseSpace();
  318|       |	
  319|       |  // encoding
  320|    829|  encoding = NULL;
  321|    829|  if (match("encoding")) {
  ------------------
  |  Branch (321:7): [True: 161, False: 668]
  ------------------
  322|    161|    parsePtr += 8;
  323|    161|    parseSpace();
  324|    161|    if (match("=")) {
  ------------------
  |  Branch (324:9): [True: 91, False: 70]
  ------------------
  325|     91|      ++parsePtr;
  326|     91|      parseSpace();
  327|     91|      encoding = parseQuotedString();
  328|     91|    }
  329|    161|  }
  330|    829|  parseSpace();
  331|       |
  332|       |  // standalone
  333|    829|  standalone = false;
  334|    829|  if (match("standalone")) {
  ------------------
  |  Branch (334:7): [True: 186, False: 643]
  ------------------
  335|    186|    parsePtr += 10;
  336|    186|    parseSpace();
  337|    186|    if (match("=")) {
  ------------------
  |  Branch (337:9): [True: 131, False: 55]
  ------------------
  338|    131|      ++parsePtr;
  339|    131|      parseSpace();
  340|    131|      s = parseQuotedString();
  341|    131|      standalone = !s->cmp("yes");
  342|    131|      delete s;
  343|    131|    }
  344|    186|  }
  345|    829|  parseSpace();
  346|       |
  347|    829|  if (match("?>")) {
  ------------------
  |  Branch (347:7): [True: 2, False: 827]
  ------------------
  348|      2|    parsePtr += 2;
  349|      2|  }
  350|       |
  351|    829|  par->addChild(new ZxXMLDecl(version, encoding, standalone));
  352|    829|}
_ZN5ZxDoc16parseDocTypeDeclEP6ZxNode:
  355|  3.90k|void ZxDoc::parseDocTypeDecl(ZxNode *par) {
  356|  3.90k|  GString *name;
  357|  3.90k|  int state;
  358|  3.90k|  char c, quote;
  359|       |
  360|  3.90k|  if (!match("<!DOCTYPE")) {
  ------------------
  |  Branch (360:7): [True: 3.65k, False: 253]
  ------------------
  361|  3.65k|    return;
  362|  3.65k|  }
  363|    253|  parsePtr += 9;
  364|    253|  parseSpace();
  365|       |
  366|    253|  name = parseName();
  367|    253|  parseSpace();
  368|       |
  369|    253|  state = 0;
  370|    253|  quote = '\0';
  371|  11.7k|  while (parsePtr < parseEnd && state < 4) {
  ------------------
  |  Branch (371:10): [True: 11.5k, False: 239]
  |  Branch (371:33): [True: 11.5k, False: 14]
  ------------------
  372|  11.5k|    c = *parsePtr++;
  373|  11.5k|    switch (state) {
  ------------------
  |  Branch (373:13): [True: 0, False: 11.5k]
  ------------------
  374|  8.71k|    case 0: // not in square brackets; not in quotes
  ------------------
  |  Branch (374:5): [True: 8.71k, False: 2.82k]
  ------------------
  375|  8.71k|      if (c == '>') {
  ------------------
  |  Branch (375:11): [True: 16, False: 8.70k]
  ------------------
  376|     16|	state = 4;
  377|  8.70k|      } else if (c == '"' || c == '\'') {
  ------------------
  |  Branch (377:18): [True: 254, False: 8.44k]
  |  Branch (377:30): [True: 348, False: 8.10k]
  ------------------
  378|    602|	state = 1;
  379|  8.10k|      } else if (c == '[') {
  ------------------
  |  Branch (379:18): [True: 324, False: 7.77k]
  ------------------
  380|    324|	state = 2;
  381|    324|      }
  382|  8.71k|      break;
  383|  1.25k|    case 1: // not in square brackets; in quotes
  ------------------
  |  Branch (383:5): [True: 1.25k, False: 10.2k]
  ------------------
  384|  1.25k|      if (c == quote) {
  ------------------
  |  Branch (384:11): [True: 570, False: 682]
  ------------------
  385|    570|	state = 0;
  386|    570|      }
  387|  1.25k|      break;
  388|    934|    case 2: // in square brackets; not in quotes
  ------------------
  |  Branch (388:5): [True: 934, False: 10.6k]
  ------------------
  389|    934|      if (c == ']') {
  ------------------
  |  Branch (389:11): [True: 255, False: 679]
  ------------------
  390|    255|	state = 0;
  391|    679|      } else if (c == '"' || c == '\'') {
  ------------------
  |  Branch (391:18): [True: 234, False: 445]
  |  Branch (391:30): [True: 234, False: 211]
  ------------------
  392|    468|	state = 3;
  393|    468|      }
  394|    934|      break;
  395|    639|    case 3: // in square brackets; in quotes
  ------------------
  |  Branch (395:5): [True: 639, False: 10.9k]
  ------------------
  396|    639|      if (c == quote) {
  ------------------
  |  Branch (396:11): [True: 439, False: 200]
  ------------------
  397|    439|	state = 2;
  398|    439|      }
  399|    639|      break;
  400|  11.5k|    }
  401|  11.5k|  }
  402|       |
  403|    253|  par->addChild(new ZxDocTypeDecl(name));
  404|    253|}
_ZN5ZxDoc12parseElementEP6ZxNode:
  407|  1.18M|void ZxDoc::parseElement(ZxNode *par) {
  408|  1.18M|  GString *type;
  409|  1.18M|  ZxElement *elem;
  410|  1.18M|  ZxAttr *attr;
  411|       |
  412|  1.18M|  ++parsePtr;
  413|  1.18M|  type = parseName();
  414|  1.18M|  elem = new ZxElement(type);
  415|  1.18M|  parseSpace();
  416|  2.04M|  while ((attr = parseAttr())) {
  ------------------
  |  Branch (416:10): [True: 851k, False: 1.18M]
  ------------------
  417|   851k|    elem->addAttr(attr);
  418|   851k|    parseSpace();
  419|   851k|  }
  420|  1.18M|  if (match("/>")) {
  ------------------
  |  Branch (420:7): [True: 1.24k, False: 1.18M]
  ------------------
  421|  1.24k|    parsePtr += 2;
  422|  1.18M|  } else if (match(">")) {
  ------------------
  |  Branch (422:14): [True: 1.09M, False: 89.9k]
  ------------------
  423|  1.09M|    ++parsePtr;
  424|  1.09M|    parseContent(elem);
  425|  1.09M|  }
  426|  1.18M|  par->addChild(elem);
  427|  1.18M|}
_ZN5ZxDoc9parseAttrEv:
  429|  2.04M|ZxAttr *ZxDoc::parseAttr() {
  430|  2.04M|  GString *name, *value;
  431|  2.04M|  const char *start;
  432|  2.04M|  char quote, c;
  433|  2.04M|  unsigned int x;
  434|  2.04M|  int n;
  435|       |
  436|  2.04M|  name = parseName();
  437|  2.04M|  parseSpace();
  438|  2.04M|  if (!match("=")) {
  ------------------
  |  Branch (438:7): [True: 1.18M, False: 857k]
  ------------------
  439|  1.18M|    delete name;
  440|  1.18M|    return NULL;
  441|  1.18M|  }
  442|   857k|  ++parsePtr;
  443|   857k|  parseSpace();
  444|   857k|  if (!(parsePtr < parseEnd && (*parsePtr == '"' || *parsePtr == '\''))) {
  ------------------
  |  Branch (444:9): [True: 857k, False: 37]
  |  Branch (444:33): [True: 802k, False: 55.1k]
  |  Branch (444:53): [True: 48.6k, False: 6.45k]
  ------------------
  445|  6.48k|    delete name;
  446|  6.48k|    return NULL;
  447|  6.48k|  }
  448|   851k|  quote = *parsePtr++;
  449|   851k|  value = new GString();
  450|   908k|  while (parsePtr < parseEnd && *parsePtr != quote) {
  ------------------
  |  Branch (450:10): [True: 907k, False: 564]
  |  Branch (450:33): [True: 56.8k, False: 850k]
  ------------------
  451|  56.8k|    if (*parsePtr == '&') {
  ------------------
  |  Branch (451:9): [True: 20.1k, False: 36.6k]
  ------------------
  452|  20.1k|      ++parsePtr;
  453|  20.1k|      if (parsePtr < parseEnd && *parsePtr == '#') {
  ------------------
  |  Branch (453:11): [True: 20.1k, False: 28]
  |  Branch (453:34): [True: 10.4k, False: 9.75k]
  ------------------
  454|  10.4k|	++parsePtr;
  455|  10.4k|	if (parsePtr < parseEnd && *parsePtr == 'x') {
  ------------------
  |  Branch (455:6): [True: 10.4k, False: 1]
  |  Branch (455:29): [True: 2.81k, False: 7.60k]
  ------------------
  456|  2.81k|	  ++parsePtr;
  457|  2.81k|	  x = 0;
  458|  5.96k|	  while (parsePtr < parseEnd) {
  ------------------
  |  Branch (458:11): [True: 5.92k, False: 35]
  ------------------
  459|  5.92k|	    c = *parsePtr;
  460|  5.92k|	    if (c >= '0' && c <= '9') {
  ------------------
  |  Branch (460:10): [True: 5.24k, False: 685]
  |  Branch (460:22): [True: 897, False: 4.34k]
  ------------------
  461|    897|	      x = (x << 4) + (c - '0');
  462|  5.03k|	    } else if (c >= 'a' && c <= 'f') {
  ------------------
  |  Branch (462:17): [True: 1.33k, False: 3.69k]
  |  Branch (462:29): [True: 912, False: 427]
  ------------------
  463|    912|	      x = (x << 4) + (10 + c - 'a');
  464|  4.12k|	    } else if (c >= 'A' && c <= 'F') {
  ------------------
  |  Branch (464:17): [True: 1.83k, False: 2.28k]
  |  Branch (464:29): [True: 1.34k, False: 492]
  ------------------
  465|  1.34k|	      x = (x << 4) + (10 + c - 'A');
  466|  2.78k|	    } else {
  467|  2.78k|	      break;
  468|  2.78k|	    }
  469|  3.14k|	    ++parsePtr;
  470|  3.14k|	  }
  471|  2.81k|	  if (parsePtr < parseEnd && *parsePtr == ';') {
  ------------------
  |  Branch (471:8): [True: 2.78k, False: 35]
  |  Branch (471:31): [True: 1.46k, False: 1.31k]
  ------------------
  472|  1.46k|	    ++parsePtr;
  473|  1.46k|	  }
  474|  2.81k|	  appendUTF8(value, x);
  475|  7.60k|	} else {
  476|  7.60k|	  x = 0;
  477|  35.3k|	  while (parsePtr < parseEnd) {
  ------------------
  |  Branch (477:11): [True: 35.3k, False: 13]
  ------------------
  478|  35.3k|	    c = *parsePtr;
  479|  35.3k|	    if (c >= '0' && c <= '9') {
  ------------------
  |  Branch (479:10): [True: 29.0k, False: 6.31k]
  |  Branch (479:22): [True: 27.7k, False: 1.27k]
  ------------------
  480|  27.7k|	      x = x * 10 + (c - '0');
  481|  27.7k|	    } else {
  482|  7.58k|	      break;
  483|  7.58k|	    }
  484|  27.7k|	    ++parsePtr;
  485|  27.7k|	  }
  486|  7.60k|	  if (parsePtr < parseEnd && *parsePtr == ';') {
  ------------------
  |  Branch (486:8): [True: 7.58k, False: 13]
  |  Branch (486:31): [True: 335, False: 7.25k]
  ------------------
  487|    335|	    ++parsePtr;
  488|    335|	  }
  489|  7.60k|	  appendUTF8(value, x);
  490|  7.60k|	}
  491|  10.4k|      } else {
  492|  9.78k|	start = parsePtr;
  493|  9.78k|	for (++parsePtr;
  494|  8.54M|	     parsePtr < parseEnd && *parsePtr != ';' &&
  ------------------
  |  Branch (494:7): [True: 8.54M, False: 264]
  |  Branch (494:30): [True: 8.54M, False: 542]
  ------------------
  495|  8.54M|	       *parsePtr != quote && *parsePtr != '&';
  ------------------
  |  Branch (495:9): [True: 8.54M, False: 1.68k]
  |  Branch (495:31): [True: 8.53M, False: 7.29k]
  ------------------
  496|  8.53M|	     ++parsePtr) ;
  497|  9.78k|	n = (int)(parsePtr - start);
  498|  9.78k|	if (parsePtr < parseEnd && *parsePtr == ';') {
  ------------------
  |  Branch (498:6): [True: 9.51k, False: 264]
  |  Branch (498:29): [True: 542, False: 8.97k]
  ------------------
  499|    542|	  ++parsePtr;
  500|    542|	}
  501|  9.78k|	if (n == 2 && !strncmp(start, "lt", 2)) {
  ------------------
  |  Branch (501:6): [True: 1.31k, False: 8.46k]
  |  Branch (501:16): [True: 392, False: 923]
  ------------------
  502|    392|	  value->append('<');
  503|  9.38k|	} else if (n == 2 && !strncmp(start, "gt", 2)) {
  ------------------
  |  Branch (503:13): [True: 923, False: 8.46k]
  |  Branch (503:23): [True: 335, False: 588]
  ------------------
  504|    335|	  value->append('>');
  505|  9.05k|	} else if (n == 3 && !strncmp(start, "amp", 3)) {
  ------------------
  |  Branch (505:13): [True: 1.18k, False: 7.87k]
  |  Branch (505:23): [True: 583, False: 598]
  ------------------
  506|    583|	  value->append('&');
  507|  8.47k|	} else if (n == 4 && !strncmp(start, "apos", 4)) {
  ------------------
  |  Branch (507:13): [True: 1.14k, False: 7.32k]
  |  Branch (507:23): [True: 309, False: 834]
  ------------------
  508|    309|	  value->append('\'');
  509|  8.16k|	} else if (n == 4 && !strncmp(start, "quot", 4)) {
  ------------------
  |  Branch (509:13): [True: 834, False: 7.32k]
  |  Branch (509:23): [True: 273, False: 561]
  ------------------
  510|    273|	  value->append('"');
  511|  7.88k|	} else {
  512|  7.88k|	  value->append(start - 1, (int)(parsePtr - start) + 1);
  513|  7.88k|	}
  514|  9.78k|      }
  515|  36.6k|    } else {
  516|  36.6k|      start = parsePtr;
  517|  36.6k|      for (++parsePtr;
  518|   462k|	   parsePtr < parseEnd && *parsePtr != quote && *parsePtr != '&';
  ------------------
  |  Branch (518:5): [True: 462k, False: 116]
  |  Branch (518:28): [True: 429k, False: 32.3k]
  |  Branch (518:50): [True: 425k, False: 4.17k]
  ------------------
  519|   425k|	   ++parsePtr) ;
  520|  36.6k|      value->append(start, (int)(parsePtr - start));
  521|  36.6k|    }
  522|  56.8k|  }
  523|   851k|  if (parsePtr < parseEnd && *parsePtr == quote) {
  ------------------
  |  Branch (523:7): [True: 850k, False: 564]
  |  Branch (523:30): [True: 850k, False: 0]
  ------------------
  524|   850k|    ++parsePtr;
  525|   850k|  }
  526|   851k|  return new ZxAttr(name, value);
  527|   857k|}
_ZN5ZxDoc12parseContentEP9ZxElement:
  530|  1.09M|void ZxDoc::parseContent(ZxElement *par) {
  531|  1.09M|  GString *endType;
  532|       |
  533|  1.09M|  endType = (new GString("</"))->append(par->getType());
  534|       |
  535|  2.40M|  while (parsePtr < parseEnd) {
  ------------------
  |  Branch (535:10): [True: 1.32M, False: 1.08M]
  ------------------
  536|  1.32M|    if (match(endType->getCString())) {
  ------------------
  |  Branch (536:9): [True: 13.8k, False: 1.30M]
  ------------------
  537|  13.8k|      parsePtr += endType->getLength();
  538|  13.8k|      parseSpace();
  539|  13.8k|      if (match(">")) {
  ------------------
  |  Branch (539:11): [True: 7.27k, False: 6.57k]
  ------------------
  540|  7.27k|	++parsePtr;
  541|  7.27k|      }
  542|  13.8k|      break;
  543|  1.30M|    } else if (match("<?")) {
  ------------------
  |  Branch (543:16): [True: 14.0k, False: 1.29M]
  ------------------
  544|  14.0k|      parsePI(par);
  545|  1.29M|    } else if (match("<![CDATA[")) {
  ------------------
  |  Branch (545:16): [True: 7.08k, False: 1.28M]
  ------------------
  546|  7.08k|      parseCDSect(par);
  547|  1.28M|    } else if (match("<!--")) {
  ------------------
  |  Branch (547:16): [True: 4.52k, False: 1.28M]
  ------------------
  548|  4.52k|      parseComment(par);
  549|  1.28M|    } else if (match("<")) {
  ------------------
  |  Branch (549:16): [True: 1.18M, False: 98.0k]
  ------------------
  550|  1.18M|      parseElement(par);
  551|  1.18M|    } else {
  552|  98.0k|      parseCharData(par);
  553|  98.0k|    }
  554|  1.32M|  }
  555|       |
  556|  1.09M|  delete endType;
  557|  1.09M|}
_ZN5ZxDoc13parseCharDataEP9ZxElement:
  559|  98.0k|void ZxDoc::parseCharData(ZxElement *par) {
  560|  98.0k|  GString *data;
  561|  98.0k|  const char *start;
  562|  98.0k|  char c;
  563|  98.0k|  unsigned int x;
  564|  98.0k|  int n;
  565|       |
  566|  98.0k|  data = new GString();
  567|   380k|  while (parsePtr < parseEnd && *parsePtr != '<') {
  ------------------
  |  Branch (567:10): [True: 378k, False: 1.06k]
  |  Branch (567:33): [True: 281k, False: 97.0k]
  ------------------
  568|   281k|    if (*parsePtr == '&') {
  ------------------
  |  Branch (568:9): [True: 151k, False: 129k]
  ------------------
  569|   151k|      ++parsePtr;
  570|   151k|      if (parsePtr < parseEnd && *parsePtr == '#') {
  ------------------
  |  Branch (570:11): [True: 151k, False: 59]
  |  Branch (570:34): [True: 89.6k, False: 62.1k]
  ------------------
  571|  89.6k|	++parsePtr;
  572|  89.6k|	if (parsePtr < parseEnd && *parsePtr == 'x') {
  ------------------
  |  Branch (572:6): [True: 89.6k, False: 8]
  |  Branch (572:29): [True: 29.7k, False: 59.9k]
  ------------------
  573|  29.7k|	  ++parsePtr;
  574|  29.7k|	  x = 0;
  575|   102k|	  while (parsePtr < parseEnd) {
  ------------------
  |  Branch (575:11): [True: 102k, False: 204]
  ------------------
  576|   102k|	    c = *parsePtr;
  577|   102k|	    if (c >= '0' && c <= '9') {
  ------------------
  |  Branch (577:10): [True: 97.0k, False: 5.67k]
  |  Branch (577:22): [True: 14.9k, False: 82.0k]
  ------------------
  578|  14.9k|	      x = (x << 4) + (c - '0');
  579|  87.7k|	    } else if (c >= 'a' && c <= 'f') {
  ------------------
  |  Branch (579:17): [True: 27.8k, False: 59.8k]
  |  Branch (579:29): [True: 25.8k, False: 2.08k]
  ------------------
  580|  25.8k|	      x = (x << 4) + (10 + c - 'a');
  581|  61.9k|	    } else if (c >= 'A' && c <= 'F') {
  ------------------
  |  Branch (581:17): [True: 34.7k, False: 27.1k]
  |  Branch (581:29): [True: 32.4k, False: 2.34k]
  ------------------
  582|  32.4k|	      x = (x << 4) + (10 + c - 'A');
  583|  32.4k|	    } else {
  584|  29.5k|	      break;
  585|  29.5k|	    }
  586|  73.2k|	    ++parsePtr;
  587|  73.2k|	  }
  588|  29.7k|	  if (parsePtr < parseEnd && *parsePtr == ';') {
  ------------------
  |  Branch (588:8): [True: 29.5k, False: 204]
  |  Branch (588:31): [True: 7.21k, False: 22.2k]
  ------------------
  589|  7.21k|	    ++parsePtr;
  590|  7.21k|	  }
  591|  29.7k|	  appendUTF8(data, x);
  592|  59.9k|	} else {
  593|  59.9k|	  x = 0;
  594|   113k|	  while (parsePtr < parseEnd) {
  ------------------
  |  Branch (594:11): [True: 113k, False: 85]
  ------------------
  595|   113k|	    c = *parsePtr;
  596|   113k|	    if (c >= '0' && c <= '9') {
  ------------------
  |  Branch (596:10): [True: 61.4k, False: 52.2k]
  |  Branch (596:22): [True: 53.8k, False: 7.64k]
  ------------------
  597|  53.8k|	      x = x * 10 + (c - '0');
  598|  59.8k|	    } else {
  599|  59.8k|	      break;
  600|  59.8k|	    }
  601|  53.8k|	    ++parsePtr;
  602|  53.8k|	  }
  603|  59.9k|	  if (parsePtr < parseEnd && *parsePtr == ';') {
  ------------------
  |  Branch (603:8): [True: 59.8k, False: 85]
  |  Branch (603:31): [True: 834, False: 59.0k]
  ------------------
  604|    834|	    ++parsePtr;
  605|    834|	  }
  606|  59.9k|	  appendUTF8(data, x);
  607|  59.9k|	}
  608|  89.6k|      } else {
  609|  62.2k|	start = parsePtr;
  610|  62.2k|	for (++parsePtr;
  611|  13.4M|	     parsePtr < parseEnd && *parsePtr != ';' &&
  ------------------
  |  Branch (611:7): [True: 13.4M, False: 343]
  |  Branch (611:30): [True: 13.4M, False: 3.46k]
  ------------------
  612|  13.4M|	       *parsePtr != '<' && *parsePtr != '&';
  ------------------
  |  Branch (612:9): [True: 13.4M, False: 13.8k]
  |  Branch (612:29): [True: 13.4M, False: 44.5k]
  ------------------
  613|  13.4M|	     ++parsePtr) ;
  614|  62.2k|	n = (int)(parsePtr - start);
  615|  62.2k|	if (parsePtr < parseEnd && *parsePtr == ';') {
  ------------------
  |  Branch (615:6): [True: 61.9k, False: 343]
  |  Branch (615:29): [True: 3.46k, False: 58.4k]
  ------------------
  616|  3.46k|	  ++parsePtr;
  617|  3.46k|	}
  618|  62.2k|	if (n == 2 && !strncmp(start, "lt", 2)) {
  ------------------
  |  Branch (618:6): [True: 24.2k, False: 38.0k]
  |  Branch (618:16): [True: 5.68k, False: 18.5k]
  ------------------
  619|  5.68k|	  data->append('<');
  620|  56.5k|	} else if (n == 2 && !strncmp(start, "gt", 2)) {
  ------------------
  |  Branch (620:13): [True: 18.5k, False: 38.0k]
  |  Branch (620:23): [True: 906, False: 17.6k]
  ------------------
  621|    906|	  data->append('>');
  622|  55.6k|	} else if (n == 3 && !strncmp(start, "amp", 3)) {
  ------------------
  |  Branch (622:13): [True: 4.56k, False: 51.0k]
  |  Branch (622:23): [True: 2.02k, False: 2.53k]
  ------------------
  623|  2.02k|	  data->append('&');
  624|  53.6k|	} else if (n == 4 && !strncmp(start, "apos", 4)) {
  ------------------
  |  Branch (624:13): [True: 4.87k, False: 48.7k]
  |  Branch (624:23): [True: 622, False: 4.25k]
  ------------------
  625|    622|	  data->append('\'');
  626|  53.0k|	} else if (n == 4 && !strncmp(start, "quot", 4)) {
  ------------------
  |  Branch (626:13): [True: 4.25k, False: 48.7k]
  |  Branch (626:23): [True: 283, False: 3.96k]
  ------------------
  627|    283|	  data->append('"');
  628|  52.7k|	} else {
  629|  52.7k|	  data->append(start - 1, (int)(parsePtr - start) + 1);
  630|  52.7k|	}
  631|  62.2k|      }
  632|   151k|    } else {
  633|   129k|      start = parsePtr;
  634|   129k|      for (++parsePtr;
  635|  9.22M|	   parsePtr < parseEnd && *parsePtr != '<' && *parsePtr != '&';
  ------------------
  |  Branch (635:5): [True: 9.22M, False: 405]
  |  Branch (635:28): [True: 9.15M, False: 68.9k]
  |  Branch (635:48): [True: 9.09M, False: 60.6k]
  ------------------
  636|  9.09M|	   ++parsePtr) ;
  637|   129k|      data->append(start, (int)(parsePtr - start));
  638|   129k|    }
  639|   281k|  }
  640|  98.0k|  par->addChild(new ZxCharData(data, true));
  641|  98.0k|}
_ZN5ZxDoc10appendUTF8EP7GStringj:
  643|   100k|void ZxDoc::appendUTF8(GString *s, unsigned int c) {
  644|   100k|  if (c <= 0x7f) {
  ------------------
  |  Branch (644:7): [True: 78.7k, False: 21.3k]
  ------------------
  645|  78.7k|    s->append((char)c);
  646|  78.7k|  } else if (c <= 0x7ff) {
  ------------------
  |  Branch (646:14): [True: 1.60k, False: 19.7k]
  ------------------
  647|  1.60k|    s->append((char)(0xc0 + (c >> 6)));
  648|  1.60k|    s->append((char)(0x80 + (c & 0x3f)));
  649|  19.7k|  } else if (c <= 0xffff) {
  ------------------
  |  Branch (649:14): [True: 7.87k, False: 11.8k]
  ------------------
  650|  7.87k|    s->append((char)(0xe0 + (c >> 12)));
  651|  7.87k|    s->append((char)(0x80 + ((c >> 6) & 0x3f)));
  652|  7.87k|    s->append((char)(0x80 + (c & 0x3f)));
  653|  11.8k|  } else if (c <= 0x1fffff) {
  ------------------
  |  Branch (653:14): [True: 5.68k, False: 6.14k]
  ------------------
  654|  5.68k|    s->append((char)(0xf0 + (c >> 18)));
  655|  5.68k|    s->append((char)(0x80 + ((c >> 12) & 0x3f)));
  656|  5.68k|    s->append((char)(0x80 + ((c >> 6) & 0x3f)));
  657|  5.68k|    s->append((char)(0x80 + (c & 0x3f)));
  658|  6.14k|  } else if (c <= 0x3ffffff) {
  ------------------
  |  Branch (658:14): [True: 1.40k, False: 4.74k]
  ------------------
  659|  1.40k|    s->append((char)(0xf8 + (c >> 24)));
  660|  1.40k|    s->append((char)(0x80 + ((c >> 18) & 0x3f)));
  661|  1.40k|    s->append((char)(0x80 + ((c >> 12) & 0x3f)));
  662|  1.40k|    s->append((char)(0x80 + ((c >> 6) & 0x3f)));
  663|  1.40k|    s->append((char)(0x80 + (c & 0x3f)));
  664|  4.74k|  } else if (c <= 0x7fffffff) {
  ------------------
  |  Branch (664:14): [True: 1.77k, False: 2.96k]
  ------------------
  665|  1.77k|    s->append((char)(0xfc + (c >> 30)));
  666|  1.77k|    s->append((char)(0x80 + ((c >> 24) & 0x3f)));
  667|  1.77k|    s->append((char)(0x80 + ((c >> 18) & 0x3f)));
  668|  1.77k|    s->append((char)(0x80 + ((c >> 12) & 0x3f)));
  669|  1.77k|    s->append((char)(0x80 + ((c >> 6) & 0x3f)));
  670|  1.77k|    s->append((char)(0x80 + (c & 0x3f)));
  671|  1.77k|  }
  672|   100k|}
_ZN5ZxDoc11parseCDSectEP6ZxNode:
  675|  7.08k|void ZxDoc::parseCDSect(ZxNode *par) {
  676|  7.08k|  const char *start;
  677|       |
  678|  7.08k|  parsePtr += 9;
  679|  7.08k|  start = parsePtr;
  680|  33.3k|  while (parsePtr < parseEnd - 3) {
  ------------------
  |  Branch (680:10): [True: 33.3k, False: 43]
  ------------------
  681|  33.3k|    if (!strncmp(parsePtr, "]]>", 3)) {
  ------------------
  |  Branch (681:9): [True: 7.04k, False: 26.3k]
  ------------------
  682|  7.04k|      par->addChild(new ZxCharData(new GString(start, (int)(parsePtr - start)),
  683|  7.04k|				   false));
  684|  7.04k|      parsePtr += 3;
  685|  7.04k|      return;
  686|  7.04k|    }
  687|  26.3k|    ++parsePtr;
  688|  26.3k|  }
  689|     43|  parsePtr = parseEnd;
  690|     43|  par->addChild(new ZxCharData(new GString(start, (int)(parsePtr - start)),
  691|     43|			       false));
  692|     43|}
_ZN5ZxDoc9parseMiscEP6ZxNode:
  694|  11.7k|void ZxDoc::parseMisc(ZxNode *par) {
  695|  15.0k|  while (1) {
  ------------------
  |  Branch (695:10): [Folded - Ignored]
  ------------------
  696|  15.0k|    if (match("<!--")) {
  ------------------
  |  Branch (696:9): [True: 298, False: 14.7k]
  ------------------
  697|    298|      parseComment(par);
  698|  14.7k|    } else if (match("<?")) {
  ------------------
  |  Branch (698:16): [True: 1.02k, False: 13.6k]
  ------------------
  699|  1.02k|      parsePI(par);
  700|  13.6k|    } else if (parsePtr < parseEnd && (*parsePtr == '\x20' ||
  ------------------
  |  Branch (700:16): [True: 9.06k, False: 4.63k]
  |  Branch (700:40): [True: 544, False: 8.51k]
  ------------------
  701|  9.06k|				       *parsePtr == '\x09' ||
  ------------------
  |  Branch (701:12): [True: 446, False: 8.07k]
  ------------------
  702|  9.06k|				       *parsePtr == '\x0d' ||
  ------------------
  |  Branch (702:12): [True: 603, False: 7.47k]
  ------------------
  703|  9.06k|				       *parsePtr == '\x0a')) {
  ------------------
  |  Branch (703:12): [True: 388, False: 7.08k]
  ------------------
  704|  1.98k|      ++parsePtr;
  705|  11.7k|    } else {
  706|  11.7k|      break;
  707|  11.7k|    }
  708|  15.0k|  }
  709|  11.7k|}
_ZN5ZxDoc12parseCommentEP6ZxNode:
  712|  4.81k|void ZxDoc::parseComment(ZxNode *par) {
  713|  4.81k|  const char *start;
  714|       |
  715|  4.81k|  parsePtr += 4;
  716|  4.81k|  start = parsePtr;
  717|  72.8k|  while (parsePtr <= parseEnd - 3) {
  ------------------
  |  Branch (717:10): [True: 72.8k, False: 53]
  ------------------
  718|  72.8k|    if (!strncmp(parsePtr, "-->", 3)) {
  ------------------
  |  Branch (718:9): [True: 4.76k, False: 68.0k]
  ------------------
  719|  4.76k|      par->addChild(new ZxComment(new GString(start, (int)(parsePtr - start))));
  720|  4.76k|      parsePtr += 3;
  721|  4.76k|      return;
  722|  4.76k|    }
  723|  68.0k|    ++parsePtr;
  724|  68.0k|  }
  725|     53|  parsePtr = parseEnd;
  726|     53|}
_ZN5ZxDoc7parsePIEP6ZxNode:
  729|  15.0k|void ZxDoc::parsePI(ZxNode *par) {
  730|  15.0k|  GString *target;
  731|  15.0k|  const char *start;
  732|       |
  733|  15.0k|  parsePtr += 2;
  734|  15.0k|  target = parseName();
  735|  15.0k|  parseSpace();
  736|  15.0k|  start = parsePtr;
  737|  5.96M|  while (parsePtr <= parseEnd - 2) {
  ------------------
  |  Branch (737:10): [True: 5.96M, False: 206]
  ------------------
  738|  5.96M|    if (!strncmp(parsePtr, "?>", 2)) {
  ------------------
  |  Branch (738:9): [True: 14.8k, False: 5.94M]
  ------------------
  739|  14.8k|      par->addChild(new ZxPI(target, new GString(start,
  740|  14.8k|						 (int)(parsePtr - start))));
  741|  14.8k|      parsePtr += 2;
  742|  14.8k|      return;
  743|  14.8k|    }
  744|  5.94M|    ++parsePtr;
  745|  5.94M|  }
  746|    206|  parsePtr = parseEnd;
  747|    206|  par->addChild(new ZxPI(target, new GString(start, (int)(parsePtr - start))));
  748|    206|}
_ZN5ZxDoc9parseNameEv:
  752|  3.24M|GString *ZxDoc::parseName() {
  753|  3.24M|  GString *name;
  754|       |
  755|  3.24M|  name = new GString();
  756|  3.24M|  if (parsePtr < parseEnd && nameStartChar[*parsePtr & 0xff]) {
  ------------------
  |  Branch (756:7): [True: 3.24M, False: 1.14k]
  |  Branch (756:30): [True: 48.1k, False: 3.19M]
  ------------------
  757|  48.1k|    name->append(*parsePtr++);
  758|  10.9M|    while (parsePtr < parseEnd && nameChar[*parsePtr & 0xff]) {
  ------------------
  |  Branch (758:12): [True: 10.9M, False: 116]
  |  Branch (758:35): [True: 10.9M, False: 48.0k]
  ------------------
  759|  10.9M|      name->append(*parsePtr++);
  760|  10.9M|    }
  761|  48.1k|  }
  762|  3.24M|  return name;
  763|  3.24M|}
_ZN5ZxDoc17parseQuotedStringEv:
  765|    341|GString *ZxDoc::parseQuotedString() {
  766|    341|  GString *s;
  767|    341|  const char *start;
  768|    341|  char quote;
  769|       |
  770|    341|  if (parsePtr < parseEnd && (*parsePtr == '"' || *parsePtr == '\'')) {
  ------------------
  |  Branch (770:7): [True: 248, False: 93]
  |  Branch (770:31): [True: 104, False: 144]
  |  Branch (770:51): [True: 79, False: 65]
  ------------------
  771|    183|    quote = *parsePtr++;
  772|    183|    start = parsePtr;
  773|  3.69M|    while (parsePtr < parseEnd && *parsePtr != quote) {
  ------------------
  |  Branch (773:12): [True: 3.69M, False: 64]
  |  Branch (773:35): [True: 3.69M, False: 119]
  ------------------
  774|  3.69M|      ++parsePtr;
  775|  3.69M|    }
  776|    183|    s = new GString(start, (int)(parsePtr - start));
  777|    183|    if (parsePtr < parseEnd && *parsePtr == quote) {
  ------------------
  |  Branch (777:9): [True: 119, False: 64]
  |  Branch (777:32): [True: 119, False: 0]
  ------------------
  778|    119|      ++parsePtr;
  779|    119|    }
  780|    183|  } else {
  781|    158|    s = new GString();
  782|    158|  }
  783|    341|  return s;
  784|    341|}
_ZN5ZxDoc10parseSpaceEv:
  786|  4.97M|void ZxDoc::parseSpace() {
  787|  5.03M|  while (parsePtr < parseEnd && (*parsePtr == '\x20' ||
  ------------------
  |  Branch (787:10): [True: 5.02M, False: 3.09k]
  |  Branch (787:34): [True: 16.9k, False: 5.01M]
  ------------------
  788|  5.02M|				 *parsePtr == '\x09' ||
  ------------------
  |  Branch (788:6): [True: 11.4k, False: 5.00M]
  ------------------
  789|  5.02M|				 *parsePtr == '\x0d' ||
  ------------------
  |  Branch (789:6): [True: 16.7k, False: 4.98M]
  ------------------
  790|  5.02M|				 *parsePtr == '\x0a')) {
  ------------------
  |  Branch (790:6): [True: 11.2k, False: 4.97M]
  ------------------
  791|  56.4k|    ++parsePtr;
  792|  56.4k|  }
  793|  4.97M|}
_ZN5ZxDoc5matchEPKc:
  795|  10.9M|bool ZxDoc::match(const char *s) {
  796|  10.9M|  int n;
  797|       |
  798|  10.9M|  n = (int)strlen(s);
  799|  10.9M|  return parseEnd - parsePtr >= n && !strncmp(parsePtr, s, n);
  ------------------
  |  Branch (799:10): [True: 10.9M, False: 21.8k]
  |  Branch (799:38): [True: 3.19M, False: 7.76M]
  ------------------
  800|  10.9M|}
_ZN9ZxXMLDeclC2EP7GStringS1_b:
  818|    829|ZxXMLDecl::ZxXMLDecl(GString *versionA, GString *encodingA, bool standaloneA) {
  819|    829|  version = versionA;
  820|    829|  encoding = encodingA;
  821|    829|  standalone = standaloneA;
  822|    829|}
_ZN9ZxXMLDeclD2Ev:
  824|    829|ZxXMLDecl::~ZxXMLDecl() {
  825|    829|  delete version;
  826|    829|  if (encoding) {
  ------------------
  |  Branch (826:7): [True: 91, False: 738]
  ------------------
  827|     91|    delete encoding;
  828|     91|  }
  829|    829|}
_ZN13ZxDocTypeDeclC2EP7GString:
  854|    253|ZxDocTypeDecl::ZxDocTypeDecl(GString *nameA) {
  855|    253|  name = nameA;
  856|    253|}
_ZN13ZxDocTypeDeclD2Ev:
  858|    253|ZxDocTypeDecl::~ZxDocTypeDecl() {
  859|    253|  delete name;
  860|    253|}
_ZN9ZxCommentC2EP7GString:
  876|  4.76k|ZxComment::ZxComment(GString *textA) {
  877|  4.76k|  text = textA;
  878|  4.76k|}
_ZN9ZxCommentD2Ev:
  880|  4.76k|ZxComment::~ZxComment() {
  881|  4.76k|  delete text;
  882|  4.76k|}
_ZN4ZxPIC2EP7GStringS1_:
  898|  15.0k|ZxPI::ZxPI(GString *targetA, GString *textA) {
  899|  15.0k|  target = targetA;
  900|  15.0k|  text = textA;
  901|  15.0k|}
_ZN4ZxPID2Ev:
  903|  15.0k|ZxPI::~ZxPI() {
  904|  15.0k|  delete target;
  905|  15.0k|  delete text;
  906|  15.0k|}
_ZN9ZxElementC2EP7GString:
  924|  1.18M|ZxElement::ZxElement(GString *typeA) {
  925|  1.18M|  type = typeA;
  926|  1.18M|  attrs = new GHash();
  927|  1.18M|  firstAttr = lastAttr = NULL;
  928|  1.18M|}
_ZN9ZxElementD2Ev:
  930|  1.18M|ZxElement::~ZxElement() {
  931|  1.18M|  delete type;
  932|  1.18M|  deleteGHash(attrs, ZxAttr);
  ------------------
  |  |   64|  1.18M|  do {                                             \
  |  |   65|  1.18M|    GHash *_hash = (hash);                         \
  |  |   66|  1.18M|    {                                              \
  |  |   67|  1.18M|      GHashIter *_iter;                            \
  |  |   68|  1.18M|      GString *_key;                               \
  |  |   69|  1.18M|      void *_p;                                    \
  |  |   70|  1.18M|      _hash->startIter(&_iter);                    \
  |  |   71|  2.04M|      while (_hash->getNext(&_iter, &_key, &_p)) { \
  |  |  ------------------
  |  |  |  Branch (71:14): [True: 851k, False: 1.18M]
  |  |  ------------------
  |  |   72|   851k|        delete (T*)_p;                             \
  |  |   73|   851k|      }                                            \
  |  |   74|  1.18M|      delete _hash;                                \
  |  |   75|  1.18M|    }                                              \
  |  |   76|  1.18M|  } while(0)
  |  |  ------------------
  |  |  |  Branch (76:11): [Folded - Ignored]
  |  |  ------------------
  ------------------
  933|  1.18M|}
_ZN9ZxElement7addAttrEP6ZxAttr:
  943|   851k|void ZxElement::addAttr(ZxAttr *attr) {
  944|   851k|  attrs->add(attr->getName(), attr);
  945|   851k|  if (lastAttr) {
  ------------------
  |  Branch (945:7): [True: 836k, False: 15.2k]
  ------------------
  946|   836k|    lastAttr->next = attr;
  947|   836k|    lastAttr= attr;
  948|   836k|  } else {
  949|  15.2k|    firstAttr = lastAttr = attr;
  950|  15.2k|  }
  951|   851k|  attr->parent = this;
  952|   851k|  attr->next = NULL;
  953|   851k|}
_ZN6ZxAttrC2EP7GStringS1_:
 1021|   851k|ZxAttr::ZxAttr(GString *nameA, GString *valueA) {
 1022|   851k|  name = nameA;
 1023|   851k|  value = valueA;
 1024|   851k|  parent = NULL;
 1025|   851k|  next = NULL;
 1026|   851k|}
_ZN6ZxAttrD2Ev:
 1028|   851k|ZxAttr::~ZxAttr() {
 1029|   851k|  delete name;
 1030|   851k|  delete value;
 1031|   851k|}
_ZN10ZxCharDataC2EP7GStringb:
 1035|   105k|ZxCharData::ZxCharData(GString *dataA, bool parsedA) {
 1036|   105k|  data = dataA;
 1037|   105k|  parsed = parsedA;
 1038|   105k|}
_ZN10ZxCharDataD2Ev:
 1040|   105k|ZxCharData::~ZxCharData() {
 1041|   105k|  delete data;
 1042|   105k|}

_ZN6ZxNode9isXMLDeclEv:
   40|  4.09k|  virtual bool isXMLDecl()  { return false; }
_ZN6ZxNode13isDocTypeDeclEv:
   41|  3.84k|  virtual bool isDocTypeDecl() { return false; }
_ZN6ZxNode9isElementEv:
   44|  1.27k|  virtual bool isElement() { return false; }
_ZN9ZxXMLDecl9isXMLDeclEv:
  132|    829|  virtual bool isXMLDecl() { return true; }
_ZN13ZxDocTypeDecl13isDocTypeDeclEv:
  154|    253|  virtual bool isDocTypeDecl() { return true; }
_ZN9ZxElement9isElementEv:
  210|  2.56k|  virtual bool isElement() { return true; }
_ZN9ZxElement7getTypeEv:
  212|  1.09M|  GString *getType() { return type; }
_ZN6ZxAttr7getNameEv:
  236|   851k|  GString *getName() { return name; }

