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

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

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

_ZN7GString10getCStringEv:
   79|  5.07M|  char *getCString() { return s; }
_ZN7GString9getLengthEv:
   76|  4.00M|  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.50M|ZxNode::ZxNode() {
   65|  1.50M|  next = NULL;
   66|  1.50M|  parent = NULL;
   67|       |  firstChild = lastChild = NULL;
   68|  1.50M|}
_ZN6ZxNodeD2Ev:
   70|  1.50M|ZxNode::~ZxNode() {
   71|  1.50M|  ZxNode *child;
   72|       |
   73|  2.99M|  while (firstChild) {
  ------------------
  |  Branch (73:10): [True: 1.49M, False: 1.50M]
  ------------------
   74|  1.49M|    child = firstChild;
   75|  1.49M|    firstChild = firstChild->next;
   76|  1.49M|    delete child;
   77|  1.49M|  }
   78|  1.50M|}
_ZN6ZxNode8addChildEPS_:
  186|  1.49M|void ZxNode::addChild(ZxNode *child) {
  187|  1.49M|  if (lastChild) {
  ------------------
  |  Branch (187:7): [True: 288k, False: 1.20M]
  ------------------
  188|   288k|    lastChild->next = child;
  189|   288k|    lastChild = child;
  190|  1.20M|  } else {
  191|  1.20M|    firstChild = lastChild = child;
  192|  1.20M|  }
  193|  1.49M|  child->parent = this;
  194|       |  child->next = NULL;
  195|  1.49M|}
_ZN5ZxDocC2Ev:
  199|  7.56k|ZxDoc::ZxDoc() {
  200|  7.56k|  xmlDecl = NULL;
  201|  7.56k|  docTypeDecl = NULL;
  202|       |  root = NULL;
  203|  7.56k|}
_ZN5ZxDoc7loadMemEPKcj:
  205|  3.78k|ZxDoc *ZxDoc::loadMem(const char *data, Guint dataLen) {
  206|  3.78k|  ZxDoc *doc;
  207|       |
  208|  3.78k|  doc = new ZxDoc();
  209|  3.78k|  if (!doc->parse(data, dataLen)) {
  ------------------
  |  Branch (209:7): [True: 1.32k, False: 2.46k]
  ------------------
  210|  1.32k|    delete doc;
  211|  1.32k|    return NULL;
  212|  1.32k|  }
  213|  2.46k|  return doc;
  214|  3.78k|}
_ZN5ZxDoc8addChildEP6ZxNode:
  262|  5.00k|void ZxDoc::addChild(ZxNode *node) {
  263|  5.00k|  if (node->isXMLDecl() && !xmlDecl) {
  ------------------
  |  Branch (263:7): [True: 791, False: 4.21k]
  |  Branch (263:28): [True: 791, False: 0]
  ------------------
  264|    791|    xmlDecl = (ZxXMLDecl *)node;
  265|  4.21k|  } else if (node->isDocTypeDecl() && !docTypeDecl) {
  ------------------
  |  Branch (265:14): [True: 251, False: 3.96k]
  |  Branch (265:39): [True: 251, False: 0]
  ------------------
  266|    251|    docTypeDecl = (ZxDocTypeDecl *)node;
  267|  3.96k|  } else if (node->isElement() && !root) {
  ------------------
  |  Branch (267:14): [True: 2.46k, False: 1.50k]
  |  Branch (267:35): [True: 2.46k, False: 0]
  ------------------
  268|  2.46k|    root = (ZxElement *)node;
  269|  2.46k|  }
  270|  5.00k|  ZxNode::addChild(node);
  271|  5.00k|}
_ZN5ZxDoc5parseEPKcj:
  273|  3.78k|bool ZxDoc::parse(const char *data, Guint dataLen) {
  274|  3.78k|  parsePtr = data;
  275|  3.78k|  parseEnd = data + dataLen;
  276|       |  
  277|  3.78k|  parseSpace();
  278|  3.78k|  parseBOM();
  279|  3.78k|  parseSpace();
  280|  3.78k|  parseXMLDecl(this);
  281|  3.78k|  parseMisc(this);
  282|  3.78k|  parseDocTypeDecl(this);
  283|  3.78k|  parseMisc(this);
  284|  3.78k|  if (match("<")) {
  ------------------
  |  Branch (284:7): [True: 2.46k, False: 1.32k]
  ------------------
  285|  2.46k|    parseElement(this);
  286|  2.46k|  }
  287|  3.78k|  parseMisc(this);
  288|       |  return root != NULL;
  289|  3.78k|}
_ZN5ZxDoc12parseXMLDeclEP6ZxNode:
  291|  3.78k|void ZxDoc::parseXMLDecl(ZxNode *par) {
  292|  3.78k|  GString *version, *encoding, *s;
  293|  3.78k|  bool standalone;
  294|       |
  295|  3.78k|  if (!match("<?xml")) {
  ------------------
  |  Branch (295:7): [True: 2.99k, False: 791]
  ------------------
  296|  2.99k|    return;
  297|  2.99k|  }
  298|    791|  parsePtr += 5;
  299|    791|  parseSpace();
  300|       |
  301|       |  // version
  302|    791|  version = NULL;
  303|    791|  if (match("version")) {
  ------------------
  |  Branch (303:7): [True: 193, False: 598]
  ------------------
  304|    193|    parsePtr += 7;
  305|    193|    parseSpace();
  306|    193|    if (match("=")) {
  ------------------
  |  Branch (306:9): [True: 130, False: 63]
  ------------------
  307|    130|      ++parsePtr;
  308|    130|      parseSpace();
  309|    130|      version = parseQuotedString();
  310|    130|    }
  311|    193|  }
  312|    791|  if (!version) {
  ------------------
  |  Branch (312:7): [True: 661, False: 130]
  ------------------
  313|    661|    version = new GString("1.0");
  314|    661|  }
  315|    791|  parseSpace();
  316|       |	
  317|       |  // encoding
  318|    791|  encoding = NULL;
  319|    791|  if (match("encoding")) {
  ------------------
  |  Branch (319:7): [True: 181, False: 610]
  ------------------
  320|    181|    parsePtr += 8;
  321|    181|    parseSpace();
  322|    181|    if (match("=")) {
  ------------------
  |  Branch (322:9): [True: 114, False: 67]
  ------------------
  323|    114|      ++parsePtr;
  324|    114|      parseSpace();
  325|    114|      encoding = parseQuotedString();
  326|    114|    }
  327|    181|  }
  328|    791|  parseSpace();
  329|       |
  330|       |  // standalone
  331|    791|  standalone = false;
  332|    791|  if (match("standalone")) {
  ------------------
  |  Branch (332:7): [True: 198, False: 593]
  ------------------
  333|    198|    parsePtr += 10;
  334|    198|    parseSpace();
  335|    198|    if (match("=")) {
  ------------------
  |  Branch (335:9): [True: 130, False: 68]
  ------------------
  336|    130|      ++parsePtr;
  337|    130|      parseSpace();
  338|    130|      s = parseQuotedString();
  339|    130|      standalone = !s->cmp("yes");
  340|    130|      delete s;
  341|    130|    }
  342|    198|  }
  343|    791|  parseSpace();
  344|       |
  345|    791|  if (match("?>")) {
  ------------------
  |  Branch (345:7): [True: 4, False: 787]
  ------------------
  346|      4|    parsePtr += 2;
  347|      4|  }
  348|       |
  349|    791|  par->addChild(new ZxXMLDecl(version, encoding, standalone));
  350|    791|}
_ZN5ZxDoc16parseDocTypeDeclEP6ZxNode:
  353|  3.78k|void ZxDoc::parseDocTypeDecl(ZxNode *par) {
  354|  3.78k|  GString *name;
  355|  3.78k|  int state;
  356|  3.78k|  char c, quote;
  357|       |
  358|  3.78k|  if (!match("<!DOCTYPE")) {
  ------------------
  |  Branch (358:7): [True: 3.53k, False: 251]
  ------------------
  359|  3.53k|    return;
  360|  3.53k|  }
  361|    251|  parsePtr += 9;
  362|    251|  parseSpace();
  363|       |
  364|    251|  name = parseName();
  365|    251|  parseSpace();
  366|       |
  367|    251|  state = 0;
  368|    251|  quote = '\0';
  369|  13.6k|  while (parsePtr < parseEnd && state < 4) {
  ------------------
  |  Branch (369:10): [True: 13.3k, False: 247]
  |  Branch (369:33): [True: 13.3k, False: 4]
  ------------------
  370|  13.3k|    c = *parsePtr++;
  371|  13.3k|    switch (state) {
  ------------------
  |  Branch (371:13): [True: 13.3k, False: 0]
  ------------------
  372|  6.80k|    case 0: // not in square brackets; not in quotes
  ------------------
  |  Branch (372:5): [True: 6.80k, False: 6.55k]
  ------------------
  373|  6.80k|      if (c == '>') {
  ------------------
  |  Branch (373:11): [True: 5, False: 6.79k]
  ------------------
  374|      5|	state = 4;
  375|  6.79k|      } else if (c == '"' || c == '\'') {
  ------------------
  |  Branch (375:18): [True: 251, False: 6.54k]
  |  Branch (375:30): [True: 352, False: 6.19k]
  ------------------
  376|    603|	state = 1;
  377|  6.19k|      } else if (c == '[') {
  ------------------
  |  Branch (377:18): [True: 442, False: 5.75k]
  ------------------
  378|    442|	state = 2;
  379|    442|      }
  380|  6.80k|      break;
  381|  1.43k|    case 1: // not in square brackets; in quotes
  ------------------
  |  Branch (381:5): [True: 1.43k, False: 11.9k]
  ------------------
  382|  1.43k|      if (c == quote) {
  ------------------
  |  Branch (382:11): [True: 570, False: 865]
  ------------------
  383|    570|	state = 0;
  384|    570|      }
  385|  1.43k|      break;
  386|  2.39k|    case 2: // in square brackets; not in quotes
  ------------------
  |  Branch (386:5): [True: 2.39k, False: 10.9k]
  ------------------
  387|  2.39k|      if (c == ']') {
  ------------------
  |  Branch (387:11): [True: 368, False: 2.03k]
  ------------------
  388|    368|	state = 0;
  389|  2.03k|      } else if (c == '"' || c == '\'') {
  ------------------
  |  Branch (389:18): [True: 249, False: 1.78k]
  |  Branch (389:30): [True: 378, False: 1.40k]
  ------------------
  390|    627|	state = 3;
  391|    627|      }
  392|  2.39k|      break;
  393|  2.71k|    case 3: // in square brackets; in quotes
  ------------------
  |  Branch (393:5): [True: 2.71k, False: 10.6k]
  ------------------
  394|  2.71k|      if (c == quote) {
  ------------------
  |  Branch (394:11): [True: 595, False: 2.12k]
  ------------------
  395|    595|	state = 2;
  396|    595|      }
  397|  2.71k|      break;
  398|  13.3k|    }
  399|  13.3k|  }
  400|       |
  401|    251|  par->addChild(new ZxDocTypeDecl(name));
  402|    251|}
_ZN5ZxDoc12parseElementEP6ZxNode:
  405|  1.33M|void ZxDoc::parseElement(ZxNode *par) {
  406|  1.33M|  GString *type;
  407|  1.33M|  ZxElement *elem;
  408|  1.33M|  ZxAttr *attr;
  409|       |
  410|  1.33M|  ++parsePtr;
  411|  1.33M|  type = parseName();
  412|  1.33M|  elem = new ZxElement(type);
  413|  1.33M|  parseSpace();
  414|  2.24M|  while ((attr = parseAttr())) {
  ------------------
  |  Branch (414:10): [True: 908k, False: 1.33M]
  ------------------
  415|   908k|    elem->addAttr(attr);
  416|   908k|    parseSpace();
  417|   908k|  }
  418|  1.33M|  if (match("/>")) {
  ------------------
  |  Branch (418:7): [True: 35.3k, False: 1.29M]
  ------------------
  419|  35.3k|    parsePtr += 2;
  420|  1.29M|  } else if (match(">")) {
  ------------------
  |  Branch (420:14): [True: 1.20M, False: 90.4k]
  ------------------
  421|  1.20M|    ++parsePtr;
  422|  1.20M|    parseContent(elem);
  423|  1.20M|  }
  424|  1.33M|  par->addChild(elem);
  425|  1.33M|}
_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: 916k]
  ------------------
  437|  1.32M|    delete name;
  438|  1.32M|    return NULL;
  439|  1.32M|  }
  440|   916k|  ++parsePtr;
  441|   916k|  parseSpace();
  442|   916k|  if (!(parsePtr < parseEnd && (*parsePtr == '"' || *parsePtr == '\''))) {
  ------------------
  |  Branch (442:9): [True: 916k, False: 43]
  |  Branch (442:33): [True: 866k, False: 50.0k]
  |  Branch (442:53): [True: 42.8k, False: 7.23k]
  ------------------
  443|  7.27k|    delete name;
  444|  7.27k|    return NULL;
  445|  7.27k|  }
  446|   908k|  quote = *parsePtr++;
  447|   908k|  value = new GString();
  448|  1.14M|  while (parsePtr < parseEnd && *parsePtr != quote) {
  ------------------
  |  Branch (448:10): [True: 1.14M, False: 594]
  |  Branch (448:33): [True: 238k, False: 908k]
  ------------------
  449|   238k|    if (*parsePtr == '&') {
  ------------------
  |  Branch (449:9): [True: 131k, False: 106k]
  ------------------
  450|   131k|      ++parsePtr;
  451|   131k|      if (parsePtr < parseEnd && *parsePtr == '#') {
  ------------------
  |  Branch (451:11): [True: 131k, False: 26]
  |  Branch (451:34): [True: 29.8k, False: 101k]
  ------------------
  452|  29.8k|	++parsePtr;
  453|  29.8k|	if (parsePtr < parseEnd && *parsePtr == 'x') {
  ------------------
  |  Branch (453:6): [True: 29.8k, False: 4]
  |  Branch (453:29): [True: 11.7k, False: 18.0k]
  ------------------
  454|  11.7k|	  ++parsePtr;
  455|  11.7k|	  x = 0;
  456|  59.9k|	  while (parsePtr < parseEnd) {
  ------------------
  |  Branch (456:11): [True: 59.8k, False: 35]
  ------------------
  457|  59.8k|	    c = *parsePtr;
  458|  59.8k|	    if (c >= '0' && c <= '9') {
  ------------------
  |  Branch (458:10): [True: 53.8k, False: 5.99k]
  |  Branch (458:22): [True: 9.35k, False: 44.5k]
  ------------------
  459|  9.35k|	      x = (x << 4) + (c - '0');
  460|  50.5k|	    } else if (c >= 'a' && c <= 'f') {
  ------------------
  |  Branch (460:17): [True: 18.5k, False: 31.9k]
  |  Branch (460:29): [True: 17.4k, False: 1.15k]
  ------------------
  461|  17.4k|	      x = (x << 4) + (10 + c - 'a');
  462|  33.1k|	    } else if (c >= 'A' && c <= 'F') {
  ------------------
  |  Branch (462:17): [True: 23.3k, False: 9.74k]
  |  Branch (462:29): [True: 21.3k, False: 1.97k]
  ------------------
  463|  21.3k|	      x = (x << 4) + (10 + c - 'A');
  464|  21.3k|	    } else {
  465|  11.7k|	      break;
  466|  11.7k|	    }
  467|  48.1k|	    ++parsePtr;
  468|  48.1k|	  }
  469|  11.7k|	  if (parsePtr < parseEnd && *parsePtr == ';') {
  ------------------
  |  Branch (469:8): [True: 11.7k, False: 35]
  |  Branch (469:31): [True: 2.38k, False: 9.33k]
  ------------------
  470|  2.38k|	    ++parsePtr;
  471|  2.38k|	  }
  472|  11.7k|	  appendUTF8(value, x);
  473|  18.0k|	} else {
  474|  18.0k|	  x = 0;
  475|  74.0k|	  while (parsePtr < parseEnd) {
  ------------------
  |  Branch (475:11): [True: 74.0k, False: 16]
  ------------------
  476|  74.0k|	    c = *parsePtr;
  477|  74.0k|	    if (c >= '0' && c <= '9') {
  ------------------
  |  Branch (477:10): [True: 61.2k, False: 12.8k]
  |  Branch (477:22): [True: 55.9k, False: 5.26k]
  ------------------
  478|  55.9k|	      x = x * 10 + (c - '0');
  479|  55.9k|	    } else {
  480|  18.0k|	      break;
  481|  18.0k|	    }
  482|  55.9k|	    ++parsePtr;
  483|  55.9k|	  }
  484|  18.0k|	  if (parsePtr < parseEnd && *parsePtr == ';') {
  ------------------
  |  Branch (484:8): [True: 18.0k, False: 16]
  |  Branch (484:31): [True: 1.62k, False: 16.4k]
  ------------------
  485|  1.62k|	    ++parsePtr;
  486|  1.62k|	  }
  487|  18.0k|	  appendUTF8(value, x);
  488|  18.0k|	}
  489|   101k|      } else {
  490|   101k|	start = parsePtr;
  491|   101k|	for (++parsePtr;
  492|  19.7M|	     parsePtr < parseEnd && *parsePtr != ';' &&
  ------------------
  |  Branch (492:7): [True: 19.7M, False: 293]
  |  Branch (492:30): [True: 19.7M, False: 2.64k]
  ------------------
  493|  19.7M|	       *parsePtr != quote && *parsePtr != '&';
  ------------------
  |  Branch (493:9): [True: 19.7M, False: 4.59k]
  |  Branch (493:31): [True: 19.6M, False: 94.2k]
  ------------------
  494|  19.6M|	     ++parsePtr) ;
  495|   101k|	n = (int)(parsePtr - start);
  496|   101k|	if (parsePtr < parseEnd && *parsePtr == ';') {
  ------------------
  |  Branch (496:6): [True: 101k, False: 293]
  |  Branch (496:29): [True: 2.64k, False: 98.8k]
  ------------------
  497|  2.64k|	  ++parsePtr;
  498|  2.64k|	}
  499|   101k|	if (n == 2 && !strncmp(start, "lt", 2)) {
  ------------------
  |  Branch (499:6): [True: 22.7k, False: 79.0k]
  |  Branch (499:16): [True: 1.23k, False: 21.5k]
  ------------------
  500|  1.23k|	  value->append('<');
  501|   100k|	} else if (n == 2 && !strncmp(start, "gt", 2)) {
  ------------------
  |  Branch (501:13): [True: 21.5k, False: 79.0k]
  |  Branch (501:23): [True: 14.8k, False: 6.65k]
  ------------------
  502|  14.8k|	  value->append('>');
  503|  85.6k|	} else if (n == 3 && !strncmp(start, "amp", 3)) {
  ------------------
  |  Branch (503:13): [True: 19.1k, False: 66.5k]
  |  Branch (503:23): [True: 14.3k, False: 4.76k]
  ------------------
  504|  14.3k|	  value->append('&');
  505|  71.3k|	} else if (n == 4 && !strncmp(start, "apos", 4)) {
  ------------------
  |  Branch (505:13): [True: 11.8k, False: 59.4k]
  |  Branch (505:23): [True: 1.18k, False: 10.6k]
  ------------------
  506|  1.18k|	  value->append('\'');
  507|  70.1k|	} else if (n == 4 && !strncmp(start, "quot", 4)) {
  ------------------
  |  Branch (507:13): [True: 10.6k, False: 59.4k]
  |  Branch (507:23): [True: 3.18k, False: 7.47k]
  ------------------
  508|  3.18k|	  value->append('"');
  509|  66.9k|	} else {
  510|  66.9k|	  value->append(start - 1, (int)(parsePtr - start) + 1);
  511|  66.9k|	}
  512|   101k|      }
  513|   131k|    } else {
  514|   106k|      start = parsePtr;
  515|   106k|      for (++parsePtr;
  516|  6.21M|	   parsePtr < parseEnd && *parsePtr != quote && *parsePtr != '&';
  ------------------
  |  Branch (516:5): [True: 6.21M, False: 133]
  |  Branch (516:28): [True: 6.12M, False: 91.6k]
  |  Branch (516:50): [True: 6.10M, False: 15.1k]
  ------------------
  517|  6.10M|	   ++parsePtr) ;
  518|   106k|      value->append(start, (int)(parsePtr - start));
  519|   106k|    }
  520|   238k|  }
  521|   908k|  if (parsePtr < parseEnd && *parsePtr == quote) {
  ------------------
  |  Branch (521:7): [True: 908k, False: 594]
  |  Branch (521:30): [True: 908k, False: 0]
  ------------------
  522|   908k|    ++parsePtr;
  523|   908k|  }
  524|   908k|  return new ZxAttr(name, value);
  525|   916k|}
_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.69M|  while (parsePtr < parseEnd) {
  ------------------
  |  Branch (533:10): [True: 1.50M, False: 1.19M]
  ------------------
  534|  1.50M|    if (match(endType->getCString())) {
  ------------------
  |  Branch (534:9): [True: 13.5k, False: 1.49M]
  ------------------
  535|  13.5k|      parsePtr += endType->getLength();
  536|  13.5k|      parseSpace();
  537|  13.5k|      if (match(">")) {
  ------------------
  |  Branch (537:11): [True: 4.03k, False: 9.54k]
  ------------------
  538|  4.03k|	++parsePtr;
  539|  4.03k|      }
  540|  13.5k|      break;
  541|  1.49M|    } else if (match("<?")) {
  ------------------
  |  Branch (541:16): [True: 14.7k, False: 1.47M]
  ------------------
  542|  14.7k|      parsePI(par);
  543|  1.47M|    } else if (match("<![CDATA[")) {
  ------------------
  |  Branch (543:16): [True: 4.10k, False: 1.47M]
  ------------------
  544|  4.10k|      parseCDSect(par);
  545|  1.47M|    } else if (match("<!--")) {
  ------------------
  |  Branch (545:16): [True: 841, False: 1.47M]
  ------------------
  546|    841|      parseComment(par);
  547|  1.47M|    } else if (match("<")) {
  ------------------
  |  Branch (547:16): [True: 1.32M, False: 141k]
  ------------------
  548|  1.32M|      parseElement(par);
  549|  1.32M|    } else {
  550|   141k|      parseCharData(par);
  551|   141k|    }
  552|  1.50M|  }
  553|       |
  554|  1.20M|  delete endType;
  555|  1.20M|}
_ZN5ZxDoc13parseCharDataEP9ZxElement:
  557|   141k|void ZxDoc::parseCharData(ZxElement *par) {
  558|   141k|  GString *data;
  559|   141k|  const char *start;
  560|   141k|  char c;
  561|   141k|  unsigned int x;
  562|   141k|  int n;
  563|       |
  564|   141k|  data = new GString();
  565|   717k|  while (parsePtr < parseEnd && *parsePtr != '<') {
  ------------------
  |  Branch (565:10): [True: 716k, False: 954]
  |  Branch (565:33): [True: 575k, False: 140k]
  ------------------
  566|   575k|    if (*parsePtr == '&') {
  ------------------
  |  Branch (566:9): [True: 435k, False: 139k]
  ------------------
  567|   435k|      ++parsePtr;
  568|   435k|      if (parsePtr < parseEnd && *parsePtr == '#') {
  ------------------
  |  Branch (568:11): [True: 435k, False: 47]
  |  Branch (568:34): [True: 86.9k, False: 348k]
  ------------------
  569|  86.9k|	++parsePtr;
  570|  86.9k|	if (parsePtr < parseEnd && *parsePtr == 'x') {
  ------------------
  |  Branch (570:6): [True: 86.8k, False: 10]
  |  Branch (570:29): [True: 23.0k, False: 63.8k]
  ------------------
  571|  23.0k|	  ++parsePtr;
  572|  23.0k|	  x = 0;
  573|   138k|	  while (parsePtr < parseEnd) {
  ------------------
  |  Branch (573:11): [True: 138k, False: 204]
  ------------------
  574|   138k|	    c = *parsePtr;
  575|   138k|	    if (c >= '0' && c <= '9') {
  ------------------
  |  Branch (575:10): [True: 125k, False: 12.8k]
  |  Branch (575:22): [True: 42.9k, False: 82.7k]
  ------------------
  576|  42.9k|	      x = (x << 4) + (c - '0');
  577|  95.6k|	    } else if (c >= 'a' && c <= 'f') {
  ------------------
  |  Branch (577:17): [True: 33.8k, False: 61.8k]
  |  Branch (577:29): [True: 32.5k, False: 1.32k]
  ------------------
  578|  32.5k|	      x = (x << 4) + (10 + c - 'a');
  579|  63.1k|	    } else if (c >= 'A' && c <= 'F') {
  ------------------
  |  Branch (579:17): [True: 42.3k, False: 20.7k]
  |  Branch (579:29): [True: 40.2k, False: 2.03k]
  ------------------
  580|  40.2k|	      x = (x << 4) + (10 + c - 'A');
  581|  40.2k|	    } else {
  582|  22.8k|	      break;
  583|  22.8k|	    }
  584|   115k|	    ++parsePtr;
  585|   115k|	  }
  586|  23.0k|	  if (parsePtr < parseEnd && *parsePtr == ';') {
  ------------------
  |  Branch (586:8): [True: 22.8k, False: 204]
  |  Branch (586:31): [True: 5.14k, False: 17.6k]
  ------------------
  587|  5.14k|	    ++parsePtr;
  588|  5.14k|	  }
  589|  23.0k|	  appendUTF8(data, x);
  590|  63.8k|	} else {
  591|  63.8k|	  x = 0;
  592|   311k|	  while (parsePtr < parseEnd) {
  ------------------
  |  Branch (592:11): [True: 311k, False: 70]
  ------------------
  593|   311k|	    c = *parsePtr;
  594|   311k|	    if (c >= '0' && c <= '9') {
  ------------------
  |  Branch (594:10): [True: 273k, False: 38.0k]
  |  Branch (594:22): [True: 247k, False: 25.7k]
  ------------------
  595|   247k|	      x = x * 10 + (c - '0');
  596|   247k|	    } else {
  597|  63.8k|	      break;
  598|  63.8k|	    }
  599|   247k|	    ++parsePtr;
  600|   247k|	  }
  601|  63.8k|	  if (parsePtr < parseEnd && *parsePtr == ';') {
  ------------------
  |  Branch (601:8): [True: 63.8k, False: 70]
  |  Branch (601:31): [True: 11.6k, False: 52.1k]
  ------------------
  602|  11.6k|	    ++parsePtr;
  603|  11.6k|	  }
  604|  63.8k|	  appendUTF8(data, x);
  605|  63.8k|	}
  606|   348k|      } else {
  607|   348k|	start = parsePtr;
  608|   348k|	for (++parsePtr;
  609|  17.9M|	     parsePtr < parseEnd && *parsePtr != ';' &&
  ------------------
  |  Branch (609:7): [True: 17.9M, False: 326]
  |  Branch (609:30): [True: 17.9M, False: 5.59k]
  ------------------
  610|  17.9M|	       *parsePtr != '<' && *parsePtr != '&';
  ------------------
  |  Branch (610:9): [True: 17.9M, False: 53.4k]
  |  Branch (610:29): [True: 17.6M, False: 289k]
  ------------------
  611|  17.6M|	     ++parsePtr) ;
  612|   348k|	n = (int)(parsePtr - start);
  613|   348k|	if (parsePtr < parseEnd && *parsePtr == ';') {
  ------------------
  |  Branch (613:6): [True: 348k, False: 326]
  |  Branch (613:29): [True: 5.59k, False: 342k]
  ------------------
  614|  5.59k|	  ++parsePtr;
  615|  5.59k|	}
  616|   348k|	if (n == 2 && !strncmp(start, "lt", 2)) {
  ------------------
  |  Branch (616:6): [True: 133k, False: 215k]
  |  Branch (616:16): [True: 3.80k, False: 129k]
  ------------------
  617|  3.80k|	  data->append('<');
  618|   344k|	} else if (n == 2 && !strncmp(start, "gt", 2)) {
  ------------------
  |  Branch (618:13): [True: 129k, False: 215k]
  |  Branch (618:23): [True: 95.4k, False: 34.2k]
  ------------------
  619|  95.4k|	  data->append('>');
  620|   249k|	} else if (n == 3 && !strncmp(start, "amp", 3)) {
  ------------------
  |  Branch (620:13): [True: 56.4k, False: 192k]
  |  Branch (620:23): [True: 33.7k, False: 22.7k]
  ------------------
  621|  33.7k|	  data->append('&');
  622|   215k|	} else if (n == 4 && !strncmp(start, "apos", 4)) {
  ------------------
  |  Branch (622:13): [True: 61.0k, False: 154k]
  |  Branch (622:23): [True: 1.38k, False: 59.6k]
  ------------------
  623|  1.38k|	  data->append('\'');
  624|   214k|	} else if (n == 4 && !strncmp(start, "quot", 4)) {
  ------------------
  |  Branch (624:13): [True: 59.6k, False: 154k]
  |  Branch (624:23): [True: 18.7k, False: 40.8k]
  ------------------
  625|  18.7k|	  data->append('"');
  626|   195k|	} else {
  627|   195k|	  data->append(start - 1, (int)(parsePtr - start) + 1);
  628|   195k|	}
  629|   348k|      }
  630|   435k|    } else {
  631|   139k|      start = parsePtr;
  632|   139k|      for (++parsePtr;
  633|  12.6M|	   parsePtr < parseEnd && *parsePtr != '<' && *parsePtr != '&';
  ------------------
  |  Branch (633:5): [True: 12.6M, False: 334]
  |  Branch (633:28): [True: 12.6M, False: 83.2k]
  |  Branch (633:48): [True: 12.5M, False: 56.3k]
  ------------------
  634|  12.5M|	   ++parsePtr) ;
  635|   139k|      data->append(start, (int)(parsePtr - start));
  636|   139k|    }
  637|   575k|  }
  638|   141k|  par->addChild(new ZxCharData(data, true));
  639|   141k|}
_ZN5ZxDoc10appendUTF8EP7GStringj:
  641|   116k|void ZxDoc::appendUTF8(GString *s, unsigned int c) {
  642|   116k|  if (c <= 0x7f) {
  ------------------
  |  Branch (642:7): [True: 51.0k, False: 65.7k]
  ------------------
  643|  51.0k|    s->append((char)c);
  644|  65.7k|  } else if (c <= 0x7ff) {
  ------------------
  |  Branch (644:14): [True: 8.45k, False: 57.2k]
  ------------------
  645|  8.45k|    s->append((char)(0xc0 + (c >> 6)));
  646|  8.45k|    s->append((char)(0x80 + (c & 0x3f)));
  647|  57.2k|  } else if (c <= 0xffff) {
  ------------------
  |  Branch (647:14): [True: 13.5k, False: 43.7k]
  ------------------
  648|  13.5k|    s->append((char)(0xe0 + (c >> 12)));
  649|  13.5k|    s->append((char)(0x80 + ((c >> 6) & 0x3f)));
  650|  13.5k|    s->append((char)(0x80 + (c & 0x3f)));
  651|  43.7k|  } else if (c <= 0x1fffff) {
  ------------------
  |  Branch (651:14): [True: 14.9k, False: 28.7k]
  ------------------
  652|  14.9k|    s->append((char)(0xf0 + (c >> 18)));
  653|  14.9k|    s->append((char)(0x80 + ((c >> 12) & 0x3f)));
  654|  14.9k|    s->append((char)(0x80 + ((c >> 6) & 0x3f)));
  655|  14.9k|    s->append((char)(0x80 + (c & 0x3f)));
  656|  28.7k|  } else if (c <= 0x3ffffff) {
  ------------------
  |  Branch (656:14): [True: 6.42k, False: 22.3k]
  ------------------
  657|  6.42k|    s->append((char)(0xf8 + (c >> 24)));
  658|  6.42k|    s->append((char)(0x80 + ((c >> 18) & 0x3f)));
  659|  6.42k|    s->append((char)(0x80 + ((c >> 12) & 0x3f)));
  660|  6.42k|    s->append((char)(0x80 + ((c >> 6) & 0x3f)));
  661|  6.42k|    s->append((char)(0x80 + (c & 0x3f)));
  662|  22.3k|  } else if (c <= 0x7fffffff) {
  ------------------
  |  Branch (662:14): [True: 16.0k, False: 6.36k]
  ------------------
  663|  16.0k|    s->append((char)(0xfc + (c >> 30)));
  664|  16.0k|    s->append((char)(0x80 + ((c >> 24) & 0x3f)));
  665|  16.0k|    s->append((char)(0x80 + ((c >> 18) & 0x3f)));
  666|  16.0k|    s->append((char)(0x80 + ((c >> 12) & 0x3f)));
  667|  16.0k|    s->append((char)(0x80 + ((c >> 6) & 0x3f)));
  668|  16.0k|    s->append((char)(0x80 + (c & 0x3f)));
  669|  16.0k|  }
  670|   116k|}
_ZN5ZxDoc11parseCDSectEP6ZxNode:
  673|  4.10k|void ZxDoc::parseCDSect(ZxNode *par) {
  674|  4.10k|  const char *start;
  675|       |
  676|  4.10k|  parsePtr += 9;
  677|  4.10k|  start = parsePtr;
  678|   477k|  while (parsePtr < parseEnd - 3) {
  ------------------
  |  Branch (678:10): [True: 477k, False: 44]
  ------------------
  679|   477k|    if (!strncmp(parsePtr, "]]>", 3)) {
  ------------------
  |  Branch (679:9): [True: 4.06k, False: 473k]
  ------------------
  680|  4.06k|      par->addChild(new ZxCharData(new GString(start, (int)(parsePtr - start)),
  681|  4.06k|				   false));
  682|  4.06k|      parsePtr += 3;
  683|  4.06k|      return;
  684|  4.06k|    }
  685|   473k|    ++parsePtr;
  686|   473k|  }
  687|     44|  parsePtr = parseEnd;
  688|     44|  par->addChild(new ZxCharData(new GString(start, (int)(parsePtr - start)),
  689|     44|			       false));
  690|     44|}
_ZN5ZxDoc9parseMiscEP6ZxNode:
  692|  11.3k|void ZxDoc::parseMisc(ZxNode *par) {
  693|  13.8k|  while (1) {
  ------------------
  |  Branch (693:10): [True: 13.8k, Folded]
  ------------------
  694|  13.8k|    if (match("<!--")) {
  ------------------
  |  Branch (694:9): [True: 639, False: 13.2k]
  ------------------
  695|    639|      parseComment(par);
  696|  13.2k|    } else if (match("<?")) {
  ------------------
  |  Branch (696:16): [True: 906, False: 12.3k]
  ------------------
  697|    906|      parsePI(par);
  698|  12.3k|    } else if (parsePtr < parseEnd && (*parsePtr == '\x20' ||
  ------------------
  |  Branch (698:16): [True: 7.75k, False: 4.59k]
  |  Branch (698:40): [True: 246, False: 7.50k]
  ------------------
  699|  7.50k|				       *parsePtr == '\x09' ||
  ------------------
  |  Branch (699:12): [True: 336, False: 7.17k]
  ------------------
  700|  7.17k|				       *parsePtr == '\x0d' ||
  ------------------
  |  Branch (700:12): [True: 344, False: 6.82k]
  ------------------
  701|  6.82k|				       *parsePtr == '\x0a')) {
  ------------------
  |  Branch (701:12): [True: 75, False: 6.75k]
  ------------------
  702|  1.00k|      ++parsePtr;
  703|  11.3k|    } else {
  704|  11.3k|      break;
  705|  11.3k|    }
  706|  13.8k|  }
  707|  11.3k|}
_ZN5ZxDoc12parseCommentEP6ZxNode:
  710|  1.48k|void ZxDoc::parseComment(ZxNode *par) {
  711|  1.48k|  const char *start;
  712|       |
  713|  1.48k|  parsePtr += 4;
  714|  1.48k|  start = parsePtr;
  715|   395k|  while (parsePtr <= parseEnd - 3) {
  ------------------
  |  Branch (715:10): [True: 394k, False: 57]
  ------------------
  716|   394k|    if (!strncmp(parsePtr, "-->", 3)) {
  ------------------
  |  Branch (716:9): [True: 1.42k, False: 393k]
  ------------------
  717|  1.42k|      par->addChild(new ZxComment(new GString(start, (int)(parsePtr - start))));
  718|  1.42k|      parsePtr += 3;
  719|  1.42k|      return;
  720|  1.42k|    }
  721|   393k|    ++parsePtr;
  722|   393k|  }
  723|     57|  parsePtr = parseEnd;
  724|     57|}
_ZN5ZxDoc7parsePIEP6ZxNode:
  727|  15.6k|void ZxDoc::parsePI(ZxNode *par) {
  728|  15.6k|  GString *target;
  729|  15.6k|  const char *start;
  730|       |
  731|  15.6k|  parsePtr += 2;
  732|  15.6k|  target = parseName();
  733|  15.6k|  parseSpace();
  734|  15.6k|  start = parsePtr;
  735|  7.59M|  while (parsePtr <= parseEnd - 2) {
  ------------------
  |  Branch (735:10): [True: 7.59M, False: 209]
  ------------------
  736|  7.59M|    if (!strncmp(parsePtr, "?>", 2)) {
  ------------------
  |  Branch (736:9): [True: 15.4k, False: 7.57M]
  ------------------
  737|  15.4k|      par->addChild(new ZxPI(target, new GString(start,
  738|  15.4k|						 (int)(parsePtr - start))));
  739|  15.4k|      parsePtr += 2;
  740|  15.4k|      return;
  741|  15.4k|    }
  742|  7.57M|    ++parsePtr;
  743|  7.57M|  }
  744|    209|  parsePtr = parseEnd;
  745|    209|  par->addChild(new ZxPI(target, new GString(start, (int)(parsePtr - start))));
  746|    209|}
_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.14k]
  |  Branch (754:30): [True: 138k, False: 3.44M]
  ------------------
  755|   138k|    name->append(*parsePtr++);
  756|  12.4M|    while (parsePtr < parseEnd && nameChar[*parsePtr & 0xff]) {
  ------------------
  |  Branch (756:12): [True: 12.4M, False: 110]
  |  Branch (756:35): [True: 12.2M, False: 138k]
  ------------------
  757|  12.2M|      name->append(*parsePtr++);
  758|  12.2M|    }
  759|   138k|  }
  760|  3.58M|  return name;
  761|  3.58M|}
_ZN5ZxDoc17parseQuotedStringEv:
  763|    374|GString *ZxDoc::parseQuotedString() {
  764|    374|  GString *s;
  765|    374|  const char *start;
  766|    374|  char quote;
  767|       |
  768|    374|  if (parsePtr < parseEnd && (*parsePtr == '"' || *parsePtr == '\'')) {
  ------------------
  |  Branch (768:7): [True: 282, False: 92]
  |  Branch (768:31): [True: 75, False: 207]
  |  Branch (768:51): [True: 97, False: 110]
  ------------------
  769|    172|    quote = *parsePtr++;
  770|    172|    start = parsePtr;
  771|    823|    while (parsePtr < parseEnd && *parsePtr != quote) {
  ------------------
  |  Branch (771:12): [True: 777, False: 46]
  |  Branch (771:35): [True: 651, False: 126]
  ------------------
  772|    651|      ++parsePtr;
  773|    651|    }
  774|    172|    s = new GString(start, (int)(parsePtr - start));
  775|    172|    if (parsePtr < parseEnd && *parsePtr == quote) {
  ------------------
  |  Branch (775:9): [True: 126, False: 46]
  |  Branch (775:32): [True: 126, False: 0]
  ------------------
  776|    126|      ++parsePtr;
  777|    126|    }
  778|    202|  } else {
  779|    202|    s = new GString();
  780|    202|  }
  781|    374|  return s;
  782|    374|}
_ZN5ZxDoc8parseBOMEv:
  784|  3.78k|void ZxDoc::parseBOM() {
  785|  3.78k|  if (match("\xef\xbb\xbf")) {
  ------------------
  |  Branch (785:7): [True: 37, False: 3.74k]
  ------------------
  786|     37|    parsePtr += 3;
  787|     37|  }
  788|  3.78k|}
_ZN5ZxDoc10parseSpaceEv:
  790|  5.44M|void ZxDoc::parseSpace() {
  791|  5.75M|  while (parsePtr < parseEnd && (*parsePtr == '\x20' ||
  ------------------
  |  Branch (791:10): [True: 5.75M, False: 3.16k]
  |  Branch (791:34): [True: 138k, False: 5.61M]
  ------------------
  792|  5.61M|				 *parsePtr == '\x09' ||
  ------------------
  |  Branch (792:6): [True: 66.9k, False: 5.55M]
  ------------------
  793|  5.55M|				 *parsePtr == '\x0d' ||
  ------------------
  |  Branch (793:6): [True: 60.5k, False: 5.49M]
  ------------------
  794|  5.49M|				 *parsePtr == '\x0a')) {
  ------------------
  |  Branch (794:6): [True: 53.4k, False: 5.43M]
  ------------------
  795|   319k|    ++parsePtr;
  796|   319k|  }
  797|  5.44M|}
_ZN5ZxDoc5matchEPKc:
  799|  12.3M|bool ZxDoc::match(const char *s) {
  800|  12.3M|  int n;
  801|       |
  802|  12.3M|  n = (int)strlen(s);
  803|  12.3M|  return parseEnd - parsePtr >= n && !strncmp(parsePtr, s, n);
  ------------------
  |  Branch (803:10): [True: 12.3M, False: 21.8k]
  |  Branch (803:38): [True: 3.53M, False: 8.79M]
  ------------------
  804|  12.3M|}
_ZN9ZxXMLDeclC2EP7GStringS1_b:
  822|    791|ZxXMLDecl::ZxXMLDecl(GString *versionA, GString *encodingA, bool standaloneA) {
  823|    791|  version = versionA;
  824|    791|  encoding = encodingA;
  825|    791|  standalone = standaloneA;
  826|    791|}
_ZN9ZxXMLDeclD2Ev:
  828|    791|ZxXMLDecl::~ZxXMLDecl() {
  829|    791|  delete version;
  830|    791|  if (encoding) {
  ------------------
  |  Branch (830:7): [True: 114, False: 677]
  ------------------
  831|    114|    delete encoding;
  832|    114|  }
  833|    791|}
_ZN13ZxDocTypeDeclC2EP7GString:
  858|    251|ZxDocTypeDecl::ZxDocTypeDecl(GString *nameA) {
  859|    251|  name = nameA;
  860|    251|}
_ZN13ZxDocTypeDeclD2Ev:
  862|    251|ZxDocTypeDecl::~ZxDocTypeDecl() {
  863|    251|  delete name;
  864|    251|}
_ZN9ZxCommentC2EP7GString:
  880|  1.42k|ZxComment::ZxComment(GString *textA) {
  881|  1.42k|  text = textA;
  882|  1.42k|}
_ZN9ZxCommentD2Ev:
  884|  1.42k|ZxComment::~ZxComment() {
  885|  1.42k|  delete text;
  886|  1.42k|}
_ZN4ZxPIC2EP7GStringS1_:
  902|  15.6k|ZxPI::ZxPI(GString *targetA, GString *textA) {
  903|  15.6k|  target = targetA;
  904|  15.6k|  text = textA;
  905|  15.6k|}
_ZN4ZxPID2Ev:
  907|  15.6k|ZxPI::~ZxPI() {
  908|  15.6k|  delete target;
  909|  15.6k|  delete text;
  910|  15.6k|}
_ZN9ZxElementC2EP7GString:
  928|  1.33M|ZxElement::ZxElement(GString *typeA) {
  929|  1.33M|  type = typeA;
  930|  1.33M|  attrs = new GHash();
  931|       |  firstAttr = lastAttr = NULL;
  932|  1.33M|}
_ZN9ZxElementD2Ev:
  934|  1.33M|ZxElement::~ZxElement() {
  935|  1.33M|  delete type;
  936|  1.33M|  deleteGHash(attrs, ZxAttr);
  ------------------
  |  |   60|  1.33M|  do {                                             \
  |  |   61|  1.33M|    GHash *_hash = (hash);                         \
  |  |   62|  1.33M|    {                                              \
  |  |   63|  1.33M|      GHashIter *_iter;                            \
  |  |   64|  1.33M|      GString *_key;                               \
  |  |   65|  1.33M|      void *_p;                                    \
  |  |   66|  1.33M|      _hash->startIter(&_iter);                    \
  |  |   67|  2.24M|      while (_hash->getNext(&_iter, &_key, &_p)) { \
  |  |  ------------------
  |  |  |  Branch (67:14): [True: 908k, False: 1.33M]
  |  |  ------------------
  |  |   68|   908k|        delete (T*)_p;                             \
  |  |   69|   908k|      }                                            \
  |  |   70|  1.33M|      delete _hash;                                \
  |  |   71|  1.33M|    }                                              \
  |  |   72|  1.33M|  } while(0)
  |  |  ------------------
  |  |  |  Branch (72:11): [Folded, False: 1.33M]
  |  |  ------------------
  ------------------
  937|  1.33M|}
_ZN9ZxElement7addAttrEP6ZxAttr:
  947|   908k|void ZxElement::addAttr(ZxAttr *attr) {
  948|   908k|  attrs->add(attr->getName(), attr);
  949|   908k|  if (lastAttr) {
  ------------------
  |  Branch (949:7): [True: 859k, False: 49.2k]
  ------------------
  950|   859k|    lastAttr->next = attr;
  951|   859k|    lastAttr= attr;
  952|   859k|  } else {
  953|  49.2k|    firstAttr = lastAttr = attr;
  954|  49.2k|  }
  955|   908k|  attr->parent = this;
  956|       |  attr->next = NULL;
  957|   908k|}
_ZN6ZxAttrC2EP7GStringS1_:
 1025|   908k|ZxAttr::ZxAttr(GString *nameA, GString *valueA) {
 1026|   908k|  name = nameA;
 1027|   908k|  value = valueA;
 1028|   908k|  parent = NULL;
 1029|       |  next = NULL;
 1030|   908k|}
_ZN6ZxAttrD2Ev:
 1032|   908k|ZxAttr::~ZxAttr() {
 1033|   908k|  delete name;
 1034|   908k|  delete value;
 1035|   908k|}
_ZN10ZxCharDataC2EP7GStringb:
 1039|   145k|ZxCharData::ZxCharData(GString *dataA, bool parsedA) {
 1040|   145k|  data = dataA;
 1041|   145k|  parsed = parsedA;
 1042|   145k|}
_ZN10ZxCharDataD2Ev:
 1044|   145k|ZxCharData::~ZxCharData() {
 1045|   145k|  delete data;
 1046|   145k|}

_ZN6ZxNode9isXMLDeclEv:
   36|  4.21k|  virtual bool isXMLDecl()  { return false; }
_ZN6ZxNode13isDocTypeDeclEv:
   37|  3.96k|  virtual bool isDocTypeDecl() { return false; }
_ZN6ZxNode9isElementEv:
   40|  1.50k|  virtual bool isElement() { return false; }
_ZN9ZxXMLDecl9isXMLDeclEv:
  129|    791|  virtual bool isXMLDecl() { return true; }
_ZN13ZxDocTypeDecl13isDocTypeDeclEv:
  151|    251|  virtual bool isDocTypeDecl() { return true; }
_ZN9ZxElement9isElementEv:
  207|  2.46k|  virtual bool isElement() { return true; }
_ZN9ZxElement7getTypeEv:
  209|  1.20M|  GString *getType() { return type; }
_ZN6ZxAttr7getNameEv:
  233|   908k|  GString *getName() { return name; }

